Why this exists
ppp-savings-service.ts remains a large mixed-responsibility service at roughly 1,100 lines. It combines external data access, local runtime lookup, pricing math, discount logic, and email HTML generation.
Intended outcome
Separate stable boundaries without changing calculated outputs or generated email content.
Scope
- Extract external data access into a dedicated adapter boundary.
- Extract email HTML generation into a focused template module.
- Keep pricing/discount calculations covered by deterministic tests before moving them.
- Preserve existing API response shape and UI behavior.
Non-goals
- No Nabis writes or live provider mutations.
- No pricing rule changes.
- No schema, auth/RLS, credential, or secret changes.
Acceptance criteria
- Deterministic tests prove existing pricing and email output behavior is preserved.
- Existing verification passes.
- Boundaries make it possible to test pricing math without external provider calls.
- Any live-provider validation remains read-only and explicitly documented.
Source
Created from #32 refactor triage of closed PR #1.
Why this exists
ppp-savings-service.tsremains a large mixed-responsibility service at roughly 1,100 lines. It combines external data access, local runtime lookup, pricing math, discount logic, and email HTML generation.Intended outcome
Separate stable boundaries without changing calculated outputs or generated email content.
Scope
Non-goals
Acceptance criteria
Source
Created from #32 refactor triage of closed PR #1.