def org_member_domain_entity_from_repo_model(org_member_repo_model): org_member = OrganizationMember( org_member_repo_model.org_uuid, org_member_repo_model.username, org_member_repo_model.status, org_member_repo_model.role, org_member_repo_model.address, org_member_repo_model.invite_code, org_member_repo_model.transaction_hash, org_member_repo_model.invited_on, org_member_repo_model.updated_on) return org_member
def parser_org_members_from_metadata(org_uuid, members, status): org_members = [] for member in members: org_members.append( OrganizationMember(org_uuid, "", status, Role.MEMBER.value, member)) return org_members
def org_member_domain_entity_from_payload(payload, org_uuid): username = payload.get("username", "") status = payload.get("status", "") role = payload.get("role", "") address = payload.get("address", "") invite_code = payload.get("invite_code", "") transaction_hash = payload.get("transaction_hash", "") org_member = OrganizationMember(org_uuid, username, status, role, address, invite_code, transaction_hash) return org_member
def parser_org_owner_from_metadata(org_uuid, owner, status): return OrganizationMember(org_uuid, "", status, Role.OWNER.value, owner)