9.2 Subscription Service - Domain¶
Sprint: Sprint 09 - Subscription and Onboarding Saga
Feature ID: 9.2
Subtasks: 9.2.1, 9.2.2
Objective¶
Deliver "Subscription Service - Domain" within Sprint 09 - Subscription and Onboarding Saga.
Dependencies¶
Aggregated from the subtasks below (prerequisite task IDs and enablers):
- 9.1.2
- 9.2.1
- 9.1.3
Subtasks¶
9.2.1 Subscription state machine¶
- ID: 9.2.1
- Title: Implement Subscription aggregate lifecycle
- Description:
Subscriptionaggregate enforcing ACTIVE -> SUSPENDED -> ACTIVE (reactivate) -> TERMINATED transitions (FR-14); a customer may hold multiple subscriptions (FR-15). Illegal transitions throwBusinessRuleException. - Business Purpose: Encode subscription lifecycle invariants (FR-14, FR-15).
- Inputs: FR-14, FR-15, analysis Section 8.4.
- Outputs: Domain aggregate.
- Acceptance Criteria:
- Suspend/reactivate/terminate transitions behave per spec; terminating an already-terminated subscription throws; one customer can have multiple active subscriptions.
- Dependencies: 9.1.2
- Complexity: M
9.2.2 MSISDN allocation and release¶
- ID: 9.2.2
- Title: Implement atomic MSISDN allocation/release with events
- Description: Allocate a FREE MSISDN atomically (reserve -> allocate) on activation, release it to
FREE on termination, emitting
msisdn.allocated.v1/msisdn.released.v1. Use row-level locking to prevent double allocation. - Business Purpose: Conflict-free number assignment (FR-13).
- Inputs: FR-13, event-catalog MSISDN events.
- Outputs: Allocation service + events.
- Acceptance Criteria:
- Concurrent allocations never assign the same MSISDN (test with parallel allocation); termination
returns the number to FREE and emits
msisdn.released.v1. - Dependencies: 9.2.1, 9.1.3
- Complexity: M
Acceptance Criteria¶
Each subtask above carries its own objective, testable acceptance criteria. This feature is complete when every subtask's acceptance criteria are met.
Deliverables¶
- Domain aggregate.
- Allocation service + events.
Definition of Done¶
- All subtasks (9.2.1, 9.2.2) completed and their acceptance criteria verified.
- All listed dependencies satisfied.
- Build and tests green per the global conventions in ../README.md (Section 3).