def group_domain_entity_from_payload(payload): group_id = payload["id"] group_name = payload["name"] payment_address = payload["payment_address"] payment_config = payload["payment_config"] group = Group(group_name, group_id, payment_address, payment_config, '') group.setup_id() return group
def parse_group_domain_entity_from_metadata(payload): group_id = payload["group_id"] group_name = payload["group_name"] payment_address = payload['payment']["payment_address"] payment_config = {"payment_expiration_threshold": payload['payment']["payment_expiration_threshold"], "payment_channel_storage_type": payload['payment']["payment_channel_storage_type"], "payment_channel_storage_client": payload['payment']["payment_channel_storage_client"]} group = Group(group_name, group_id, payment_address, payment_config, '') group.setup_id() return group
def parse_group_data_model(items): groups = [] for group in items: groups.append( Group(group.name, group.id, group.payment_address, group.payment_config, group.status)) return groups