Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow over 100% results for promotion, renumeration and raises indicators #2170

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { type EntityPropsToJson } from "@common/shared-domain";
import { Percentage, PositiveInteger, SimpleNumber } from "@common/shared-domain/domain/valueObjects";
import {
type Percentage,
PositiveInteger,
PositiveNumber,
SimpleNumber,
} from "@common/shared-domain/domain/valueObjects";

import { FavorablePopulation } from "../../valueObjects/declaration/indicators/FavorablePopulation";
import { NotComputableReasonPromotions } from "../../valueObjects/declaration/indicators/NotComputableReasonPromotions";
Expand Down Expand Up @@ -49,7 +54,7 @@ export class PromotionsIndicator extends AbstractIndicator<PromotionsIndicatorPr
if (json.notComputableReason)
props.notComputableReason = new NotComputableReasonPromotions(json.notComputableReason);
if (json.favorablePopulation) props.favorablePopulation = new FavorablePopulation(json.favorablePopulation);
if (typeof json.result === "number") props.result = new Percentage(json.result);
if (typeof json.result === "number") props.result = new PositiveNumber(json.result);
if (typeof json.score === "number") props.score = new PositiveInteger(json.score);

return new PromotionsIndicator(props) as this;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { type EntityPropsToJson } from "@common/shared-domain";
import { Percentage, PositiveInteger, SimpleNumber } from "@common/shared-domain/domain/valueObjects";
import {
type Percentage,
PositiveInteger,
PositiveNumber,
SimpleNumber,
} from "@common/shared-domain/domain/valueObjects";

import { type AgeRange } from "../../valueObjects/declaration/AgeRange";
import { FavorablePopulation } from "../../valueObjects/declaration/indicators/FavorablePopulation";
Expand Down Expand Up @@ -71,7 +76,7 @@ export class RemunerationsIndicator extends AbstractIndicator<RemunerationsIndic
if (json.notComputableReason)
props.notComputableReason = new NotComputableReasonRemunerations(json.notComputableReason);

if (typeof json.result === "number") props.result = new Percentage(json.result);
if (typeof json.result === "number") props.result = new PositiveNumber(json.result);
if (typeof json.score === "number") props.score = new PositiveInteger(json.score);

return new RemunerationsIndicator(props) as this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class SalaryRaisesAndPromotionsIndicator extends AbstractIndicator<Salary
if (json.notComputableReason)
props.notComputableReason = new NotComputableReasonSalaryRaisesAndPromotions(json.notComputableReason);
if (json.favorablePopulation) props.favorablePopulation = new FavorablePopulation(json.favorablePopulation);
if (typeof json.result === "number") props.result = new Percentage(json.result);
if (typeof json.result === "number") props.result = new PositiveNumber(json.result);
if (typeof json.score === "number") props.score = new PositiveInteger(json.score);
if (typeof json.employeesCountResult === "number")
props.employeesCountResult = new PositiveNumber(json.employeesCountResult);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { type EntityPropsToJson } from "@common/shared-domain";
import { Percentage, PositiveInteger, SimpleNumber } from "@common/shared-domain/domain/valueObjects";
import {
type Percentage,
PositiveInteger,
PositiveNumber,
SimpleNumber,
} from "@common/shared-domain/domain/valueObjects";

import { FavorablePopulation } from "../../valueObjects/declaration/indicators/FavorablePopulation";
import { NotComputableReasonSalaryRaises } from "../../valueObjects/declaration/indicators/NotComputableReasonSalaryRaises";
Expand Down Expand Up @@ -50,7 +55,7 @@ export class SalaryRaisesIndicator extends AbstractIndicator<SalaryRaisesIndicat
if (json.notComputableReason)
props.notComputableReason = new NotComputableReasonSalaryRaises(json.notComputableReason);
if (json.favorablePopulation) props.favorablePopulation = new FavorablePopulation(json.favorablePopulation);
if (typeof json.result === "number") props.result = new Percentage(json.result);
if (typeof json.result === "number") props.result = new PositiveNumber(json.result);
if (typeof json.score === "number") props.score = new PositiveInteger(json.score);

return new SalaryRaisesIndicator(props) as this;
Expand Down
Loading