Skip to content

Commit 4a097e5

Browse files
committed
fix: allow over 100% results for promotion, renumeration and raises indicators
1 parent 5e8e06a commit 4a097e5

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

packages/app/src/common/core-domain/domain/declaration/indicators/PromotionsIndicator.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { type EntityPropsToJson } from "@common/shared-domain";
2-
import { Percentage, PositiveInteger, SimpleNumber } from "@common/shared-domain/domain/valueObjects";
2+
import {
3+
type Percentage,
4+
PositiveInteger,
5+
PositiveNumber,
6+
SimpleNumber,
7+
} from "@common/shared-domain/domain/valueObjects";
38

49
import { FavorablePopulation } from "../../valueObjects/declaration/indicators/FavorablePopulation";
510
import { NotComputableReasonPromotions } from "../../valueObjects/declaration/indicators/NotComputableReasonPromotions";
@@ -49,7 +54,7 @@ export class PromotionsIndicator extends AbstractIndicator<PromotionsIndicatorPr
4954
if (json.notComputableReason)
5055
props.notComputableReason = new NotComputableReasonPromotions(json.notComputableReason);
5156
if (json.favorablePopulation) props.favorablePopulation = new FavorablePopulation(json.favorablePopulation);
52-
if (typeof json.result === "number") props.result = new Percentage(json.result);
57+
if (typeof json.result === "number") props.result = new PositiveNumber(json.result);
5358
if (typeof json.score === "number") props.score = new PositiveInteger(json.score);
5459

5560
return new PromotionsIndicator(props) as this;

packages/app/src/common/core-domain/domain/declaration/indicators/RemunerationsIndicator.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { type EntityPropsToJson } from "@common/shared-domain";
2-
import { Percentage, PositiveInteger, SimpleNumber } from "@common/shared-domain/domain/valueObjects";
2+
import {
3+
type Percentage,
4+
PositiveInteger,
5+
PositiveNumber,
6+
SimpleNumber,
7+
} from "@common/shared-domain/domain/valueObjects";
38

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

74-
if (typeof json.result === "number") props.result = new Percentage(json.result);
79+
if (typeof json.result === "number") props.result = new PositiveNumber(json.result);
7580
if (typeof json.score === "number") props.score = new PositiveInteger(json.score);
7681

7782
return new RemunerationsIndicator(props) as this;

packages/app/src/common/core-domain/domain/declaration/indicators/SalaryRaisesAndPromotionsIndicator.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class SalaryRaisesAndPromotionsIndicator extends AbstractIndicator<Salary
5252
if (json.notComputableReason)
5353
props.notComputableReason = new NotComputableReasonSalaryRaisesAndPromotions(json.notComputableReason);
5454
if (json.favorablePopulation) props.favorablePopulation = new FavorablePopulation(json.favorablePopulation);
55-
if (typeof json.result === "number") props.result = new Percentage(json.result);
55+
if (typeof json.result === "number") props.result = new PositiveNumber(json.result);
5656
if (typeof json.score === "number") props.score = new PositiveInteger(json.score);
5757
if (typeof json.employeesCountResult === "number")
5858
props.employeesCountResult = new PositiveNumber(json.employeesCountResult);

packages/app/src/common/core-domain/domain/declaration/indicators/SalaryRaisesIndicator.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { type EntityPropsToJson } from "@common/shared-domain";
2-
import { Percentage, PositiveInteger, SimpleNumber } from "@common/shared-domain/domain/valueObjects";
2+
import {
3+
type Percentage,
4+
PositiveInteger,
5+
PositiveNumber,
6+
SimpleNumber,
7+
} from "@common/shared-domain/domain/valueObjects";
38

49
import { FavorablePopulation } from "../../valueObjects/declaration/indicators/FavorablePopulation";
510
import { NotComputableReasonSalaryRaises } from "../../valueObjects/declaration/indicators/NotComputableReasonSalaryRaises";
@@ -50,7 +55,7 @@ export class SalaryRaisesIndicator extends AbstractIndicator<SalaryRaisesIndicat
5055
if (json.notComputableReason)
5156
props.notComputableReason = new NotComputableReasonSalaryRaises(json.notComputableReason);
5257
if (json.favorablePopulation) props.favorablePopulation = new FavorablePopulation(json.favorablePopulation);
53-
if (typeof json.result === "number") props.result = new Percentage(json.result);
58+
if (typeof json.result === "number") props.result = new PositiveNumber(json.result);
5459
if (typeof json.score === "number") props.score = new PositiveInteger(json.score);
5560

5661
return new SalaryRaisesIndicator(props) as this;

0 commit comments

Comments
 (0)