Skip to content

Commit

Permalink
feat(j-s): Upload Additional Files to Court (#17152)
Browse files Browse the repository at this point in the history
  • Loading branch information
gudjong authored and thorhildurt committed Dec 11, 2024
1 parent f5d1565 commit f25c74c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -775,12 +775,16 @@ export class CaseService {
CaseFileCategory.CRIMINAL_RECORD,
CaseFileCategory.COST_BREAKDOWN,
CaseFileCategory.CASE_FILE,
CaseFileCategory.PROSECUTOR_CASE_FILE,
CaseFileCategory.DEFENDANT_CASE_FILE,
]
: [
CaseFileCategory.INDICTMENT,
CaseFileCategory.CRIMINAL_RECORD,
CaseFileCategory.COST_BREAKDOWN,
CaseFileCategory.CASE_FILE,
CaseFileCategory.PROSECUTOR_CASE_FILE,
CaseFileCategory.DEFENDANT_CASE_FILE,
]

const deliverCaseFileToCourtMessages =
Expand Down
23 changes: 21 additions & 2 deletions apps/judicial-system/backend/src/app/modules/file/file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ export class FileService {
courtDocumentFolder = CourtDocumentFolder.INDICTMENT_DOCUMENTS
break
case CaseFileCategory.COURT_RECORD:
courtDocumentFolder = CourtDocumentFolder.COURT_DOCUMENTS
break
case CaseFileCategory.RULING:
courtDocumentFolder = CourtDocumentFolder.COURT_DOCUMENTS
break
case CaseFileCategory.CASE_FILE:
case CaseFileCategory.PROSECUTOR_CASE_FILE:
case CaseFileCategory.DEFENDANT_CASE_FILE:
case undefined:
case null:
courtDocumentFolder = CourtDocumentFolder.CASE_DOCUMENTS
Expand Down Expand Up @@ -388,6 +388,25 @@ export class FileService {
},
])
}

if (
isIndictmentCase(theCase.type) &&
file.category &&
[
CaseFileCategory.PROSECUTOR_CASE_FILE,
CaseFileCategory.DEFENDANT_CASE_FILE,
].includes(file.category)
) {
await this.messageService.sendMessagesToQueue([
{
type: MessageType.DELIVERY_TO_COURT_CASE_FILE,
user,
caseId: theCase.id,
elementId: file.id,
},
])
}

return file
}

Expand Down

0 comments on commit f25c74c

Please sign in to comment.