Skip to content

7.2 Domain and Persistence

Sprint: Sprint 07 - Product Catalog Domain
Feature ID: 7.2
Subtasks: 7.2.1, 7.2.2, 7.2.3

Objective

Deliver "Domain and Persistence" within Sprint 07 - Product Catalog Domain.

Dependencies

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

  • 7.1.2
  • 7.2.1
  • 7.2.2

Subtasks

7.2.1 Tariff and Addon domain model

  • ID: 7.2.1
  • Title: Implement Tariff/Addon aggregates with classification and validity
  • Description: Tariff aggregate (type POSTPAID/PREPAID/HYBRID, status DRAFT/ACTIVE/RETIRED, effectiveFrom/effectiveTo, targetSegment) and Addon (type DATA/SMS/MINUTES/VAS, validityDays). Enforce that effectiveTo is after effectiveFrom and validity windows are coherent (FR-06, FR-07).
  • Business Purpose: Model the product catalog with telecom classification (FR-06, FR-07).
  • Inputs: FR-06, FR-07, analysis Section 10.2.
  • Outputs: Domain aggregates + entities.
  • Acceptance Criteria:
  • Creating a tariff with effectiveTo <= effectiveFrom throws BusinessRuleException; type and segment are persisted.
  • Dependencies: 7.1.2
  • Complexity: M

7.2.2 Tariff versioning logic

  • ID: 7.2.2
  • Title: Implement tariff version-on-change preserving existing subscribers
  • Description: On a price/attribute change, create a new tariff version (incremented version) and retain prior versions immutably so existing subscribers keep their assigned version (FR-08). Provide resolution of "current active version" by effectiveFrom/effectiveTo.
  • Business Purpose: Tariff changes must not alter existing subscribers' terms (FR-08).
  • Inputs: FR-08.
  • Outputs: Versioning service + tests.
  • Acceptance Criteria:
  • Changing a tariff produces a new version; the prior version remains queryable; resolving by an earlier date returns the earlier version.
  • Dependencies: 7.2.1
  • Complexity: M

7.2.3 Repositories

  • ID: 7.2.3
  • Title: Implement tariff/addon/version repositories
  • Description: Spring Data repositories for tariffs (by code, by active window), addons (by code and by tariff), and tariff versions.
  • Business Purpose: Catalog data access.
  • Inputs: 7.2.1, 7.2.2.
  • Outputs: Repositories.
  • Acceptance Criteria:
  • Lookups by code and active-window queries return expected rows in a slice/integration test.
  • Dependencies: 7.2.2
  • Complexity: S

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 aggregates + entities.
  • Versioning service + tests.
  • Repositories.

Definition of Done

  • All subtasks (7.2.1, 7.2.2, 7.2.3) completed and their acceptance criteria verified.
  • All listed dependencies satisfied.
  • Build and tests green per the global conventions in ../README.md (Section 3).