Skip to content

PM-5138: Preserve schedule end date updates#112

Merged
jmgasper merged 1 commit into
developfrom
PM-5138-1
May 27, 2026
Merged

PM-5138: Preserve schedule end date updates#112
jmgasper merged 1 commit into
developfrom
PM-5138-1

Conversation

@jmgasper
Copy link
Copy Markdown
Contributor

What was broken
Challenge update requests could include edited phase scheduledEndDate values, but the API dropped those fields during sanitization and recalculated phase ends from the previous duration.

Root cause (if identifiable)
The earlier PM-5138 fix updated derived submission date mapping, but the challenge update path still only allowed scheduledStartDate and duration through for phases. When Work sent an edited registration or submission end date, populatePhasesForChallengeUpdate never saw it.

What was changed
Allowed scheduledEndDate in the challenge update phase schema and sanitizer. Phase schedule recalculation now applies an explicit scheduledEndDate when provided, derives duration from the resulting start/end range, and cascades successor starts from the preserved predecessor end.

Any added/updated tests
Added phase-helper unit coverage for Development-style Registration/Submission phases and MM Registration/MM Submission phases with edited scheduled end dates.

Validation

  • pnpm lint passed.
  • Focused PM-5138 tests passed: pnpm test -- --grep "phase helper|prisma helper|challenge response helper".
  • pnpm exec standard test/unit/phase-helper.test.js test/unit/prisma-helper.test.js test/unit/challenge-helper.test.js passed.
  • pnpm build could not run because this package has no build script or build executable.
  • Full pnpm test was attempted first without DATABASE_URL and failed at DB-backed setup. After starting the local PostgreSQL container and running prisma db push on a disposable local schema, the suite progressed but still failed in existing unrelated validation/mock expectation tests.

What was broken
Challenge update requests could include edited phase scheduledEndDate values, but the API dropped those fields during sanitization and recalculated phase ends from the previous duration.

Root cause (if identifiable)
The earlier PM-5138 fix updated derived submission date mapping, but the challenge update path still only allowed scheduledStartDate and duration through for phases. When Work sent an edited registration or submission end date, populatePhasesForChallengeUpdate never saw it.

What was changed
Allowed scheduledEndDate in the challenge update phase schema and sanitizer. Phase schedule recalculation now applies an explicit scheduledEndDate when provided, derives duration from the resulting start/end range, and cascades successor starts from the preserved predecessor end.

Any added/updated tests
Added phase-helper unit coverage for Development-style Registration/Submission phases and MM Registration/MM Submission phases with edited scheduled end dates.
@jmgasper jmgasper merged commit 9e93404 into develop May 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant