Skip to content

Commit

Permalink
fix departSejourMotif types
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric013 committed Jan 24, 2025
1 parent 515a2d1 commit 9eb3f82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/src/crons/autoValidatePhase1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { updateStatusPhase1 } from "../utils";
import { capture } from "../sentry";
import slack from "../slack";
import { CohortModel, LigneBusModel, YoungModel } from "../models";
import { getDepartureDate, YOUNG_STATUS, YOUNG_STATUS_PHASE1, DEPART_SEJOUR_MOTIFS_NOT_DONE, DepartSejourMotif } from "snu-lib";
import { getDepartureDate, YOUNG_STATUS, YOUNG_STATUS_PHASE1, DEPART_SEJOUR_MOTIFS_NOT_DONE } from "snu-lib";

export const handler = async (): Promise<void> => {
try {
Expand Down Expand Up @@ -32,7 +32,7 @@ export const handler = async (): Promise<void> => {
const dateStart = getDepartureDate(young, sessionPhase1, cohort, { bus });

if (differenceInDays(now, dateStart) <= cohort.daysToValidate) {
const isMotifNotDone = young.departSejourMotif && DEPART_SEJOUR_MOTIFS_NOT_DONE.includes(young.departSejourMotif as DepartSejourMotif);
const isMotifNotDone = young.departSejourMotif && DEPART_SEJOUR_MOTIFS_NOT_DONE.includes(young.departSejourMotif as (typeof DEPART_SEJOUR_MOTIFS_NOT_DONE)[number]);

if (isMotifNotDone) {
young.set({ statusPhase1: YOUNG_STATUS_PHASE1.NOT_DONE });
Expand Down

0 comments on commit 9eb3f82

Please sign in to comment.