From 2c85f5fab7406f6bda72a456ca56111402f9e3ef Mon Sep 17 00:00:00 2001 From: Mael Date: Tue, 26 Jun 2018 10:14:11 +0000 Subject: [PATCH] =?UTF-8?q?:bug:=20Int=C3=A9gration=20du=20versement=20tra?= =?UTF-8?q?nsport=20dans=20les=20r=C3=A9sultats?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/components/ResultView/Distribution.js | 1 + source/components/ResultView/selectors.js | 17 +++++++++++------ source/components/ResultView/types.js | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/source/components/ResultView/Distribution.js b/source/components/ResultView/Distribution.js index 68c0c26e1..1128291d1 100644 --- a/source/components/ResultView/Distribution.js +++ b/source/components/ResultView/Distribution.js @@ -24,6 +24,7 @@ const brancheToEmoji: { [Branche]: string } = { logement: '🏡', 'accidents du travail / maladies professionnelles': '☣️', 'assurance chômage': '💸', + transport: '🚌', autres: '🔧' } diff --git a/source/components/ResultView/selectors.js b/source/components/ResultView/selectors.js index 4d7f6a947..0139d51dd 100644 --- a/source/components/ResultView/selectors.js +++ b/source/components/ResultView/selectors.js @@ -50,6 +50,7 @@ export const COTISATION_BRANCHE_ORDER: Array = [ 'assurance chômage', 'formation', 'logement', + 'transport', 'autres' ] @@ -142,7 +143,7 @@ const analysisToCotisations = ( cotisation.montant.partSalariale !== 0 ), groupByBranche, - filter(([,brancheCotisation]) => !!brancheCotisation) + filter(([, brancheCotisation]) => !!brancheCotisation) )(variables) return cotisations } @@ -260,8 +261,11 @@ const REPARTITION_CSG: { [Branche]: number } = { // TODO: cette part correspond à l'amortissement de la dette de la sécurité sociale. // On peut imaginer la partager à toute les composantes concernées autres: 0.6 -}; -function dispatchCSGInPlace(CSG: Cotisation, rawRépartition: {[Branche]: MontantPartagé}): void { +} +function dispatchCSGInPlace( + CSG: Cotisation, + rawRépartition: { [Branche]: MontantPartagé } +): void { // $FlowFixMe for (const branche: Branche in REPARTITION_CSG) { rawRépartition[branche] = { @@ -288,11 +292,12 @@ const répartition = (ficheDePaie: FicheDePaie): Répartition => { ) if (cotisations.autres) { const CSG = cotisations.autres.find(({ nom }) => nom === 'CSG') - if (!CSG) throw new Error('[répartition selector]: expect CSG not to be null') + if (!CSG) + throw new Error('[répartition selector]: expect CSG not to be null') cotisations.autres = without([CSG], cotisations.autres) - dispatchCSGInPlace(CSG, rawRépartition); + dispatchCSGInPlace(CSG, rawRépartition) } - + return { // $FlowFixMe répartition: compose( diff --git a/source/components/ResultView/types.js b/source/components/ResultView/types.js index 43246a549..07dffda97 100644 --- a/source/components/ResultView/types.js +++ b/source/components/ResultView/types.js @@ -21,6 +21,7 @@ export type Branche = | 'assurance chômage' | 'formation' | 'logement' + | 'transport' | 'autres' export type MontantPartagé = {