Story 2.4: Prior-Cycle Defaults Application
Status: ready-for-dev
Story
As a client services staff member,
I want to copy configurable planning defaults from a municipality's prior election-cycle job into a new cycle,
so that I can apply proven configurations without re-entering all details from scratch.
Acceptance Criteria
- Given an election-cycle job exists and the municipality has at least one prior completed cycle When a client services user selects “Apply Prior-Cycle Defaults” Then the prior cycle's service configurations and key date offsets are pre-populated into the new job's fields
- Given prior-cycle defaults are applied When pre-populated fields are displayed Then each inherited field is visibly marked as “Inherited from [cycle name/year]” to distinguish it from manually entered data
- Given a user applies defaults and then manually edits an inherited field When the edit is saved Then the “Inherited” marker is removed from that field and it is treated as a manually entered value going forward
- Given a municipality has multiple prior cycles When applying defaults Then the user can select which prior cycle to use as the source from a list ordered most-recent first
- Given a municipality has no prior cycles When the defaults action is viewed Then the option is disabled with a clear “No prior cycle available” message — no error state is triggered
Tasks / Subtasks
Dev Notes
- This story consumes the read-only prior-cycle defaults data delivered by Story 1.13 — extend that source rather than building a parallel one.
- Key dates are applied as offsets relative to the target cycle's anchor, not as absolute dates. Coordinate the offset model with the key dates work from Story 2.3 (the offset basis must reference fields already persisted there).
- “Inherited” is a per-field marker, not a job-level flag. A single manual edit clears only that field's marker and never the others.
- The empty state (“No prior cycle available”) is informational, not an error. Do not page on it or surface it as a failed validation.
- All persistence remains in extension tables — no writes to legacy Access.
Project Structure Notes
- Backend:
Campaign_Tracker.Server/ — extend the election-cycle feature folder; reuse MunicipalityPriorCycleDefaultsRepository and related contracts from Story 1.13
- Frontend:
campaign-tracker-client/ — extend the cycle job detail view added in Stories 2.2/2.3; reuse the prior-cycle defaults modal patterns established in 1.13
- Story artifacts:
_bmad-output/implementation-artifacts/
References
- Story source:
_bmad-output/planning-artifacts/epics.md (Epic 2 / Story 2.4)
- Architecture constraints:
_bmad-output/planning-artifacts/architecture.md
- UX patterns:
_bmad-output/planning-artifacts/ux-design-specification.md
- Prior stories: Story 1.13 — prior-cycle defaults read model; Story 2.2 — cycle job entity; Story 2.3 — key dates fields and persistence
Dev Agent Record
Agent Model Used
{{agent_model_name_version}}
Debug Log References
- Story generated from epic source and architecture/UX planning artifacts.
Completion Notes List
- Story context created and marked ready-for-dev.
File List
Change Log