Account
Overview
The Account
domain is a default domain in comby, representing user accounts and managing their lifecycle, credentials, sessions, and related data. It encapsulates core functionalities for account management in a centralized, event-sourced architecture. The domain is implemented through the Account aggregate, which provides a robust structure for modeling user accounts, handling domain events, and enforcing business rules.
An Account
can be associated with multiple Identities
, each of which is linked to a specific Tenant
. This allows a user with a single account to log in to multiple tenants.
Structure
The Account
struct serves as the root aggregate, holding entities Credentials, OneTimeToken, and a collection of Session objects. Credentials contains attributes for email, password, and the next allowed login time. OneTimeToken represents single-use tokens with attributes for the key, type, and expiration time. Session stores details about active user sessions, including a unique session UUID, session key, and expiration time. The relationships illustrate how an account aggregates these entities to manage authentication and session handling.