From 497f9ecc13a48944d85ac5eec244cb689c5563c5 Mon Sep 17 00:00:00 2001 From: Jonathan Fallon Date: Tue, 10 Dec 2024 11:59:31 +0100 Subject: [PATCH] fix: MAJ Campagnes (#2725) * set SMTC end_date Set end_date for SMTC Driver and Passenger to 31/12/2025 Requires manual update of the end_date in the database https://covoiturage-betagouv.zammad.com/#ticket/zoom/4677 * update IDFM add strike day in description and code for 11/12/2024 https://covoiturage-betagouv.zammad.com/#ticket/zoom/4675 --- .../engine/policies/20210520_IDFM.html.ts | 3 ++- .../policy/engine/policies/20210520_IDFM.ts | 22 +++++-------------- .../20240101_SMTC2024Passenger.html.ts | 5 ++--- .../policies/20240101_SMTCDriver.html.ts | 5 ++--- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/api/src/pdc/services/policy/engine/policies/20210520_IDFM.html.ts b/api/src/pdc/services/policy/engine/policies/20210520_IDFM.html.ts index 855053897b..bffb8dfda7 100644 --- a/api/src/pdc/services/policy/engine/policies/20210520_IDFM.html.ts +++ b/api/src/pdc/services/policy/engine/policies/20210520_IDFM.html.ts @@ -19,7 +19,7 @@ export const description = `

  • Le 18/02/2022
  • Du 25/03/2022 au 28/03/2022
  • Le 18/06/2022
  • -
  • Le 6/07/2022
  • +
  • Le 60/07/2022
  • Le 10/11/2022
  • Le 19/01/2023
  • Le 31/01/2023
  • @@ -35,6 +35,7 @@ export const description = `

  • Le 13/04/2023
  • Du 12/08/2023 au 14/08/2023 inclus
  • Le 25/10/2024
  • +
  • Le 11/12/2024
  • La campagne est limitée aux opérateurs BlaBlaCar Daily, Karos, Ynstant et Mobicoop proposant des preuves de classe C. diff --git a/api/src/pdc/services/policy/engine/policies/20210520_IDFM.ts b/api/src/pdc/services/policy/engine/policies/20210520_IDFM.ts index 9d25344070..edd9d62199 100644 --- a/api/src/pdc/services/policy/engine/policies/20210520_IDFM.ts +++ b/api/src/pdc/services/policy/engine/policies/20210520_IDFM.ts @@ -1,9 +1,6 @@ import { NotEligibleTargetException } from "@/pdc/services/policy/engine/exceptions/NotEligibleTargetException.ts"; import { atDate } from "@/pdc/services/policy/engine/helpers/atDate.ts"; -import { - getOperatorsAt, - TimestampedOperators, -} from "@/pdc/services/policy/engine/helpers/getOperatorsAt.ts"; +import { getOperatorsAt, TimestampedOperators } from "@/pdc/services/policy/engine/helpers/getOperatorsAt.ts"; import { isAfter } from "@/pdc/services/policy/engine/helpers/isAfter.ts"; import { isOperatorClassOrThrow } from "@/pdc/services/policy/engine/helpers/isOperatorClassOrThrow.ts"; import { isOperatorOrThrow } from "@/pdc/services/policy/engine/helpers/isOperatorOrThrow.ts"; @@ -13,15 +10,9 @@ import { watchForPersonMaxAmountByMonth, watchForPersonMaxTripByDay, } from "@/pdc/services/policy/engine/helpers/limits.ts"; -import { - onDistanceRange, - onDistanceRangeOrThrow, -} from "@/pdc/services/policy/engine/helpers/onDistanceRange.ts"; +import { onDistanceRange, onDistanceRangeOrThrow } from "@/pdc/services/policy/engine/helpers/onDistanceRange.ts"; import { perKm, perSeat } from "@/pdc/services/policy/engine/helpers/per.ts"; -import { - endsAt, - startsAt, -} from "@/pdc/services/policy/engine/helpers/position.ts"; +import { endsAt, startsAt } from "@/pdc/services/policy/engine/helpers/position.ts"; import { AbstractPolicyHandler } from "@/pdc/services/policy/engine/policies/AbstractPolicyHandler.ts"; import { RunnableSlices } from "@/pdc/services/policy/interfaces/engine/PolicyInterface.ts"; import { @@ -34,8 +25,7 @@ import { import { description } from "./20210520_IDFM.html.ts"; // Politique d'Île-de-France Mobilité -export const IDFMPeriodeNormale2021: PolicyHandlerStaticInterface = class - extends AbstractPolicyHandler +export const IDFMPeriodeNormale2021: PolicyHandlerStaticInterface = class extends AbstractPolicyHandler implements PolicyHandlerInterface { static readonly id = "459"; @@ -110,8 +100,7 @@ export const IDFMPeriodeNormale2021: PolicyHandlerStaticInterface = class { start: 15_000, end: 30_000, - fn: (ctx: StatelessContextInterface) => - perSeat(ctx, perKm(ctx, { amount: 10, offset: 15_000, limit: 30_000 })), + fn: (ctx: StatelessContextInterface) => perSeat(ctx, perKm(ctx, { amount: 10, offset: 15_000, limit: 30_000 })), }, ]; @@ -140,6 +129,7 @@ export const IDFMPeriodeNormale2021: PolicyHandlerStaticInterface = class "2023-08-13", "2023-08-14", "2024-10-25", + "2024-12-11", ]; protected processExclusion(ctx: StatelessContextInterface) { diff --git a/api/src/pdc/services/policy/engine/policies/20240101_SMTC2024Passenger.html.ts b/api/src/pdc/services/policy/engine/policies/20240101_SMTC2024Passenger.html.ts index dff83a1778..329cf85050 100644 --- a/api/src/pdc/services/policy/engine/policies/20240101_SMTC2024Passenger.html.ts +++ b/api/src/pdc/services/policy/engine/policies/20240101_SMTC2024Passenger.html.ts @@ -1,8 +1,7 @@ -export const description = - `

    +export const description = `

    - Campagne d’incitation au covoiturage du 01 janvier 2024 au 31 décembre 2024 + Campagne d’incitation au covoiturage du 01 janvier 2024 au 31 décembre 2025

    diff --git a/api/src/pdc/services/policy/engine/policies/20240101_SMTCDriver.html.ts b/api/src/pdc/services/policy/engine/policies/20240101_SMTCDriver.html.ts index 38854de21d..5960caf288 100644 --- a/api/src/pdc/services/policy/engine/policies/20240101_SMTCDriver.html.ts +++ b/api/src/pdc/services/policy/engine/policies/20240101_SMTCDriver.html.ts @@ -1,8 +1,7 @@ -export const description = - `

    +export const description = `

    - Campagne d’incitation au covoiturage du 01 janvier 2024 au 31 décembre 2024 + Campagne d’incitation au covoiturage du 01 janvier 2024 au 31 décembre 2025