Skip to content

Commit

Permalink
feat(j-s): Deliver Confirmed Indictment Ruling to Court (#17104)
Browse files Browse the repository at this point in the history
* Delivers confirmed indictment ruling to court

* Only uploads ruling to court if ruling decision is ruling or dismillal

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
gudjong and kodiakhq[bot] authored Dec 3, 2024
1 parent 0d59ea6 commit a621cbe
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions apps/judicial-system/backend/src/app/modules/case/case.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -921,14 +921,31 @@ export class CaseService {
theCase: Case,
user: TUser,
): Promise<void> {
const messages: Message[] = [
{
type: MessageType.NOTIFICATION,
user,
caseId: theCase.id,
body: { type: CaseNotificationType.RULING },
},
]
const messages: Message[] =
theCase.caseFiles
?.filter(
(caseFile) =>
caseFile.state === CaseFileState.STORED_IN_RVG &&
caseFile.key &&
caseFile.category === CaseFileCategory.RULING &&
theCase.indictmentRulingDecision &&
[
CaseIndictmentRulingDecision.RULING,
CaseIndictmentRulingDecision.DISMISSAL,
].includes(theCase.indictmentRulingDecision),
)
.map((caseFile) => ({
type: MessageType.DELIVERY_TO_COURT_CASE_FILE,
user,
caseId: theCase.id,
elementId: caseFile.id,
})) ?? []
messages.push({
type: MessageType.NOTIFICATION,
user,
caseId: theCase.id,
body: { type: CaseNotificationType.RULING },
})

if (theCase.origin === CaseOrigin.LOKE) {
messages.push({
Expand Down

0 comments on commit a621cbe

Please sign in to comment.