entGroupToBiz converts an ent.Group to a biz.Group.
(gr *ent.Group)
| 794 | |
| 795 | // entGroupToBiz converts an ent.Group to a biz.Group. |
| 796 | func entGroupToBiz(gr *ent.Group) *biz.Group { |
| 797 | grp := &biz.Group{ |
| 798 | ID: gr.ID, |
| 799 | Name: gr.Name, |
| 800 | Description: gr.Description, |
| 801 | MemberCount: gr.MemberCount, |
| 802 | CreatedAt: toTimePtr(gr.CreatedAt), |
| 803 | UpdatedAt: toTimePtr(gr.UpdatedAt), |
| 804 | DeletedAt: toTimePtr(gr.DeletedAt), |
| 805 | } |
| 806 | |
| 807 | // Include the organization to which the group belongs |
| 808 | if gr.Edges.Organization != nil { |
| 809 | grp.Organization = entOrgToBizOrg(gr.Edges.Organization) |
| 810 | } |
| 811 | |
| 812 | return grp |
| 813 | } |
| 814 | |
| 815 | // entGroupMembershipToBiz converts an ent.GroupMembership to a biz.GroupMembership. |
| 816 | func entGroupMembershipToBiz(gu *ent.GroupMembership) *biz.GroupMembership { |
no test coverage detected