Overview
:::info Source
Sourced from services/enrollment-service/SERVICE_OVERVIEW.md in the documentation repo.
:::
1. Purpose
Owns Enrollment aggregate — per-learner per-course-version record. Created by purchase saga, assignment, manual admin, or self-signup. Tracks state and lifecycle.
2. Bounded Context
Enrollment (Supporting). UL: Enrollment, Seat, EnrollmentState, CourseVersionRef.
3. Responsibilities
- Create enrollments from upstream events (purchase, assignment, manual, self).
- Track state (active → completed | expired | revoked).
- Emit state-change events for downstream (delivery, progress, notification, analytics).
- Validate (courseVersion exists, seat available, tenant has license).
- Handle revocation (refund, admin, license expiry).
4. Non-Responsibilities
- Does not grade (assessment); does not record progress (progress-service).
- Does not issue certificates.
- Does not own licenses (marketplace).
5. Dependencies
- Upstream: marketplace (license.granted), assignment (window.opened), tenant (manual enrollment).
- Downstream: delivery (bundle creation trigger), progress (attempt creation), notification, certification.
6. Slices
- S1 (M1): Basic enrollment + self-signup.
- S3 (M2): Purchase-driven enrollment via saga.
- S4 (M3): Assignment-driven enrollment.
7. Architectural Freeze Points
- F30 — Enrollment lifecycle: M1 start; state enum additive.
8. Key Invariants
- One active Enrollment per (tenantId, userId, courseId, source.ref).
- Enrollment state: active → completed | expired | revoked (terminal).
- Tenant isolation; cannot enroll cross-tenant except via explicit cross-tenant license.