Skip to content

Commit

Permalink
Envoi le statut de CEJ à openfisca
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan-CodeWorks committed Dec 6, 2023
1 parent d107776 commit 033045a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions backend/lib/openfisca/mapping/individu/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
findCommuneByInseeCode,
} from "../../../mes-aides/distance.js"

import common from "../common.js"

import { Activite } from "../../../../../lib/enums/activite.js"
import { IndividuGenerator } from "../../../../../lib/types/individu.js"

Expand Down Expand Up @@ -141,6 +143,12 @@ const individuSchema: IndividuGenerator = {
: "non_agricole"
},
},
sous_contrat_engagement_jeune: {
fn: function (individu, situation) {
const periods = common.getPeriods(situation.dateDeValeur)
return individu.contrat_engagement_jeune?.[periods.thisMonth] > 0
},
},
}

function isNotValidValue(value) {
Expand Down
2 changes: 1 addition & 1 deletion backend/lib/openfisca/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const EXTENSION_VARIABLES = {
},
"openfisca-france-local": {
familles: [],
individus: [],
individus: ["sous_contrat_engagement_jeune"],
menages: [],
},
}
Expand Down

0 comments on commit 033045a

Please sign in to comment.