MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / entGroupToBiz

Function entGroupToBiz

app/controlplane/pkg/data/group.go:796–813  ·  view source on GitHub ↗

entGroupToBiz converts an ent.Group to a biz.Group.

(gr *ent.Group)

Source from the content-addressed store, hash-verified

794
795// entGroupToBiz converts an ent.Group to a biz.Group.
796func 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.
816func entGroupMembershipToBiz(gu *ent.GroupMembership) *biz.GroupMembership {

Callers 5

ListMethod · 0.85
FindByOrgAndIDMethod · 0.85
FindByOrgAndNameMethod · 0.85

Calls 2

entOrgToBizOrgFunction · 0.85
toTimePtrFunction · 0.70

Tested by

no test coverage detected