[SAM] Add Members::AcceptInviteService and publish event on accepting
GitLab currently has several services for managing member access:
-
InviteService: Handles sending invitations to users -
RequestAccessService: Allows users to request access to groups/projects -
ApproveAccessRequestService: Processes approval of access requests
However, we lack a dedicated service for accepting invitations in the subscription context.
Proposal
Implement Members::AcceptInviteService to handle the acceptance flow for invitations within the subscription management system. This service will reuse existing logic from the Member model and do the following
- Process invitation acceptances for subscription members
- Validate user permissions and subscription status.
- Update membership records appropriately.
- New: Publish an
AcceptInviteEventthat can be consumed by the seat assignment sync service - Handle edge cases (expired invitations, already accepted invitations, etc.)
Implementation Details
- The service should follow GitLab's service object pattern
- It should integrate with existing member management systems
- Implement event publishing mechanism for
AcceptInviteEvent - Proper error handling for various scenarios (invalid invites, permission issues)
- Include comprehensive test coverage
Benefits
- Enables seat assignment synchronization when invites are accepted
- Improves code organization by moving invitation acceptance logic to a dedicated service
- Enables better maintainability and future extensions to the invitation flow
Acceptance Criteria
- Service successfully processes invitation acceptances
- Service publishes
AcceptInviteEventthat can be subscribed to by the seat assignment sync service - All edge cases are handled appropriately
- Test coverage meets GitLab standards
- Documentation is updated to reflect the new service
Edited by Lukas Wanko - OOO back on 2025-12-16