(ctx context.Context, orgID uuid.UUID, name string)
| 324 | } |
| 325 | |
| 326 | func (g GroupRepo) FindByOrgAndName(ctx context.Context, orgID uuid.UUID, name string) (*biz.Group, error) { |
| 327 | ctx, span := otelx.Start(ctx, groupRepoTracer, "GroupRepo.FindByOrgAndName") |
| 328 | defer span.End() |
| 329 | |
| 330 | entGroup, err := g.data.DB.Group.Query(). |
| 331 | Where(group.DeletedAtIsNil(), group.Name(name), group.OrganizationID(orgID)). |
| 332 | WithOrganization(). |
| 333 | Only(ctx) |
| 334 | if err != nil { |
| 335 | if ent.IsNotFound(err) { |
| 336 | return nil, biz.NewErrNotFound("group") |
| 337 | } |
| 338 | return nil, err |
| 339 | } |
| 340 | |
| 341 | return entGroupToBiz(entGroup), nil |
| 342 | } |
| 343 | |
| 344 | // FindGroupMembershipByGroupAndID retrieves a group membership for a specific user in a group. |
| 345 | func (g GroupRepo) FindGroupMembershipByGroupAndID(ctx context.Context, groupID uuid.UUID, userID uuid.UUID) (*biz.GroupMembership, error) { |
nothing calls this directly
no test coverage detected