diff --git a/src/pages/courts/CourtReportCreate.tsx b/src/pages/courts/CourtReportCreate.tsx index 840000a..493ceb3 100644 --- a/src/pages/courts/CourtReportCreate.tsx +++ b/src/pages/courts/CourtReportCreate.tsx @@ -26,6 +26,7 @@ import { courtLabel, CourtStandingReference, CourtTargetPreview, + CourtTriggerCounter, formatCourtInstant, } from "./components/CourtPrimitives"; import { @@ -47,7 +48,8 @@ import { import { courtLaneDisplay, courtOffenseDisplay, - courtStandingDisplay, + courtReportLaneChoiceLabel, + courtReportRouteDescription, } from "./model/courtPresentation"; import { courtErrorIssue, @@ -316,6 +318,11 @@ const CourtReportCreate: React.FC = () => { setSubmissionError("Choose a report reason."); return; } + if (!respondentId.trim()) { + setSubmissionError("A respondent address is required."); + focusCourtField("court-report-respondent"); + return; + } const startsAt = Date.parse(incidentStartsAt); const endsAt = incidentEndsAt ? Date.parse(incidentEndsAt) : null; if (endsAt !== null && endsAt < startsAt) { @@ -499,7 +506,7 @@ const CourtReportCreate: React.FC = () => { value={`${reason.offenseCode}:${reason.lane}`} > {courtOffenseDisplay(reason.offenseCode).label} ·{" "} - {courtLaneDisplay(reason.lane).label} + {courtReportLaneChoiceLabel(reason.lane)} ))} @@ -527,7 +534,10 @@ const CourtReportCreate: React.FC = () => { direct={selectedReason.standing.directStanding} source={selectedReason.standing.source} /> - {`. ${courtStandingDisplay(selectedReason.standing).description}`} + {`. ${courtReportRouteDescription( + selectedReason.reason.lane, + selectedReason.standing, + )}`} > ) : capabilityLoading ? ( "The server is verifying the target, incident time, standing, and available lanes." @@ -535,12 +545,40 @@ const CourtReportCreate: React.FC = () => { "Reasons are limited to those verified for this exact target and incident time." )}
- {selectedReason && capability?.population ? ( -- Population basis: {courtLabel(capability.population.basis)} ·{" "} - effective{" "} - {formatCourtInstant(capability.population.effectiveAt)}. -
+ {selectedReason ? ( ++ A community Court trigger is unavailable because fewer + than three eligible Governors remain after excluding the + respondent. +
+ ) + ) : ( ++ Governor population:{" "} + {capability.population.eligibleGovernorCount} ·{" "} + {courtLabel(capability.population.basis)} · effective{" "} + {formatCourtInstant(capability.population.effectiveAt)}. +
+ ) : null} +Next: {process.nextStep} @@ -492,7 +511,15 @@ const CourtReportDetail: React.FC = () => { onChange={(event) => setRespondentId(event.target.value) } + readOnly={Boolean(report.respondentId)} + required /> + {report.respondentId ? ( + + The respondent is fixed to the reported record and + cannot be changed by amendment. + + ) : null}