10.1 Scaffold and Schema¶
Sprint: Sprint 10 - Usage Metering
Feature ID: 10.1
Subtasks: 10.1.1, 10.1.2
Objective¶
Deliver "Scaffold and Schema" within Sprint 10 - Usage Metering.
Dependencies¶
Aggregated from the subtasks below (prerequisite task IDs and enablers):
- 3.4.1
- Sprint 04
- 10.1.1
Subtasks¶
10.1.1 Scaffold usage-service from template¶
- ID: 10.1.1
- Title: Create usage-service from the service template
- Description: Instantiate
microservices/usage-service(port 9006, base packagecom.telco.usage) from the template; depend on starter-api, starter-security, starter-mediator, starter-observability, starter-outbox, starter-inbox; own theusagedatabase; CQRS+Mediator. This is a write-heavy service; tune the consumer for throughput. - Business Purpose: Standardized usage-domain service skeleton.
- Inputs: ADR-017, analysis Section 8.5.
- Outputs: usage-service skeleton building and registering.
- Acceptance Criteria:
- Service starts, registers, exposes Swagger UI.
- Dependencies: 3.4.1, Sprint 04
- Complexity: S
10.1.2 Usage schema migration¶
- ID: 10.1.2
- Title: Create Flyway migration for quota and usage records
- Description:
V1__usage.sqlcreatingquotas(id, subscription_id, period_start, period_end, minutes_remaining, sms_remaining, mb_remaining, minutes_total, sms_total, mb_total) andusage_records(id, subscription_id, type, quantity, recorded_at, cdr_ref, overage boolean), plus outbox/inbox tables. Index for fast quota lookup by subscription. - Business Purpose: Persist quotas and usage history (FR-17, FR-18).
- Inputs: analysis Section 10.5, FR-17, FR-18.
- Outputs: Flyway migration.
- Acceptance Criteria:
- Migration applies; quota and usage_records exist with an index supporting near-real-time reads.
- Dependencies: 10.1.1
- 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¶
- usage-service skeleton building and registering.
- Flyway migration.
Definition of Done¶
- All subtasks (10.1.1, 10.1.2) completed and their acceptance criteria verified.
- All listed dependencies satisfied.
- Build and tests green per the global conventions in ../README.md (Section 3).