Skip to content

Commit

Permalink
fix: declaration mapper (#2272)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonat75 authored May 2, 2024
1 parent 07309ee commit 6009325
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions packages/app/src/common/core-domain/mappers/declarationMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ export const declarationMap: Required<Mapper<Declaration, DeclarationDTO, Declar
salaryRaises.favorablePopulation?.getValue() || FavorablePopulation.Enum.EQUALITY,
),
catégories: {
[CSP.Enum.OUVRIERS]: salaryRaises.categories[0]?.getValue() || "",
[CSP.Enum.EMPLOYES]: salaryRaises.categories[1]?.getValue() || "",
[CSP.Enum.TECHNICIENS_AGENTS_MAITRISES]: salaryRaises.categories[2]?.getValue() || "",
[CSP.Enum.INGENIEURS_CADRES]: salaryRaises.categories[3]?.getValue() || "",
[CSP.Enum.OUVRIERS]: salaryRaises.categories[0]?.getValue() ?? "",
[CSP.Enum.EMPLOYES]: salaryRaises.categories[1]?.getValue() ?? "",
[CSP.Enum.TECHNICIENS_AGENTS_MAITRISES]: salaryRaises.categories[2]?.getValue() ?? "",
[CSP.Enum.INGENIEURS_CADRES]: salaryRaises.categories[3]?.getValue() ?? "",
},
};
}
Expand All @@ -290,10 +290,10 @@ export const declarationMap: Required<Mapper<Declaration, DeclarationDTO, Declar
promotions.favorablePopulation?.getValue() || FavorablePopulation.Enum.EQUALITY,
),
catégories: {
[CSP.Enum.OUVRIERS]: promotions.categories[0]?.getValue() || "",
[CSP.Enum.EMPLOYES]: promotions.categories[1]?.getValue() || "",
[CSP.Enum.TECHNICIENS_AGENTS_MAITRISES]: promotions.categories[2]?.getValue() || "",
[CSP.Enum.INGENIEURS_CADRES]: promotions.categories[3]?.getValue() || "",
[CSP.Enum.OUVRIERS]: promotions.categories[0]?.getValue() ?? "",
[CSP.Enum.EMPLOYES]: promotions.categories[1]?.getValue() ?? "",
[CSP.Enum.TECHNICIENS_AGENTS_MAITRISES]: promotions.categories[2]?.getValue() ?? "",
[CSP.Enum.INGENIEURS_CADRES]: promotions.categories[3]?.getValue() ?? "",
},
};
}
Expand Down Expand Up @@ -364,10 +364,10 @@ export const declarationMap: Required<Mapper<Declaration, DeclarationDTO, Declar
catégories: remunerations?.categories.map(category => ({
nom: category.name || "",
tranches: {
[AgeRange.Enum.LESS_THAN_30]: category.ranges?.[":29"]?.getValue() || "",
[AgeRange.Enum.FROM_30_TO_39]: category.ranges?.["30:39"]?.getValue() || "",
[AgeRange.Enum.FROM_40_TO_49]: category.ranges?.["40:49"]?.getValue() || "",
[AgeRange.Enum.FROM_50_TO_MORE]: category.ranges?.["50:"]?.getValue() || "",
[AgeRange.Enum.LESS_THAN_30]: category.ranges?.[":29"]?.getValue() ?? "",
[AgeRange.Enum.FROM_30_TO_39]: category.ranges?.["30:39"]?.getValue() ?? "",
[AgeRange.Enum.FROM_40_TO_49]: category.ranges?.["40:49"]?.getValue() ?? "",
[AgeRange.Enum.FROM_50_TO_MORE]: category.ranges?.["50:"]?.getValue() ?? "",
},
})),
};
Expand All @@ -378,10 +378,10 @@ export const declarationMap: Required<Mapper<Declaration, DeclarationDTO, Declar
catégories: remunerations?.categories.map(category => ({
nom: category.name || "",
tranches: {
[AgeRange.Enum.LESS_THAN_30]: category.ranges?.[":29"]?.getValue() || "",
[AgeRange.Enum.FROM_30_TO_39]: category.ranges?.["30:39"]?.getValue() || "",
[AgeRange.Enum.FROM_40_TO_49]: category.ranges?.["40:49"]?.getValue() || "",
[AgeRange.Enum.FROM_50_TO_MORE]: category.ranges?.["50:"]?.getValue() || "",
[AgeRange.Enum.LESS_THAN_30]: category.ranges?.[":29"]?.getValue() ?? "",
[AgeRange.Enum.FROM_30_TO_39]: category.ranges?.["30:39"]?.getValue() ?? "",
[AgeRange.Enum.FROM_40_TO_49]: category.ranges?.["40:49"]?.getValue() ?? "",
[AgeRange.Enum.FROM_50_TO_MORE]: category.ranges?.["50:"]?.getValue() ?? "",
},
})),
};
Expand Down

0 comments on commit 6009325

Please sign in to comment.