Skip to content

Move hearing to past date: room, hearingStartTime and multi-day#33

Merged
ozturkmenb merged 4 commits into
team/pasthearingsfrom
dev/move-to-past-date-room-time-multiday
Jul 10, 2026
Merged

Move hearing to past date: room, hearingStartTime and multi-day#33
ozturkmenb merged 4 commits into
team/pasthearingsfrom
dev/move-to-past-date-room-time-multiday

Conversation

@ozturkmenb

Copy link
Copy Markdown

What

Extend listing.command.move-hearing-to-past-date with an optional court room, a mandatory local hearingStartTime (converted to UTC in the backend), and an optional endDate for multi-day moves; MAGISTRATES sessions are selected by time-of-day.

Changes

  • Request schema: add courtRoomId (opt), endDate (opt), mandatory hearingStartTime (HH:mm).
  • -enriched command: single session fields → hearingDays[] array; async handler re-issues N HearingDays (changeStartDate + assignHearingDaysV2).
  • Validation (all jurisdictions, sync 422): future date → FUTURE_DATE_NOT_ALLOWED, endDate<startDate → INVALID_DATE_RANGE, startDate older than 6 months → START_DATE_TOO_OLD, weekend-only range rejected.
  • MAGS: adapter sends room/time/endDate and maps the bookedSlots[] response; no-session stays sync 422 NO_SESSION_FOUND.
  • CROWN: listing-side enrichment driven by hearingStartTime (courtscheduler still not called — Phase 2).

Testing

  • Unit: adapter 7/7, command-api 41/41, handler 84/84.
  • Integration (runIntegrationTests.sh): full suite 233 run / 0 fail / 3 skipped; MoveHearingToPastDateIT 11/11 (MAGS + CROWN, single & multi-day, room-scoped, 422 paths).

Pairs with hmcts/cpp-context-listing-courtscheduler dev/move-to-past-date-room-time-multiday.

…-day range

- request schema: add optional courtRoomId + endDate and mandatory hearingStartTime (local Europe/London -> UTC in backend)
- -enriched command migrated to a hearingDays[] array; async handler re-issues N hearing days (changeStartDate + assignHearingDaysV2)
- validate future date, endDate>=startDate and startDate>=today-6months for all jurisdictions (sync 422); weekend-only range rejected
- MAGS: adapter sends room/time/endDate to courtscheduler and maps the bookedSlots[] response; no-session stays sync 422
- CROWN: listing-side enrichment using hearingStartTime (courtscheduler still not called - Phase 2)
- unit + integration tests updated/added
@ozturkmenb ozturkmenb requested a review from a team as a code owner July 9, 2026 23:04
@cpp-github-management

Copy link
Copy Markdown

Failed

1 similar comment
@cpp-github-management

Copy link
Copy Markdown

Failed

@ozturkmenb ozturkmenb force-pushed the dev/move-to-past-date-room-time-multiday branch from ed75f3e to b8281f8 Compare July 10, 2026 02:03
@cpp-github-management

Copy link
Copy Markdown

Passed

…uest

- request schema: courtRoomId added to required
- IT test-data templates (MAGS + CROWN) now carry courtRoomId
- Steps injects the hearing's room into the template, keeps the missing-centre
  payload precise (only centre absent), adds courtRoomId to the unknown-hearing
  payload, and adds a missing-courtRoomId helper
- IT: multi-day range test supplies the room; new shouldRejectMoveWith400WhenCourtRoomIdMissing
@cpp-github-management

Copy link
Copy Markdown

Passed

…tartTime/endTime

Request contract is now { courtCentreId, courtRoomId (both mandatory UUIDs),
startTime (mandatory, absolute UTC e.g. 2026-07-02T17:00:00.000Z), endTime
(optional UTC) }. startDate+hearingStartTime (local HH:mm) collapse into startTime
and endDate becomes endTime; the backend derives the day and time-of-day directly
from the UTC instants, removing all local->UTC conversion. Enriched command,
handler and courtscheduler service are unchanged (API derives the values they take).
@cpp-github-management

Copy link
Copy Markdown

Passed

@ozturkmenb ozturkmenb merged commit 83bb406 into team/pasthearings Jul 10, 2026
3 checks passed
@ozturkmenb ozturkmenb deleted the dev/move-to-past-date-room-time-multiday branch July 10, 2026 13:23
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