hcm-clocking-event-rule-nodejs 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/changes.d.ts +17 -3
- package/data/changes.js +30 -12
- package/data/changes.js.map +1 -1
- package/data/clockingEvent.d.ts +11 -2
- package/data/clockingEvent.js +10 -9
- package/data/clockingEvent.js.map +1 -1
- package/data/collectiveNegotiation.d.ts +6 -1
- package/data/collectiveNegotiation.js +4 -4
- package/data/collectiveNegotiation.js.map +1 -1
- package/data/context.d.ts +1 -2
- package/data/context.js +2 -5
- package/data/context.js.map +1 -1
- package/data/{context-reference.d.ts → contextReference.d.ts} +5 -1
- package/data/{context-reference.js → contextReference.js} +17 -6
- package/data/contextReference.js.map +1 -0
- package/data/contract.d.ts +22 -21
- package/data/contract.js +46 -10
- package/data/contract.js.map +1 -1
- package/data/{ruleParams.d.ts → dataset.d.ts} +9 -9
- package/data/dataset.js +141 -0
- package/data/dataset.js.map +1 -0
- package/data/employee.d.ts +30 -5
- package/data/employee.js +31 -10
- package/data/employee.js.map +1 -1
- package/data/employer.d.ts +8 -0
- package/data/employer.js +13 -0
- package/data/employer.js.map +1 -0
- package/data/employmentRelationship.d.ts +5 -3
- package/data/employmentRelationship.js +3 -7
- package/data/employmentRelationship.js.map +1 -1
- package/data/histories.d.ts +12 -1
- package/data/histories.js +10 -10
- package/data/histories.js.map +1 -1
- package/data/holidays.d.ts +9 -4
- package/data/holidays.js +6 -10
- package/data/holidays.js.map +1 -1
- package/data/hourBank/hourBank.d.ts +21 -0
- package/data/hourBank/hourBank.js +19 -0
- package/data/hourBank/hourBank.js.map +1 -0
- package/data/hourBank/hourBankAccount.d.ts +30 -0
- package/data/hourBank/hourBankAccount.js +34 -0
- package/data/hourBank/hourBankAccount.js.map +1 -0
- package/data/interval.d.ts +21 -2
- package/data/interval.js +22 -21
- package/data/interval.js.map +1 -1
- package/data/log.d.ts +5 -1
- package/data/log.js +4 -4
- package/data/log.js.map +1 -1
- package/data/person.d.ts +4 -1
- package/data/person.js +2 -2
- package/data/person.js.map +1 -1
- package/data/schedules/bridge.d.ts +37 -0
- package/data/schedules/bridge.js +30 -0
- package/data/schedules/bridge.js.map +1 -0
- package/data/schedules/schedules.d.ts +31 -0
- package/data/schedules/schedules.js +51 -0
- package/data/schedules/schedules.js.map +1 -0
- package/data/schedules.d.ts +7 -1
- package/data/schedules.js +5 -5
- package/data/schedules.js.map +1 -1
- package/data/separatedHours.d.ts +5 -1
- package/data/separatedHours.js +3 -3
- package/data/separatedHours.js.map +1 -1
- package/data/situation.d.ts +11 -2
- package/data/situation.js +9 -9
- package/data/situation.js.map +1 -1
- package/data/syndicate.d.ts +7 -1
- package/data/syndicate.js +5 -5
- package/data/syndicate.js.map +1 -1
- package/data/syndicateHistory.d.ts +9 -2
- package/data/syndicateHistory.js +7 -6
- package/data/syndicateHistory.js.map +1 -1
- package/data/timeEvaluation.d.ts +39 -7
- package/data/timeEvaluation.js +98 -37
- package/data/timeEvaluation.js.map +1 -1
- package/data/timeEvaluationSituation.d.ts +9 -3
- package/data/timeEvaluationSituation.js +6 -6
- package/data/timeEvaluationSituation.js.map +1 -1
- package/data/workschedule.d.ts +8 -9
- package/data/workschedule.js +12 -22
- package/data/workschedule.js.map +1 -1
- package/data/workshift.d.ts +10 -1
- package/data/workshift.js +9 -9
- package/data/workshift.js.map +1 -1
- package/index.d.ts +7 -6
- package/index.js +14 -12
- package/index.js.map +1 -1
- package/package.json +6 -5
- package/utils/{dateUtils.d.ts → date.utils.d.ts} +13 -11
- package/utils/{dateUtils.js → date.utils.js} +24 -17
- package/utils/date.utils.js.map +1 -0
- package/utils/object.utils.d.ts +29 -0
- package/utils/object.utils.js +59 -0
- package/utils/object.utils.js.map +1 -0
- package/data/context-reference.js.map +0 -1
- package/data/employeer.d.ts +0 -5
- package/data/employeer.js +0 -13
- package/data/employeer.js.map +0 -1
- package/data/ruleParams.js +0 -117
- package/data/ruleParams.js.map +0 -1
- package/test.d.ts +0 -0
- package/test.js +0 -7
- package/test.js.map +0 -1
- package/utils/dateUtils.js.map +0 -1
- package/utils/objectUtils.d.ts +0 -11
- package/utils/objectUtils.js +0 -17
- package/utils/objectUtils.js.map +0 -1
- package/utils/utils.spec.d.ts +0 -1
- package/utils/utils.spec.js +0 -165
- package/utils/utils.spec.js.map +0 -1
package/data/timeEvaluation.d.ts
CHANGED
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import { TimeEvaluationSituation } from "./timeEvaluationSituation";
|
|
2
|
-
import { ClockingEvent } from "./clockingEvent";
|
|
3
2
|
import { Interval, IntervalTypes } from "./interval";
|
|
4
3
|
import { Workschedule } from "./workschedule";
|
|
5
4
|
import { Workshift } from "./workshift";
|
|
6
5
|
import { SeparatedHours } from "./separatedHours";
|
|
7
|
-
import { ContextReference } from "./
|
|
6
|
+
import { ContextReference } from "./contextReference";
|
|
7
|
+
import { ClockingEvent } from "./clockingEvent";
|
|
8
|
+
import { Schedules } from "./schedules/schedules";
|
|
9
|
+
import { Bridge } from "./schedules/bridge";
|
|
10
|
+
import { HourBankAccount } from "./hourBank/hourBankAccount";
|
|
11
|
+
/**
|
|
12
|
+
* Interface para os parâmetros do construtor de TimeEvaluation.
|
|
13
|
+
*/
|
|
14
|
+
export interface TimeEvaluationParams {
|
|
15
|
+
date: Date;
|
|
16
|
+
workschedule: Workschedule;
|
|
17
|
+
workshift: Workshift;
|
|
18
|
+
timeEvaluationSituations: TimeEvaluationSituation[];
|
|
19
|
+
clockingEvents: ClockingEvent[];
|
|
20
|
+
intervals: Interval[];
|
|
21
|
+
contextRef: ContextReference;
|
|
22
|
+
schedules: Schedules;
|
|
23
|
+
hourBankAccounts: HourBankAccount[];
|
|
24
|
+
}
|
|
8
25
|
/**
|
|
9
26
|
* Apuração de ponto, as apurações acontecem diáriamente.
|
|
10
27
|
*
|
|
@@ -25,7 +42,7 @@ export declare class TimeEvaluation {
|
|
|
25
42
|
/**
|
|
26
43
|
* Situações
|
|
27
44
|
*/
|
|
28
|
-
private readonly
|
|
45
|
+
private readonly _timeEvaluationSituations;
|
|
29
46
|
/**
|
|
30
47
|
* Marcações de ponto
|
|
31
48
|
*/
|
|
@@ -35,17 +52,18 @@ export declare class TimeEvaluation {
|
|
|
35
52
|
*/
|
|
36
53
|
private readonly _intervals;
|
|
37
54
|
private readonly _contextRef;
|
|
55
|
+
private readonly _schedules;
|
|
56
|
+
private readonly _hourBankAccounts;
|
|
38
57
|
/**
|
|
39
58
|
* Mensagem de erro para dia inválido.
|
|
40
59
|
*/
|
|
41
60
|
private _errorMessage;
|
|
42
61
|
/** @hidden */
|
|
43
|
-
constructor(
|
|
44
|
-
clockingEvents: ClockingEvent[], intervals: Interval[], contextRef: ContextReference);
|
|
62
|
+
constructor(params: TimeEvaluationParams);
|
|
45
63
|
/**
|
|
46
64
|
* Data de apuração
|
|
47
65
|
*/
|
|
48
|
-
get date():
|
|
66
|
+
get date(): Date;
|
|
49
67
|
/**
|
|
50
68
|
* Horário de trabalho
|
|
51
69
|
*/
|
|
@@ -57,7 +75,7 @@ export declare class TimeEvaluation {
|
|
|
57
75
|
/**
|
|
58
76
|
* Situações calculadas no dia
|
|
59
77
|
*/
|
|
60
|
-
get
|
|
78
|
+
get timeEvaluationSituations(): TimeEvaluationSituation[];
|
|
61
79
|
/**
|
|
62
80
|
* Marcações de ponto
|
|
63
81
|
*/
|
|
@@ -112,6 +130,7 @@ export declare class TimeEvaluation {
|
|
|
112
130
|
private sumBetweenClocking;
|
|
113
131
|
/**
|
|
114
132
|
* Invalida uma apuração, apuração invalidada não será considerada no cálculo.
|
|
133
|
+
* A apuração não será alterada.
|
|
115
134
|
* @param message Motivo.
|
|
116
135
|
*/
|
|
117
136
|
invalidate(message: string): void;
|
|
@@ -119,4 +138,17 @@ export declare class TimeEvaluation {
|
|
|
119
138
|
* Recupera a mensagem de erro.
|
|
120
139
|
*/
|
|
121
140
|
get errorMessage(): string;
|
|
141
|
+
/**
|
|
142
|
+
* Busca a bridge que corresponde a data de apuração.
|
|
143
|
+
* @param date Data a ser usada no filtro
|
|
144
|
+
* @returns A bridge que corresponde ao critério ou undefined se não encontrar
|
|
145
|
+
*/
|
|
146
|
+
get bridge(): Bridge | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Retorna a conta de banco de horas válida para a data de apuração.
|
|
149
|
+
* Verifica se a data de apuração está entre creationDate e extinctionDate da conta.
|
|
150
|
+
*
|
|
151
|
+
* @returns A conta de banco de horas válida ou undefined se não encontrar.
|
|
152
|
+
*/
|
|
153
|
+
get hourBankAccounts(): HourBankAccount[];
|
|
122
154
|
}
|
package/data/timeEvaluation.js
CHANGED
|
@@ -1,35 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimeEvaluation = void 0;
|
|
4
|
-
const
|
|
4
|
+
const date_utils_1 = require("../utils/date.utils");
|
|
5
5
|
const timeEvaluationSituation_1 = require("./timeEvaluationSituation");
|
|
6
6
|
const interval_1 = require("./interval");
|
|
7
7
|
const workschedule_1 = require("./workschedule");
|
|
8
8
|
const separatedHours_1 = require("./separatedHours");
|
|
9
|
+
const object_utils_1 = require("../utils/object.utils");
|
|
9
10
|
/**
|
|
10
11
|
* Apuração de ponto, as apurações acontecem diáriamente.
|
|
11
12
|
*
|
|
12
13
|
*/
|
|
13
14
|
class TimeEvaluation {
|
|
14
15
|
/** @hidden */
|
|
15
|
-
constructor(
|
|
16
|
-
clockingEvents, intervals, contextRef) {
|
|
16
|
+
constructor(params) {
|
|
17
17
|
/**
|
|
18
18
|
* Mensagem de erro para dia inválido.
|
|
19
19
|
*/
|
|
20
20
|
this._errorMessage = "";
|
|
21
|
-
this._date = date;
|
|
22
|
-
this._workschedule = new workschedule_1.Workschedule(
|
|
23
|
-
this._workshift = workshift;
|
|
24
|
-
this._clockingEvents = clockingEvents;
|
|
25
|
-
this._contextRef = contextRef;
|
|
26
|
-
this.
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
this._date = object_utils_1.ObjectUtils.toDateOrThrow(params.date, "timeEvaluation.date");
|
|
22
|
+
this._workschedule = new workschedule_1.Workschedule({ code: params.workschedule.code, previousHours: params.workschedule.previousHours });
|
|
23
|
+
this._workshift = params.workshift;
|
|
24
|
+
this._clockingEvents = params.clockingEvents;
|
|
25
|
+
this._contextRef = params.contextRef;
|
|
26
|
+
this._schedules = params.schedules;
|
|
27
|
+
this._hourBankAccounts = params.hourBankAccounts;
|
|
28
|
+
this._timeEvaluationSituations = [];
|
|
29
|
+
if (Array.isArray(params.timeEvaluationSituations)) {
|
|
30
|
+
for (const timeEvaluationSituationItem of params.timeEvaluationSituations) {
|
|
31
|
+
this._timeEvaluationSituations.push(new timeEvaluationSituation_1.TimeEvaluationSituation({
|
|
32
|
+
id: timeEvaluationSituationItem.id,
|
|
33
|
+
situation: timeEvaluationSituationItem.situation,
|
|
34
|
+
numberOfHours: timeEvaluationSituationItem.numberOfHours,
|
|
35
|
+
contextRef: this._contextRef
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
29
38
|
}
|
|
30
39
|
this._intervals = [];
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
if (Array.isArray(params.intervals)) {
|
|
41
|
+
for (const intervalItem of params.intervals) {
|
|
42
|
+
this._intervals.push(new interval_1.Interval({
|
|
43
|
+
clockingEventStart: object_utils_1.ObjectUtils.toDateOrThrow(intervalItem.clockingEventStart, "interval.clockingEventStart"),
|
|
44
|
+
clockingEventEnd: object_utils_1.ObjectUtils.toDateOrThrow(intervalItem.clockingEventEnd, "interval.clockingEventEnd"),
|
|
45
|
+
type: intervalItem.type,
|
|
46
|
+
subType: intervalItem.subType,
|
|
47
|
+
typeIntervalTolerance: intervalItem.typeIntervalTolerance,
|
|
48
|
+
subTypeIntervalTolerance: intervalItem.subTypeIntervalTolerance,
|
|
49
|
+
situationCode: intervalItem.situationCode,
|
|
50
|
+
positionWorkingParte: intervalItem.positionWorkingParte,
|
|
51
|
+
isNightly: intervalItem.isNightly,
|
|
52
|
+
isOvertimeAutorized: intervalItem.isOvertimeAutorized,
|
|
53
|
+
withinClockingEventTolerance: intervalItem.withinClockingEventTolerance,
|
|
54
|
+
isTolerancePeriod: intervalItem.isTolerancePeriod,
|
|
55
|
+
inClockingEventTolerance: intervalItem.inClockingEventTolerance
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
33
58
|
}
|
|
34
59
|
}
|
|
35
60
|
/**
|
|
@@ -53,8 +78,8 @@ class TimeEvaluation {
|
|
|
53
78
|
/**
|
|
54
79
|
* Situações calculadas no dia
|
|
55
80
|
*/
|
|
56
|
-
get
|
|
57
|
-
return this.
|
|
81
|
+
get timeEvaluationSituations() {
|
|
82
|
+
return this._timeEvaluationSituations;
|
|
58
83
|
}
|
|
59
84
|
/**
|
|
60
85
|
* Marcações de ponto
|
|
@@ -75,17 +100,22 @@ class TimeEvaluation {
|
|
|
75
100
|
*/
|
|
76
101
|
setSituationHour(situationCode, numberOfHours) {
|
|
77
102
|
let found = false;
|
|
78
|
-
this.
|
|
103
|
+
this._timeEvaluationSituations.forEach((timeEvaluationSituation) => {
|
|
79
104
|
if (timeEvaluationSituation.situation === situationCode) {
|
|
80
105
|
timeEvaluationSituation.numberOfHours = numberOfHours;
|
|
81
106
|
found = true;
|
|
82
107
|
}
|
|
83
108
|
});
|
|
84
109
|
if (!found && numberOfHours > 0) {
|
|
85
|
-
const timeEvaluationSituation = new timeEvaluationSituation_1.TimeEvaluationSituation(
|
|
110
|
+
const timeEvaluationSituation = new timeEvaluationSituation_1.TimeEvaluationSituation({
|
|
111
|
+
numberOfHours,
|
|
112
|
+
situation: situationCode,
|
|
113
|
+
id: "",
|
|
114
|
+
contextRef: this._contextRef
|
|
115
|
+
});
|
|
86
116
|
// sujar o buffer
|
|
87
117
|
timeEvaluationSituation.numberOfHours = numberOfHours;
|
|
88
|
-
this.
|
|
118
|
+
this._timeEvaluationSituations.push(timeEvaluationSituation);
|
|
89
119
|
}
|
|
90
120
|
}
|
|
91
121
|
/**
|
|
@@ -95,17 +125,22 @@ class TimeEvaluation {
|
|
|
95
125
|
*/
|
|
96
126
|
sumSituationHour(situationCode, numberOfHours) {
|
|
97
127
|
let found = false;
|
|
98
|
-
this.
|
|
128
|
+
this._timeEvaluationSituations.forEach((timeEvaluationSituation) => {
|
|
99
129
|
if (timeEvaluationSituation.situation === situationCode) {
|
|
100
130
|
timeEvaluationSituation.addNumberOfHours(numberOfHours);
|
|
101
131
|
found = true;
|
|
102
132
|
}
|
|
103
133
|
});
|
|
104
134
|
if (!found) {
|
|
105
|
-
const timeEvaluationSituation = new timeEvaluationSituation_1.TimeEvaluationSituation(
|
|
135
|
+
const timeEvaluationSituation = new timeEvaluationSituation_1.TimeEvaluationSituation({
|
|
136
|
+
numberOfHours,
|
|
137
|
+
situation: situationCode,
|
|
138
|
+
id: "",
|
|
139
|
+
contextRef: this._contextRef
|
|
140
|
+
});
|
|
106
141
|
//sujar o buffer
|
|
107
142
|
timeEvaluationSituation.numberOfHours = numberOfHours;
|
|
108
|
-
this.
|
|
143
|
+
this._timeEvaluationSituations.push(timeEvaluationSituation);
|
|
109
144
|
}
|
|
110
145
|
}
|
|
111
146
|
/**
|
|
@@ -115,7 +150,7 @@ class TimeEvaluation {
|
|
|
115
150
|
*/
|
|
116
151
|
getSituationHour(situationCode) {
|
|
117
152
|
let numberOfHours = 0;
|
|
118
|
-
this.
|
|
153
|
+
this._timeEvaluationSituations.forEach((timeEvaluationSituation) => {
|
|
119
154
|
if (timeEvaluationSituation.situation === situationCode) {
|
|
120
155
|
numberOfHours = timeEvaluationSituation.numberOfHours;
|
|
121
156
|
}
|
|
@@ -138,9 +173,9 @@ class TimeEvaluation {
|
|
|
138
173
|
*/
|
|
139
174
|
getSeparateHours(intervalType, tolerance) {
|
|
140
175
|
if (this.intervals == null || this.intervals.length === 0) {
|
|
141
|
-
return new separatedHours_1.SeparatedHours(0, 0);
|
|
176
|
+
return new separatedHours_1.SeparatedHours({ dailyHours: 0, nightlyHours: 0 });
|
|
142
177
|
}
|
|
143
|
-
return this.getHours(
|
|
178
|
+
return this.getHours(date_utils_1.DateUtils.MIN_DATE, date_utils_1.DateUtils.MAX_DATE, intervalType, tolerance);
|
|
144
179
|
}
|
|
145
180
|
/**
|
|
146
181
|
* Recupera a quantidade de horas separadas de um intervalo.
|
|
@@ -152,22 +187,24 @@ class TimeEvaluation {
|
|
|
152
187
|
* @returns
|
|
153
188
|
*/
|
|
154
189
|
getHours(startClocking, endDate, intervalType, tolerance) {
|
|
155
|
-
const separatedHours = new separatedHours_1.SeparatedHours(0, 0);
|
|
156
|
-
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
190
|
+
const separatedHours = new separatedHours_1.SeparatedHours({ dailyHours: 0, nightlyHours: 0 });
|
|
191
|
+
if (Array.isArray(this.intervals)) {
|
|
192
|
+
for (const interval of this.intervals) {
|
|
193
|
+
const type = interval.isTolerancePeriod && !tolerance === true ? interval.typeIntervalTolerance : interval.type;
|
|
194
|
+
if (intervalType === type) {
|
|
195
|
+
separatedHours.sumSeparatedHours(this.calculateSeparateHours(startClocking, endDate, interval));
|
|
196
|
+
}
|
|
160
197
|
}
|
|
161
198
|
}
|
|
162
199
|
return separatedHours;
|
|
163
200
|
}
|
|
164
201
|
calculateSeparateHours(startClocking, endClocking, interval) {
|
|
165
|
-
const separedHours = new separatedHours_1.SeparatedHours(0, 0);
|
|
166
|
-
if (
|
|
202
|
+
const separedHours = new separatedHours_1.SeparatedHours({ dailyHours: 0, nightlyHours: 0 });
|
|
203
|
+
if (date_utils_1.DateUtils.isBeforeOrEquals(startClocking, interval.clockingEventStart) && date_utils_1.DateUtils.isAfterOrEquals(endClocking, interval.clockingEventEnd)) {
|
|
167
204
|
this.sumCompleteInterval(interval, separedHours);
|
|
168
205
|
}
|
|
169
|
-
else if (
|
|
170
|
-
|
|
206
|
+
else if (date_utils_1.DateUtils.between(startClocking, interval.clockingEventStart, interval.clockingEventEnd) ||
|
|
207
|
+
date_utils_1.DateUtils.between(endClocking, interval.clockingEventStart, interval.clockingEventEnd)) {
|
|
171
208
|
this.sumBetweenClocking(interval, endClocking, startClocking, separedHours);
|
|
172
209
|
}
|
|
173
210
|
return separedHours;
|
|
@@ -181,17 +218,18 @@ class TimeEvaluation {
|
|
|
181
218
|
}
|
|
182
219
|
}
|
|
183
220
|
sumBetweenClocking(interval, endClocking, startClocking, separedHours) {
|
|
184
|
-
const menorFim =
|
|
185
|
-
const maiorInicio =
|
|
221
|
+
const menorFim = date_utils_1.DateUtils.isBefore(interval.clockingEventEnd, endClocking) ? interval.clockingEventEnd : endClocking;
|
|
222
|
+
const maiorInicio = date_utils_1.DateUtils.isAfter(interval.clockingEventStart, startClocking) ? interval.clockingEventStart : startClocking;
|
|
186
223
|
if (!interval.isNightly) {
|
|
187
|
-
separedHours.sumDailyHours(
|
|
224
|
+
separedHours.sumDailyHours(date_utils_1.DateUtils.getDateInMinutes(menorFim, maiorInicio));
|
|
188
225
|
}
|
|
189
226
|
else {
|
|
190
|
-
separedHours.sumNightlyHours(
|
|
227
|
+
separedHours.sumNightlyHours(date_utils_1.DateUtils.getDateInMinutes(menorFim, maiorInicio));
|
|
191
228
|
}
|
|
192
229
|
}
|
|
193
230
|
/**
|
|
194
231
|
* Invalida uma apuração, apuração invalidada não será considerada no cálculo.
|
|
232
|
+
* A apuração não será alterada.
|
|
195
233
|
* @param message Motivo.
|
|
196
234
|
*/
|
|
197
235
|
invalidate(message) {
|
|
@@ -203,6 +241,29 @@ class TimeEvaluation {
|
|
|
203
241
|
get errorMessage() {
|
|
204
242
|
return this._errorMessage;
|
|
205
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Busca a bridge que corresponde a data de apuração.
|
|
246
|
+
* @param date Data a ser usada no filtro
|
|
247
|
+
* @returns A bridge que corresponde ao critério ou undefined se não encontrar
|
|
248
|
+
*/
|
|
249
|
+
get bridge() {
|
|
250
|
+
return this._schedules.findBridgeByDate(this._date);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Retorna a conta de banco de horas válida para a data de apuração.
|
|
254
|
+
* Verifica se a data de apuração está entre creationDate e extinctionDate da conta.
|
|
255
|
+
*
|
|
256
|
+
* @returns A conta de banco de horas válida ou undefined se não encontrar.
|
|
257
|
+
*/
|
|
258
|
+
get hourBankAccounts() {
|
|
259
|
+
if (this._hourBankAccounts == null || this._hourBankAccounts.length === 0) {
|
|
260
|
+
return [];
|
|
261
|
+
}
|
|
262
|
+
return this._hourBankAccounts.filter((account) => {
|
|
263
|
+
return date_utils_1.DateUtils.isAfterOrEquals(this._date, account.creationDate) &&
|
|
264
|
+
(account.extinctionDate === null || date_utils_1.DateUtils.isBeforeOrEquals(this._date, account.extinctionDate));
|
|
265
|
+
});
|
|
266
|
+
}
|
|
206
267
|
}
|
|
207
268
|
exports.TimeEvaluation = TimeEvaluation;
|
|
208
269
|
//# sourceMappingURL=timeEvaluation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeEvaluation.js","sourceRoot":"","sources":["../../src/data/timeEvaluation.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"timeEvaluation.js","sourceRoot":"","sources":["../../src/data/timeEvaluation.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAChD,uEAAoE;AACpE,yCAAqD;AACrD,iDAA8C;AAE9C,qDAAkD;AAGlD,yDAAqD;AAqBrD;;;GAGG;AACH,MAAa,cAAc;IAoCvB,cAAc;IACd,YAAY,MAA4B;QAPxC;;WAEG;QACK,kBAAa,GAAG,EAAE,CAAC;QAKvB,IAAI,CAAC,KAAK,GAAG,0BAAW,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;QAC3E,IAAI,CAAC,aAAa,GAAG,IAAI,2BAAY,CAAC,EAAC,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,CAAC,YAA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,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC;gBAC9D,CAAC,OAAO,CAAC,cAAc,KAAK,IAAI,IAAI,sBAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;QAC5G,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAxTD,wCAwTC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { ContextReference } from "./
|
|
1
|
+
import { ContextReference } from "./contextReference";
|
|
2
|
+
export interface TimeEvaluationSituationParams {
|
|
3
|
+
id: string;
|
|
4
|
+
situation: number;
|
|
5
|
+
numberOfHours: number;
|
|
6
|
+
contextRef: ContextReference;
|
|
7
|
+
}
|
|
2
8
|
export declare class TimeEvaluationSituation {
|
|
3
9
|
/**
|
|
4
10
|
* Identificador
|
|
@@ -14,7 +20,7 @@ export declare class TimeEvaluationSituation {
|
|
|
14
20
|
private _numberOfHours;
|
|
15
21
|
private _changed;
|
|
16
22
|
private readonly _contextRef;
|
|
17
|
-
constructor(
|
|
23
|
+
constructor(params: TimeEvaluationSituationParams);
|
|
18
24
|
/**
|
|
19
25
|
* Quantidade de horas
|
|
20
26
|
*/
|
|
@@ -29,7 +35,7 @@ export declare class TimeEvaluationSituation {
|
|
|
29
35
|
get situation(): number;
|
|
30
36
|
get changed(): boolean;
|
|
31
37
|
/**
|
|
32
|
-
* Adiciona uma quantidade de horas a
|
|
38
|
+
* Adiciona uma quantidade de horas a uma situação apurada
|
|
33
39
|
* @param numberOfHours quantidade de horas a ser adicionada
|
|
34
40
|
*/
|
|
35
41
|
addNumberOfHours(numberOfHours: number): void;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimeEvaluationSituation = void 0;
|
|
4
4
|
class TimeEvaluationSituation {
|
|
5
|
-
constructor(
|
|
6
|
-
this.id = id;
|
|
7
|
-
this._situation = situation;
|
|
8
|
-
this._numberOfHours = numberOfHours;
|
|
5
|
+
constructor(params) {
|
|
6
|
+
this.id = params.id;
|
|
7
|
+
this._situation = params.situation;
|
|
8
|
+
this._numberOfHours = params.numberOfHours;
|
|
9
9
|
this._changed = false;
|
|
10
|
-
this._contextRef = contextRef;
|
|
10
|
+
this._contextRef = params.contextRef;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Quantidade de horas
|
|
@@ -32,7 +32,7 @@ class TimeEvaluationSituation {
|
|
|
32
32
|
return this._changed;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
* Adiciona uma quantidade de horas a
|
|
35
|
+
* Adiciona uma quantidade de horas a uma situação apurada
|
|
36
36
|
* @param numberOfHours quantidade de horas a ser adicionada
|
|
37
37
|
*/
|
|
38
38
|
addNumberOfHours(numberOfHours) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeEvaluationSituation.js","sourceRoot":"","sources":["../../src/data/timeEvaluationSituation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"timeEvaluationSituation.js","sourceRoot":"","sources":["../../src/data/timeEvaluationSituation.ts"],"names":[],"mappings":";;;AASA,MAAa,uBAAuB;IAgBhC,YAAY,MAAqC;QAC7C,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAI,aAAa,CAAC,KAAa;QAC3B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IACD;;;OAGG;IACI,gBAAgB,CAAC,aAAqB;QACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,cAAc,IAAI,aAAa,CAAC;IACzC,CAAC;CACJ;AAzDD,0DAyDC"}
|
package/data/workschedule.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { SeparatedHours } from "./separatedHours";
|
|
2
|
+
export interface WorkscheduleParams {
|
|
3
|
+
code: number;
|
|
4
|
+
previousHours: {
|
|
5
|
+
dailyHours: number;
|
|
6
|
+
nightlyHours: number;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
2
9
|
export declare class Workschedule {
|
|
3
|
-
private readonly _id;
|
|
4
10
|
private readonly _code;
|
|
5
|
-
private readonly _name;
|
|
6
|
-
private readonly _workscheduleDefinitionType;
|
|
7
|
-
private readonly _clockingEvents;
|
|
8
11
|
private readonly _previousHours;
|
|
9
|
-
constructor(
|
|
10
|
-
get id(): string;
|
|
12
|
+
constructor(params: WorkscheduleParams);
|
|
11
13
|
get code(): number;
|
|
12
|
-
get name(): string;
|
|
13
|
-
get workscheduleDefinitionType(): WorkscheduleDefinitionType;
|
|
14
|
-
get clockingEvents(): WorkscheduleClockingRegister[];
|
|
15
14
|
get previousHours(): SeparatedHours;
|
|
16
15
|
}
|
|
17
16
|
export declare class WorkscheduleClockingRegister {
|
package/data/workschedule.js
CHANGED
|
@@ -1,34 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WorkscheduleDefinitionType = exports.WorkscheduleClockingRegister = exports.Workschedule = void 0;
|
|
4
|
+
const object_utils_1 = require("../utils/object.utils");
|
|
4
5
|
const separatedHours_1 = require("./separatedHours");
|
|
5
|
-
const dateUtils_1 = require("../utils/dateUtils");
|
|
6
6
|
class Workschedule {
|
|
7
|
-
constructor(
|
|
8
|
-
this.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
constructor(params) {
|
|
8
|
+
this._code = params.code;
|
|
9
|
+
if (!object_utils_1.ObjectUtils.isObjectEmpty(params.previousHours)) {
|
|
10
|
+
this._previousHours = new separatedHours_1.SeparatedHours({
|
|
11
|
+
dailyHours: params.previousHours.dailyHours,
|
|
12
|
+
nightlyHours: params.previousHours.nightlyHours,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
this._previousHours = new separatedHours_1.SeparatedHours({ dailyHours: 0, nightlyHours: 0 });
|
|
15
17
|
}
|
|
16
|
-
}
|
|
17
|
-
get id() {
|
|
18
|
-
return this._id;
|
|
19
18
|
}
|
|
20
19
|
get code() {
|
|
21
20
|
return this._code;
|
|
22
21
|
}
|
|
23
|
-
get name() {
|
|
24
|
-
return this._name;
|
|
25
|
-
}
|
|
26
|
-
get workscheduleDefinitionType() {
|
|
27
|
-
return this._workscheduleDefinitionType;
|
|
28
|
-
}
|
|
29
|
-
get clockingEvents() {
|
|
30
|
-
return this._clockingEvents;
|
|
31
|
-
}
|
|
32
22
|
get previousHours() {
|
|
33
23
|
return this._previousHours;
|
|
34
24
|
}
|
|
@@ -67,5 +57,5 @@ var WorkscheduleDefinitionType;
|
|
|
67
57
|
WorkscheduleDefinitionType["HOLIDAY"] = "HOLIDAY";
|
|
68
58
|
WorkscheduleDefinitionType["OFFSET"] = "OFFSET";
|
|
69
59
|
WorkscheduleDefinitionType["DSR"] = "DSR";
|
|
70
|
-
})(WorkscheduleDefinitionType
|
|
60
|
+
})(WorkscheduleDefinitionType || (exports.WorkscheduleDefinitionType = WorkscheduleDefinitionType = {}));
|
|
71
61
|
//# sourceMappingURL=workschedule.js.map
|
package/data/workschedule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workschedule.js","sourceRoot":"","sources":["../../src/data/workschedule.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"workschedule.js","sourceRoot":"","sources":["../../src/data/workschedule.ts"],"names":[],"mappings":";;;AAAA,wDAAoD;AACpD,qDAAkD;AAUlD,MAAa,YAAY;IAIrB,YAAY,MAA0B;QAClC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC;QAEzB,IAAI,CAAC,0BAAW,CAAC,aAAa,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;YACnD,IAAI,CAAC,cAAc,GAAG,IAAI,+BAAc,CAAC;gBACrC,UAAU,EAAE,MAAM,CAAC,aAAa,CAAC,UAAU;gBAC3C,YAAY,EAAE,MAAM,CAAC,aAAa,CAAC,YAAY;aAClD,CAAC,CAAC;QACP,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,cAAc,GAAG,IAAI,+BAAc,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC;QACjF,CAAC;IACL,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;CACJ;AAxBD,oCAwBC;AAED,MAAa,4BAA4B;IAOrC,YAAY,QAAgB,EAAE,aAAqB,EAAE,eAAuB,EAAE,cAAsB,EAAE,qBAA6B;QAC/H,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QACtC,IAAI,CAAC,sBAAsB,GAAG,qBAAqB,CAAC;IACxD,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAI,eAAe;QACf,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,IAAI,qBAAqB;QACrB,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACvC,CAAC;CACJ;AAlCD,oEAkCC;AAED,gCAAgC;AAEhC,IAAY,0BAMX;AAND,WAAY,0BAA0B;IAClC,+CAAiB,CAAA;IACjB,+CAAiB,CAAA;IACjB,iDAAmB,CAAA;IACnB,+CAAiB,CAAA;IACjB,yCAAW,CAAA;AACf,CAAC,EANW,0BAA0B,0CAA1B,0BAA0B,QAMrC"}
|
package/data/workshift.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export interface WorkshiftParams {
|
|
2
|
+
id: string;
|
|
3
|
+
code: number;
|
|
4
|
+
name: string;
|
|
5
|
+
dsrMinutes: number;
|
|
6
|
+
weekMinutes: number;
|
|
7
|
+
monthMinutes: number;
|
|
8
|
+
timeShiftType: TimeShiftType;
|
|
9
|
+
}
|
|
1
10
|
export declare class Workshift {
|
|
2
11
|
private readonly _id;
|
|
3
12
|
private readonly _code;
|
|
@@ -6,7 +15,7 @@ export declare class Workshift {
|
|
|
6
15
|
private readonly _weekMinutes;
|
|
7
16
|
private readonly _monthMinutes;
|
|
8
17
|
private readonly _timeShiftType;
|
|
9
|
-
constructor(
|
|
18
|
+
constructor(params: WorkshiftParams);
|
|
10
19
|
get id(): string;
|
|
11
20
|
get code(): number;
|
|
12
21
|
get name(): string;
|
package/data/workshift.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimeShiftType = exports.Workshift = void 0;
|
|
4
4
|
class Workshift {
|
|
5
|
-
constructor(
|
|
6
|
-
this._id = id;
|
|
7
|
-
this._code = code;
|
|
8
|
-
this._name = name;
|
|
9
|
-
this._dsrMinutes = dsrMinutes;
|
|
10
|
-
this._weekMinutes = weekMinutes;
|
|
11
|
-
this._monthMinutes = monthMinutes;
|
|
12
|
-
this._timeShiftType = timeShiftType;
|
|
5
|
+
constructor(params) {
|
|
6
|
+
this._id = params.id;
|
|
7
|
+
this._code = params.code;
|
|
8
|
+
this._name = params.name;
|
|
9
|
+
this._dsrMinutes = params.dsrMinutes;
|
|
10
|
+
this._weekMinutes = params.weekMinutes;
|
|
11
|
+
this._monthMinutes = params.monthMinutes;
|
|
12
|
+
this._timeShiftType = params.timeShiftType;
|
|
13
13
|
}
|
|
14
14
|
get id() {
|
|
15
15
|
return this._id;
|
|
@@ -44,5 +44,5 @@ var TimeShiftType;
|
|
|
44
44
|
TimeShiftType["MIXEDDAYTIME"] = "MIXEDDAYTIME";
|
|
45
45
|
TimeShiftType["MIXEDNIGHTTIME"] = "MIXEDNIGHTTIME";
|
|
46
46
|
TimeShiftType["GENERAL"] = "GENERAL";
|
|
47
|
-
})(TimeShiftType
|
|
47
|
+
})(TimeShiftType || (exports.TimeShiftType = TimeShiftType = {}));
|
|
48
48
|
//# sourceMappingURL=workshift.js.map
|
package/data/workshift.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workshift.js","sourceRoot":"","sources":["../../src/data/workshift.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"workshift.js","sourceRoot":"","sources":["../../src/data/workshift.ts"],"names":[],"mappings":";;;AAUA,MAAa,SAAS;IASlB,YAAY,MAAuB;QAC/B,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC;IAC/C,CAAC;IAED,IAAI,EAAE;QACF,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,IAAI,WAAW;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;CACJ;AA9CD,8BA8CC;AACD,mBAAmB;AAEnB,IAAY,aAQX;AARD,WAAY,aAAa;IACrB,0CAAyB,CAAA;IACzB,4CAA2B,CAAA;IAC3B,0CAAyB,CAAA;IACzB,4CAA2B,CAAA;IAC3B,8CAA6B,CAAA;IAC7B,kDAAiC,CAAA;IACjC,oCAAmB,CAAA;AACvB,CAAC,EARW,aAAa,6BAAb,aAAa,QAQxB"}
|
package/index.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
export { Context } from './data/context';
|
|
2
|
-
export { Changes,
|
|
2
|
+
export { Changes, ChangesItems, ChangesType } from './data/changes';
|
|
3
3
|
export { ClockingEvent, ClockingEventOriginType } from './data/clockingEvent';
|
|
4
4
|
export { CollectiveNegotiation } from './data/collectiveNegotiation';
|
|
5
5
|
export { Contract, ContractType } from './data/contract';
|
|
6
|
-
export { DateUtils, WeekDay } from './utils/
|
|
7
|
-
export { ObjectUtils } from './utils/
|
|
6
|
+
export { DateUtils, WeekDay } from './utils/date.utils';
|
|
7
|
+
export { ObjectUtils } from './utils/object.utils';
|
|
8
8
|
export { Employee } from './data/employee';
|
|
9
|
-
export {
|
|
9
|
+
export { Employer } from './data/employer';
|
|
10
10
|
export { EmploymentRelationship } from './data/employmentRelationship';
|
|
11
11
|
export { Log, LogType } from './data/log';
|
|
12
12
|
export { Histories } from './data/histories';
|
|
13
13
|
export { Holiday, Holidays } from './data/holidays';
|
|
14
14
|
export { Interval, IntervalSubTypes, IntervalTypes, PositionWorkHours } from './data/interval';
|
|
15
15
|
export { Person } from './data/person';
|
|
16
|
-
export { Dataset as RuleParams } from './data/
|
|
17
|
-
export { Schedules } from './data/schedules';
|
|
16
|
+
export { Dataset as RuleParams } from './data/dataset';
|
|
17
|
+
export { Schedules } from './data/schedules/schedules';
|
|
18
|
+
export { Bridge } from './data/schedules/bridge';
|
|
18
19
|
export { SeparatedHours } from './data/separatedHours';
|
|
19
20
|
export { Situation, SituationType } from './data/situation';
|
|
20
21
|
export { Syndicate } from './data/syndicate';
|