Skip to content

Commit

Permalink
fix: constraint validation for declaration having indicator2And3 (#1812)
Browse files Browse the repository at this point in the history
  • Loading branch information
pom421 authored Nov 6, 2023
1 parent 26bbcfb commit 2992962
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,14 @@ export class DeclarationSpecification extends AbstractSpecification<Declaration>
}
}

if (!declaration.salaryRaisesAndPromotions?.notComputableReason) {
assert(
declaration.salaryRaisesAndPromotions?.employeesCountResult !== undefined,
`Le résulat par employé doit être renseigné pour l'indicateur augmentations et promotions quand il est calculable.`,
);
// Règle 8 bis complémentaire, pour l'indicateur augmentations et promotions
if (declaration.company.range.getValue() === CompanyWorkforceRange.Enum.FROM_50_TO_250) {
if (!declaration.salaryRaisesAndPromotions?.notComputableReason) {
assert(
declaration.salaryRaisesAndPromotions?.employeesCountResult !== undefined,
`Le résultat par employé doit être renseigné pour l'indicateur augmentations et promotions quand il est calculable.`,
);
}
}

type IndicatorRule9 = { favorablePopulation?: string; result?: Percentage } | undefined;
Expand Down

0 comments on commit 2992962

Please sign in to comment.