Skip to content

Commit

Permalink
Delivers confirmed indictment ruling to court
Browse files Browse the repository at this point in the history
  • Loading branch information
gudjong committed Dec 2, 2024
1 parent 4137b1f commit 0f00701
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 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,27 @@ 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].includes(caseFile.category),
)
.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 0f00701

Please sign in to comment.