Skip to content

Commit

Permalink
fix: MAJ Campagnes (#2725)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jonathanfallon authored Dec 10, 2024
1 parent 24cbaa4 commit 497f9ec
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const description = `<p id="summary">
<li><b>Le 18/02/2022</b></li>
<li><b>Du 25/03/2022 au 28/03/2022</b></li>
<li><b>Le 18/06/2022</b></li>
<li><b>Le 6/07/2022</b></li>
<li><b>Le 60/07/2022</b></li>
<li><b>Le 10/11/2022</b></li>
<li><b>Le 19/01/2023</b></li>
<li><b>Le 31/01/2023</b></li>
Expand All @@ -35,6 +35,7 @@ export const description = `<p id="summary">
<li><b>Le 13/04/2023</b></li>
<li><b>Du 12/08/2023 au 14/08/2023 inclus</b></li>
<li><b>Le 25/10/2024</b></li>
<li><b>Le 11/12/2024</b></li>
</ul>
<p>
La campagne est limitée aux opérateurs BlaBlaCar Daily, Karos, Ynstant et Mobicoop proposant des preuves de classe C</b>.
Expand Down
22 changes: 6 additions & 16 deletions api/src/pdc/services/policy/engine/policies/20210520_IDFM.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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 {
Expand All @@ -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";

Expand Down Expand Up @@ -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 })),
},
];

Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export const description =
`<p _ngcontent-pmm-c231="" id="summary" class="campaignSummaryText-content-text">
export const description = `<p _ngcontent-pmm-c231="" id="summary" class="campaignSummaryText-content-text">
<p>
Campagne d’incitation au covoiturage du <b>01 janvier 2024 au 31 décembre 2024</b>
Campagne d’incitation au covoiturage du <b>01 janvier 2024 au 31 décembre 2025</b>
</p>
<p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export const description =
`<p _ngcontent-pmm-c231="" id="summary" class="campaignSummaryText-content-text">
export const description = `<p _ngcontent-pmm-c231="" id="summary" class="campaignSummaryText-content-text">
<p>
Campagne d’incitation au covoiturage du <b>01 janvier 2024 au 31 décembre 2024</b>
Campagne d’incitation au covoiturage du <b>01 janvier 2024 au 31 décembre 2025</b>
</p>
<p>
Expand Down

0 comments on commit 497f9ec

Please sign in to comment.