Skip to content

11.1 Scaffold and Schema

Sprint: Sprint 11 - Billing
Feature ID: 11.1
Subtasks: 11.1.1, 11.1.2

Objective

Deliver "Scaffold and Schema" within Sprint 11 - Billing.

Dependencies

Aggregated from the subtasks below (prerequisite task IDs and enablers):

  • 3.4.1
  • Sprint 04
  • 11.1.1

Subtasks

11.1.1 Scaffold billing-service from template

  • ID: 11.1.1
  • Title: Create billing-service from the service template
  • Description: Instantiate microservices/billing-service (port 9007, base package com.telco.billing) from the template; depend on starter-api, starter-security, starter-mediator, starter-observability, starter-outbox, starter-inbox; own the billing database. Architecture mode: Domain Orchestration (ADR-004) - bill-run orchestrates usage/subscription/pricing read models across Invoice/InvoiceLine/BillCycle aggregates; declare it in CLAUDE.md/README.
  • Business Purpose: Standardized billing-domain service skeleton.
  • Inputs: ADR-017.
  • Outputs: billing-service skeleton building and registering.
  • Acceptance Criteria:
  • Service starts, registers, exposes Swagger UI.
  • Dependencies: 3.4.1, Sprint 04
  • Complexity: S

11.1.2 Billing schema migration

  • ID: 11.1.2
  • Title: Create Flyway migration for invoices, lines, bill cycles
  • Description: V1__billing.sql creating invoices (id, customer_id, subscription_id, period_start, period_end, sub_total, tax, grand_total, currency, status, due_date, issued_at, pdf_ref), invoice_lines (id, invoice_id, description, quantity, unit_price, line_total), and bill_cycles (id, customer_id, day_of_month, next_run_date), plus outbox/inbox tables.
  • Business Purpose: Persist invoices, lines, and billing schedules (FR-21, FR-22).
  • Inputs: analysis Section 10.6, FR-21, FR-22.
  • Outputs: Flyway migration.
  • Acceptance Criteria:
  • Migration applies; invoice status supports DRAFT/ISSUED/PAID/OVERDUE; money columns are numeric with currency.
  • Dependencies: 11.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

  • billing-service skeleton building and registering.
  • Flyway migration.

Definition of Done

  • All subtasks (11.1.1, 11.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).