Invitation
Overview
The Invitation
domain in comby handles the process of inviting users to join an organization or Tenant. It supports the lifecycle of an invitation, from creation and sending to acceptance or declination. The Invitation aggregate is at the core of this domain, providing the structure for managing invitations, tracking their state, and handling related domain events.
An Invitation
can belong to only one Tenant. However, a user can be invited to multiple Tenants. This design enables a user to be associated with multiple Tenants through separate invitations.
Structure
The Invitation
aggregate consists of the following elements:
References:
- GroupUuids: A list of group UUIDs to which the invited account will be added upon accepting the invitation.
- IdentityUuid: The UUID of the identity that created the invitation.
- AccountUuid: The UUID of the account that accepts the invitation.
Value Objects:
- Token: A unique token associated with the invitation, typically used for verification or authentication.
- Email: The email address of the invitee.
- State: Tracks the current state of the invitation, such as created, sent, accepted, or declined.
The domain defines several states to represent the lifecycle of an invitation:
- created: The invitation has been created but not yet sent. sent: The invitation has been sent to the invitee.
- sent: The invitation has been sent to the invitee.
- accepted: The invitee has accepted the invitation, and the associated account has been added to the relevant groups.
- declined: The invitee has declined the invitation. These states enable precise tracking of invitation progress and ensure consistent processing across the system.