Baseleg Docs

People

Status: v1 primary
Packages: packages/domain/people, packages/application/people

Purpose

The People context is the authoritative source of identity for everyone associated with the organisation. All other contexts that reference a person (Scheduling, Training, Billing, Compliance) do so via the identifiers defined here.

Entities

Member (aggregate root)

The central entity. A Member represents a person formally associated with the organisation. Every other role (Student, Instructor, Staff) is a set of attributes overlaid on a Member — not a separate entity type.

Key attributes:

  • id — unique identifier
  • name — full name
  • email — contact email (unique within the organisation)
  • phone — optional contact number
  • roles — set of active roles (student, instructor, staff)
  • statusactive | inactive

Value objects

  • MemberId — typed identifier wrapping a UUID; prevents mixing up IDs across contexts.
  • Email — validated email address; enforces format at construction.
  • MemberRole — enum of student | instructor | staff.

Domain rules

  1. A Member must have at least one contact method (email required).
  2. Email must be unique within the organisation.
  3. Roles are additive — a Member can hold multiple roles simultaneously.
  4. An inactive Member cannot be assigned to new Bookings.
  5. A Member cannot be hard-deleted if they have associated Bookings, Lessons, or Charge Items; deactivation is used instead.

Key use cases

  • registerMember — create a new Member with initial role assignment.
  • updateMember — update profile details.
  • assignRole — add a role to an existing Member.
  • removeRole — remove a role (subject to constraint checks).
  • deactivateMember — mark as inactive; prevents future bookings.

Cross-context relationships

ContextUsage
SchedulingReferences MemberId for booking owner and instructor assignment
TrainingReferences MemberId for student and instructor on a Lesson
BillingReferences MemberId as the invoice recipient
ComplianceReferences MemberId to track currency requirements
NotificationsUses Member contact details (email, phone) for delivery

The People context does not import from any other domain context. It owns identity; other contexts reference it.