noCV
PPOLICY-110 · Migrate and simplify

Retire the campaign subclass ladder after the migration

Practice briefChoreAdvanced

Five subclass layers still exist for a campaign that ended in the synthetic history. Only one leaf is constructible, but changing an error message requires following overridden methods through every layer.

Focused work estimate
3h + prerequisites
Priority in the scenario
Medium
Engineering practice
Legacy refactoring · Dead-code analysis · Compatibility

Estimated field mix

  • Backend60%
  • System design40%

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

  • Factory MethodRemove

    Remove unused overridable creation layers once supported rule revisions have one explicit composition path.

  • Template MethodRemove

    Collapse campaign inheritance hooks that no longer represent a live variation while preserving archived quote replay.

Your next step

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.

Acceptance criteria

  • Map reachable construction paths and separate archived-revision replay requirements from unused extension points.
  • Remove unused Factory Method and Template Method layers while preserving supported quote and error contracts.
  • Show the before/after change surface for adding a new rule, and retain an abstraction only where it supports a stated variation.

Implementation constraints

  • Keep archived calculations callable through explicit revision lookup; deleting old classes must not make existing fixture quotes unreplayable.

Verification to include

  • Run the complete quote matrix and replay fixtures after simplifying the hierarchy.
  • Request an unsupported campaign revision and confirm the same explicit failure, with no fallback to a current rule.

Deliverables

  • Hierarchy simplification, construction-path inventory, and maintenance comparison

Rollout and recovery

Remove dead paths in a separate local change after parity is established; revert the simplification if any supported revision becomes inaccessible.

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.