Pin a quote to one rule family during a revision switch
A local replay switches a partner from revision 2 to 3 while quotes are in progress. Resolving the calculator at request start and the explainer at response time can produce a mixed-revision quote even after family validation.
- Focused work estimate
- 4h + prerequisites
- Priority in the scenario
- High
- Engineering practice
- Versioned configuration · Concurrency · Deterministic replay
Estimated field mix
- Backend50%
- System design30%
- Quality engineering20%
Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.
Pattern topics
- Abstract FactoryRefactor
Make family resolution yield a stable snapshot so a revision switch cannot mix products created at different moments in the same operation.
Review it, then add it to your workspace.
The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.
Project context
A fictional equipment-rental service supports direct customers and two reseller contracts. Pricing now lives in a long conditional with subclasses left over from a discontinued campaign. Build a local TypeScript quoting module and synthetic fixtures; no starter repository, real charges, tax advice, or payment connection is supplied. Amounts use integer cents and the exercise supports USD only.
Setup prerequisites
- Pure functions
- Object composition
- Integer arithmetic
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
- PPOLICY-101 · Capture the reseller examples before splitting the pricing branch
- PPOLICY-102 · Stop incomplete quote requests reaching the calculator
- PPOLICY-103 · Add a capped volume contract without editing the existing rules
- PPOLICY-104 · Share quote assembly between the portal and nightly import
- PPOLICY-105 · Keep calculation and explanation revisions in the same contract family
- PPOLICY-106 · Remove the rounding hook that bypasses the quote cap
- PPOLICY-107 · Keep a cloned contract draft from changing the live tier table
- PPOLICY-108 · Remove the process-wide current-partner setting
Acceptance criteria
- Resolve and retain one immutable family snapshot for the complete quote operation.
- Switches affect only newly started operations; stored quotes retain inputs, family revision, and sufficient breakdown for deterministic replay.
- A malformed replacement family is rejected without displacing the last valid selection, and rollback selects a previous complete family.
Implementation constraints
- Use an in-process deterministic scheduler for the exercise; a distributed configuration service is outside scope.
Verification to include
- Pause a quote between calculation and explanation, switch revisions, and verify each concurrent quote is internally consistent.
- Reject an incompatible family, perform a rollback, and replay an earlier quote against its pinned revision.
Deliverables
- Atomic family selection, interleaving tests, and revision-switch runbook
Rollout and recovery
Exercise old/new/rollback sequences against synthetic requests; report differences by explicit revision without modifying prior quote records.
Value of the work
For the engineer: Practice choosing, testing, and removing object-design abstractions around versioned business rules and tenant isolation.
For the team: Review changes that let a team introduce a contract without silently changing existing quotes, together with the maintenance costs of the chosen design.
Evidence boundaries
Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.
Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.