Skip to content

Commit

Permalink
Uploads additional files from prosecutors and defenedants in indictme…
Browse files Browse the repository at this point in the history
…nt cases to court
  • Loading branch information
gudjong committed Dec 5, 2024
1 parent 4281d75 commit 6fdd5b3
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 6fdd5b3

Please sign in to comment.