invitations
| Function Name | Operation Type | Description | Arguments | Returns |
|---|---|---|---|---|
CreateInvitation |
Create (Insert) | Inserts a new invitation and returns the complete record, including inviter details. | ctx context.Context, arg CreateInvitationParams |
CreateInvitationRow, error |
UpdateInvitationStatus |
Update | Updates an invitation's status and returns the full updated record with inviter details. | ctx context.Context, arg UpdateInvitationStatusParams |
UpdateInvitationStatusRow, error |
DeleteInvitation |
Delete | Deletes a pending invitation by its ID (only if status is 'pending'). | ctx context.Context, id int64 |
error |
GetInvitationByID |
Read (Select) | Retrieves a single invitation by its ID for validation and status checking, including inviter details. | ctx context.Context, id int64 |
GetInvitationByIDRow, error |
GetInvitationByToken |
Read (Select) | Retrieves a single, non-expired, pending invitation by its unique token, including inviter details. | ctx context.Context, invitationToken string |
GetInvitationByTokenRow, error |
GetInvitationByEmail |
Read (Select) | Retrieves a pending invitation for a given email, including inviter details. | ctx context.Context, email string |
GetInvitationByEmailRow, error |
ListAllInvitations |
Read (Select) | (For Admins) Retrieves a paginated list of all invitations system-wide, ordered by creation date (newest first). | ctx context.Context, arg ListAllInvitationsParams |
[]ListAllInvitationsRow, error |
ListInvitationsByInviter |
Read (Select) | (For Managers & Admins) Retrieves a paginated list of invitations sent by a specific inviter, ordered by creation date. | ctx context.Context, arg ListInvitationsByInviterParams |
[]ListInvitationsByInviterRow, error |
ListInvitationsByInviterRole |
Read (Select) | (For Admins) Retrieves a paginated list of invitations sent by users with a specific role (admin/manager). | ctx context.Context, arg ListInvitationsByInviterRoleParams |
[]ListInvitationsByInviterRoleRow, error |
CountAllInvitations |
Read (Count) | Returns the total count of all invitations in the system for pagination metadata. | ctx context.Context |
int64, error |
CountInvitationsByInviter |
Read (Count) | Returns the total count of invitations sent by a specific inviter for pagination metadata. | ctx context.Context, inviterID int64 |
int64, error |
CountInvitationsByInviterRole |
Read (Count) | Returns the total count of invitations sent by users with a specific role for pagination metadata. | ctx context.Context, role UserRole |
int64, error |