Skip to content

Commit ccb0852

Browse files
committed
fix(api): fixed a bug when candidacy status was not updated when sending or signaling a dossier de validation
1 parent c9bfe0f commit ccb0852

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/reva-api/modules/dossier-de-validation/features/sendDossierDeValidation.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { CandidacyStatusStep, FeasibilityStatus } from "@prisma/client";
22
import { v4 as uuidV4 } from "uuid";
33

44
import { getAccountById } from "@/modules/account/features/getAccount";
5+
import { updateCandidacyStatus } from "@/modules/candidacy/features/updateCandidacyStatus";
56
import { logCandidacyAuditEvent } from "@/modules/candidacy-log/features/logCandidacyAuditEvent";
67
import { UploadedFile, uploadFileToS3 } from "@/modules/shared/file";
78
import { allowFileTypeByDocumentType } from "@/modules/shared/file/allowFileTypes";
@@ -189,6 +190,11 @@ export const sendDossierDeValidation = async ({
189190
},
190191
});
191192

193+
await updateCandidacyStatus({
194+
candidacyId,
195+
status: "DOSSIER_DE_VALIDATION_ENVOYE",
196+
});
197+
192198
// The candidate send a new DV and will be able to pass the jury again
193199
if (hasFailedJuryResult) {
194200
await prismaClient.jury.updateMany({

packages/reva-api/modules/dossier-de-validation/features/signalDossierDeValidationProblem.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { updateCandidacyStatus } from "@/modules/candidacy/features/updateCandidacyStatus";
12
import { logCandidacyAuditEvent } from "@/modules/candidacy-log/features/logCandidacyAuditEvent";
23
import { prismaClient } from "@/prisma/client";
34

@@ -79,6 +80,11 @@ export const signalDossierDeValidationProblem = async ({
7980
},
8081
});
8182

83+
await updateCandidacyStatus({
84+
candidacyId: dossierDeValidation.candidacyId,
85+
status: "DOSSIER_DE_VALIDATION_SIGNALE",
86+
});
87+
8288
const isAutonome = candidacy?.typeAccompagnement === "AUTONOME";
8389

8490
if (isAutonome) {

0 commit comments

Comments
 (0)