(ctx context.Context, orgID uuid.UUID, senderID *uuid.UUID, receiverEmail string, role authz.Role, invCtx *biz.OrgInvitationContext)
| 44 | } |
| 45 | |
| 46 | func (r *OrgInvitation) Create(ctx context.Context, orgID uuid.UUID, senderID *uuid.UUID, receiverEmail string, role authz.Role, invCtx *biz.OrgInvitationContext) (*biz.OrgInvitation, error) { |
| 47 | ctx, span := otelx.Start(ctx, orgInvitationRepoTracer, "OrgInvitation.Create") |
| 48 | defer span.End() |
| 49 | |
| 50 | update := r.data.DB.OrgInvitation.Create(). |
| 51 | SetOrganizationID(orgID). |
| 52 | SetRole(role). |
| 53 | SetReceiverEmail(receiverEmail). |
| 54 | SetNillableContext(invCtx) |
| 55 | |
| 56 | if senderID != nil { |
| 57 | update.SetSenderID(*senderID) |
| 58 | } |
| 59 | |
| 60 | invite, err := update.Save(ctx) |
| 61 | if err != nil { |
| 62 | return nil, err |
| 63 | } |
| 64 | |
| 65 | return r.FindByID(ctx, invite.ID) |
| 66 | } |
| 67 | |
| 68 | func (r *OrgInvitation) PendingInvitation(ctx context.Context, orgID uuid.UUID, receiverEmail string) (*biz.OrgInvitation, error) { |
| 69 | ctx, span := otelx.Start(ctx, orgInvitationRepoTracer, "OrgInvitation.PendingInvitation") |
nothing calls this directly
no test coverage detected