diff --git a/apps/judicial-system/backend/src/app/modules/case/case.service.ts b/apps/judicial-system/backend/src/app/modules/case/case.service.ts index 6454603536c8..d20ffd16d104 100644 --- a/apps/judicial-system/backend/src/app/modules/case/case.service.ts +++ b/apps/judicial-system/backend/src/app/modules/case/case.service.ts @@ -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 = diff --git a/apps/judicial-system/backend/src/app/modules/file/file.service.ts b/apps/judicial-system/backend/src/app/modules/file/file.service.ts index 397f488a5c0c..fbf3b50a9d5e 100644 --- a/apps/judicial-system/backend/src/app/modules/file/file.service.ts +++ b/apps/judicial-system/backend/src/app/modules/file/file.service.ts @@ -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 @@ -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 }