Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(j-s): Indictment Cleanup #16286

Merged
merged 4 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const Conclusion: FC = () => {
courtDate: null,
postponedIndefinitelyExplanation: null,
indictmentRulingDecision: null,
mergeCaseId: null,
force: true,
}

Expand All @@ -137,11 +138,9 @@ const Conclusion: FC = () => {
break
case IndictmentDecision.COMPLETING:
update.indictmentRulingDecision = selectedDecision
update.mergeCaseId =
selectedDecision === CaseIndictmentRulingDecision.MERGE
? workingCase.mergeCase?.id
: null

if (selectedDecision === CaseIndictmentRulingDecision.MERGE) {
update.mergeCaseId = workingCase.mergeCase?.id
}
break
case IndictmentDecision.REDISTRIBUTING:
update.judgeId = null
Expand Down Expand Up @@ -400,101 +399,108 @@ const Conclusion: FC = () => {
</Box>
)}
{selectedAction === IndictmentDecision.COMPLETING && (
<Box marginBottom={5}>
<SectionHeading
title={formatMessage(strings.completingTitle)}
required
/>
<BlueBox>
<Box marginBottom={2}>
<RadioButton
id="decision-ruling"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.RULING
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.RULING)
}}
large
backgroundColor="white"
label={formatMessage(strings.ruling)}
/>
</Box>
<Box marginBottom={2}>
<>
<Box marginBottom={5}>
<SectionHeading
title={formatMessage(strings.completingTitle)}
required
/>
<BlueBox>
<Box marginBottom={2}>
<RadioButton
id="decision-ruling"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.RULING
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.RULING)
}}
large
backgroundColor="white"
label={formatMessage(strings.ruling)}
/>
</Box>
<Box marginBottom={2}>
<RadioButton
id="decision-fine"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.FINE
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.FINE)
}}
large
backgroundColor="white"
label={formatMessage(strings.fine)}
/>
</Box>
<Box marginBottom={2}>
<RadioButton
id="decision-dismissal"
name="decision"
checked={
selectedDecision ===
CaseIndictmentRulingDecision.DISMISSAL
}
onChange={() => {
setSelectedDecision(
CaseIndictmentRulingDecision.DISMISSAL,
)
}}
large
backgroundColor="white"
label={formatMessage(strings.dismissal)}
/>
</Box>
<Box marginBottom={2}>
<RadioButton
id="decision-merge"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.MERGE
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.MERGE)
}}
large
backgroundColor="white"
label={formatMessage(strings.merge)}
/>
</Box>
<RadioButton
id="decision-fine"
id="decision-cancellation"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.FINE
selectedDecision ===
CaseIndictmentRulingDecision.CANCELLATION
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.FINE)
setSelectedDecision(
CaseIndictmentRulingDecision.CANCELLATION,
)
}}
large
backgroundColor="white"
label={formatMessage(strings.fine)}
label={formatMessage(strings.cancellation)}
/>
</Box>
<Box marginBottom={2}>
<RadioButton
id="decision-dismissal"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.DISMISSAL
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.DISMISSAL)
}}
large
backgroundColor="white"
label={formatMessage(strings.dismissal)}
</BlueBox>
</Box>
{selectedDecision === CaseIndictmentRulingDecision.MERGE && (
<Box marginBottom={5}>
<SectionHeading
title={formatMessage(strings.connectedCaseNumbersTitle)}
required
/>
</Box>
<Box marginBottom={2}>
<RadioButton
id="decision-merge"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.MERGE
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.MERGE)
}}
large
backgroundColor="white"
label={formatMessage(strings.merge)}
<SelectConnectedCase
workingCase={workingCase}
setWorkingCase={setWorkingCase}
/>
</Box>
<RadioButton
id="decision-cancellation"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.CANCELLATION
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.CANCELLATION)
}}
large
backgroundColor="white"
label={formatMessage(strings.cancellation)}
/>
</BlueBox>
</Box>
)}
</>
)}
{selectedDecision &&
selectedDecision === CaseIndictmentRulingDecision.MERGE && (
<Box marginBottom={5}>
<SectionHeading
title={formatMessage(strings.connectedCaseNumbersTitle)}
required
/>
<SelectConnectedCase
workingCase={workingCase}
setWorkingCase={setWorkingCase}
/>
</Box>
)}
{selectedAction && (
<Box
component="section"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,23 @@ const Subpoena: FC = () => {
return
}

const courtDateUpdated = await sendCourtDateToServer()
// If rescheduling after the court has met, then clear the current conclusion
const clearedConclusion =
isArraignmentScheduled && workingCase.indictmentDecision
? [
{
indictmentDecision: null,
courtSessionType: null,
courtDate: null,
postponedIndefinitelyExplanation: null,
indictmentRulingDecision: null,
mergeCaseId: null,
force: true,
},
]
: undefined

const courtDateUpdated = await sendCourtDateToServer(clearedConclusion)
gudjong marked this conversation as resolved.
Show resolved Hide resolved

if (!courtDateUpdated) {
return
Expand Down