@seniorsistemas/hcm-clocking-event-rule-nodejs 0.35.0
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/.github/copilot-instructions.md +11 -0
- package/.github/workflows/release.yaml +10 -0
- package/.gitlab-ci.yml +68 -0
- package/CHANGELOG.md +274 -0
- package/README.doc.md +658 -0
- package/README.md +117 -0
- package/assets/favicon.ico +0 -0
- package/catalog-info.yaml +19 -0
- package/jest.config.js +17 -0
- package/package.json +48 -0
- package/prompt.md +15 -0
- package/run_build_win.bat +1 -0
- package/run_link.bat +3 -0
- package/run_test.bat +1 -0
- package/sonar-project.properties +21 -0
- package/src/data/changes/changes.ts +92 -0
- package/src/data/context/context.ts +251 -0
- package/src/data/context/contextReference.ts +376 -0
- package/src/data/contract/contract.ts +272 -0
- package/src/data/dataset/database.ts +130 -0
- package/src/data/dataset/dataset.ts +275 -0
- package/src/data/definition/timeEvaluationSituationDefinitionHistory.ts +1425 -0
- package/src/data/employee/employee.ts +434 -0
- package/src/data/foundation/companyBranch.ts +66 -0
- package/src/data/foundation/costCenter.ts +47 -0
- package/src/data/foundation/employer.ts +35 -0
- package/src/data/foundation/employmentRelationship.ts +63 -0
- package/src/data/foundation/holiday.ts +84 -0
- package/src/data/foundation/holidayGroup.ts +47 -0
- package/src/data/foundation/jobPosition.ts +73 -0
- package/src/data/foundation/person.ts +35 -0
- package/src/data/foundation/situation.ts +301 -0
- package/src/data/foundation/syndicate.ts +244 -0
- package/src/data/foundation/workschedule.ts +688 -0
- package/src/data/foundation/workshift.ts +647 -0
- package/src/data/foundation/workshiftBase.ts +113 -0
- package/src/data/histories/companyBranchHistory.ts +128 -0
- package/src/data/histories/costCenterHistory.ts +114 -0
- package/src/data/histories/employmentRelationshipHistory.ts +116 -0
- package/src/data/histories/histories.ts +419 -0
- package/src/data/histories/jobPositionHistory.ts +117 -0
- package/src/data/histories/leaveHistory.ts +227 -0
- package/src/data/histories/timeEvaluationHistory.ts +191 -0
- package/src/data/histories/workshiftHistory.ts +66 -0
- package/src/data/hourBank/hourBank.ts +43 -0
- package/src/data/hourBank/hourBankAccount.ts +77 -0
- package/src/data/log/log.ts +38 -0
- package/src/data/schedules/bridge.ts +84 -0
- package/src/data/schedules/compensation.ts +332 -0
- package/src/data/schedules/overtimeAuthorization.ts +174 -0
- package/src/data/schedules/readiness.ts +150 -0
- package/src/data/schedules/schedules.ts +398 -0
- package/src/data/schedules/workscheduleChange.ts +91 -0
- package/src/data/schedules/workshiftChange.ts +76 -0
- package/src/data/timeEvaluation/adjustmentReason.ts +46 -0
- package/src/data/timeEvaluation/clockingEvent.ts +198 -0
- package/src/data/timeEvaluation/estimatedHours.ts +245 -0
- package/src/data/timeEvaluation/interval.ts +568 -0
- package/src/data/timeEvaluation/separatedHours.ts +134 -0
- package/src/data/timeEvaluation/timeEvaluation.ts +1540 -0
- package/src/data/timeEvaluation/timeEvaluationSituation.ts +154 -0
- package/src/data/user/user.ts +44 -0
- package/src/index.ts +60 -0
- package/src/test/builder/bridgeBuilder.builder.ts +28 -0
- package/src/test/builder/clockingEvent.builder.ts +49 -0
- package/src/test/builder/companyBranchHistoryBuilder.ts +29 -0
- package/src/test/builder/compensation.builder.ts +84 -0
- package/src/test/builder/contextReference.builder.ts +69 -0
- package/src/test/builder/costCenterHistoryBuilder.ts +29 -0
- package/src/test/builder/database.builder.ts +21 -0
- package/src/test/builder/datasetBuilder.ts +111 -0
- package/src/test/builder/dateIntervalBuilder.ts +25 -0
- package/src/test/builder/employee.builder.ts +91 -0
- package/src/test/builder/employmentRelationshipBuilder.ts +35 -0
- package/src/test/builder/employmentRelationshipHistoryBuilder.ts +29 -0
- package/src/test/builder/historiesBuilder.ts +56 -0
- package/src/test/builder/holiday.builder.ts +44 -0
- package/src/test/builder/hourBankAccountBuilder.ts +77 -0
- package/src/test/builder/hourBankBuilder.ts +32 -0
- package/src/test/builder/interval.builder.ts +113 -0
- package/src/test/builder/jobPositionHistoryBuilder.ts +29 -0
- package/src/test/builder/overtimeAuthorization.builder.ts +42 -0
- package/src/test/builder/readinessBuilder.builder.ts +57 -0
- package/src/test/builder/schedules.builder.ts +126 -0
- package/src/test/builder/situation.builder.ts +59 -0
- package/src/test/builder/syndicate.builder.ts +96 -0
- package/src/test/builder/syndicateHistoryBuilder.ts +33 -0
- package/src/test/builder/timeEvaluation.builder.ts +138 -0
- package/src/test/builder/timeEvaluationHistory.builder.ts +49 -0
- package/src/test/builder/timeEvaluationSituation.builder.ts +34 -0
- package/src/test/builder/workschedule.builder.ts +96 -0
- package/src/test/builder/workshift.builder.ts +179 -0
- package/src/test/builder/workshiftBuilder.ts +55 -0
- package/src/test/data/clockingEvent.spec.ts +56 -0
- package/src/test/data/context.spec.ts +176 -0
- package/src/test/data/currentUser.spec.ts +11 -0
- package/src/test/data/dataset.spec.ts +144 -0
- package/src/test/data/employee/employee.spec.ts +20 -0
- package/src/test/data/employmentRelationship/employmentRelationship.spec.ts +48 -0
- package/src/test/data/estimatedHours/estimatedHours.spec.ts +96 -0
- package/src/test/data/histories/costCenterHistory.spec.ts +32 -0
- package/src/test/data/histories/histories.spec.ts +306 -0
- package/src/test/data/holyday.spec.ts +89 -0
- package/src/test/data/hourBank/hourBank.spec.ts +48 -0
- package/src/test/data/hourBank/hourBankAccount.spec.ts +32 -0
- package/src/test/data/schedules/bridge.spec.ts +13 -0
- package/src/test/data/schedules/compesation.spect.ts +89 -0
- package/src/test/data/schedules/overtimeAuthorization.spec.ts +52 -0
- package/src/test/data/schedules/readiness.spec.ts +64 -0
- package/src/test/data/schedules/schedules.spec.ts +134 -0
- package/src/test/data/schedules/workscheduleChange.spec.ts +21 -0
- package/src/test/data/syndicate/syndicate.spec.ts +51 -0
- package/src/test/data/timeEvaluation.spec.ts +1057 -0
- package/src/test/data/timeEvaluationDefinition.spec.ts +144 -0
- package/src/test/data/workschedule/workschedule.spec.ts +194 -0
- package/src/test/data/workshift/workshift.spec.ts +79 -0
- package/src/test/utils/date.utils.spec.ts +198 -0
- package/src/test/utils/dateIntervalUtils.spec.ts +210 -0
- package/src/test/utils/object.utils.spec.ts +83 -0
- package/src/utils/dateIntervalUtils.ts +284 -0
- package/src/utils/dateUtils.ts +456 -0
- package/src/utils/decompressGzipLambda.ts +15 -0
- package/src/utils/object.utils.ts +156 -0
- package/trivy/vulnerabilities_scan.json +1160 -0
- package/tsconfig.json +32 -0
- package/tsconfig.spec.json +21 -0
- package/tslint.json +92 -0
- package/typedoc.json +22 -0
|
@@ -0,0 +1,688 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
* Interface para os parâmetros do construtor do Workschedule.
|
|
4
|
+
*/
|
|
5
|
+
export interface WorkscheduleParams {
|
|
6
|
+
/**
|
|
7
|
+
* Identificador do horário.
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Código do horário.
|
|
13
|
+
*/
|
|
14
|
+
code: number;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Carga horária do horário.
|
|
18
|
+
*/
|
|
19
|
+
workload: number;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Tipo do horário.
|
|
23
|
+
*/
|
|
24
|
+
type: WorkscheduleType;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Tipo de definição do horário.
|
|
28
|
+
*/
|
|
29
|
+
definitionType: WorkscheduleDefinitionType;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Lista de marcações do horário.
|
|
33
|
+
*/
|
|
34
|
+
clockingRegisters: WorkscheduleClockingRegister[];
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Definição da aba ponto no cadastro do horário.
|
|
38
|
+
*/
|
|
39
|
+
clockingEvent: WorkscheduleClockingEvent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @hidden
|
|
44
|
+
* Interface para os parâmetros do construtor das marcações do horário.
|
|
45
|
+
*/
|
|
46
|
+
export interface WorkscheduleClockingRegisterParams {
|
|
47
|
+
/**
|
|
48
|
+
* Sequência do registro de marcação.
|
|
49
|
+
*/
|
|
50
|
+
sequence: number;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Hora da marcação.
|
|
54
|
+
*/
|
|
55
|
+
clockingEvent: number;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Tolerância antes da marcação.
|
|
59
|
+
*/
|
|
60
|
+
toleranceBefore: number;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Tolerância após a marcação.
|
|
64
|
+
*/
|
|
65
|
+
toleranceAfter: number;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Mobilidade antes da marcação.
|
|
69
|
+
*/
|
|
70
|
+
mobilityBefore: number;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Mobilidade após a marcação.
|
|
74
|
+
*/
|
|
75
|
+
mobilityAfter: number;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Tipo de intervalo se existir.
|
|
79
|
+
*/
|
|
80
|
+
intervalType: IntervalType | null;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Tipo da marcação.
|
|
84
|
+
*/
|
|
85
|
+
clockingEventScheduleType: ClockingEventScheduleType;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Tipo de uso da marcação.
|
|
89
|
+
*/
|
|
90
|
+
usingType: UsingType;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @hidden
|
|
95
|
+
* Interface para os parâmetros do construtor da aba ponto no cadastro do horário.
|
|
96
|
+
*/
|
|
97
|
+
export interface WorkscheduleClockingEventParams {
|
|
98
|
+
/**
|
|
99
|
+
* Tolerância de horas extras no início e fim do expediente.
|
|
100
|
+
*/
|
|
101
|
+
workStartEndOvertimeTolerance: number;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Tolerância de horas extras para refeições.
|
|
105
|
+
*/
|
|
106
|
+
mealOvertimeTolerance: number;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Tolerância total diária de horas extras.
|
|
110
|
+
*/
|
|
111
|
+
overtimeDailyTotalTolerance: number;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Tolerância total diária de ausências.
|
|
115
|
+
*/
|
|
116
|
+
absenceDailyTotalTolerance: number;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Tolerância de ausência no início e fim do expediente.
|
|
120
|
+
*/
|
|
121
|
+
workStartEndAbsenceTolerance: number;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Tolerância de ausência para refeições.
|
|
125
|
+
*/
|
|
126
|
+
mealAbsenceTolerance: number;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Representa um horário.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```typescript
|
|
134
|
+
* workschedule.code; // Retorna o código do horário.
|
|
135
|
+
* workschedule.type; // Retorna o tipo do horário.
|
|
136
|
+
* workschedule.workload; // Retorna a carga horária do horário.
|
|
137
|
+
* workschedule.clockingRegisters; // Retorna a lista de marcações do horário.
|
|
138
|
+
* workschedule.clockingEvent; // Retorna as definições da aba ponto do horário.
|
|
139
|
+
* ```
|
|
140
|
+
* @see {@link WorkscheduleType}
|
|
141
|
+
* @see {@link WorkscheduleDefinitionType}
|
|
142
|
+
* @see {@link WorkscheduleClockingRegister}
|
|
143
|
+
* @see {@link WorkscheduleClockingEvent}
|
|
144
|
+
* @see {@link IntervalType}
|
|
145
|
+
* @see {@link ClockingEventScheduleType}
|
|
146
|
+
* @see {@link UsingType}
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
149
|
+
export class Workschedule {
|
|
150
|
+
private readonly _id: string;
|
|
151
|
+
private readonly _code: number;
|
|
152
|
+
private readonly _type: WorkscheduleType;
|
|
153
|
+
private readonly _definitionType: WorkscheduleDefinitionType;
|
|
154
|
+
private readonly _workload: number;
|
|
155
|
+
private readonly _clockingRegisters: WorkscheduleClockingRegister[];
|
|
156
|
+
private readonly _clockingEvent: WorkscheduleClockingEvent;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @hidden
|
|
160
|
+
* Construtor da classe Workschedule.
|
|
161
|
+
* @param params Parâmetros para inicializar o Workschedule.
|
|
162
|
+
*/
|
|
163
|
+
constructor(params: WorkscheduleParams) {
|
|
164
|
+
this._id = params.id;
|
|
165
|
+
this._code = params.code;
|
|
166
|
+
this._type = params.type;
|
|
167
|
+
this._definitionType = params.definitionType;
|
|
168
|
+
this._workload = params.workload;
|
|
169
|
+
this._clockingRegisters = params.clockingRegisters || [];
|
|
170
|
+
this._clockingEvent = params.clockingEvent;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @hidden
|
|
176
|
+
* Retorna o ID do horário.
|
|
177
|
+
*/
|
|
178
|
+
get id(): string {
|
|
179
|
+
return this._id;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Retorna o código do horário.
|
|
184
|
+
* @example
|
|
185
|
+
* ```typescript
|
|
186
|
+
* workschedule.code; // Retorna o código do horário.
|
|
187
|
+
* ```
|
|
188
|
+
* @returns Código do horário.
|
|
189
|
+
*/
|
|
190
|
+
get code(): number {
|
|
191
|
+
return this._code;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Retorna o tipo do do horário.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```typescript
|
|
199
|
+
* workschedule.type; // Retorna o tipo do horário.
|
|
200
|
+
* ```
|
|
201
|
+
* @returns Tipo do horário.
|
|
202
|
+
*/
|
|
203
|
+
get type(): WorkscheduleType {
|
|
204
|
+
return this._type;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Retorna o tipo de definição do horário.
|
|
209
|
+
* @example
|
|
210
|
+
* ```typescript
|
|
211
|
+
* const def = workschedule.definitionType; // Retorna o tipo de definição do horário.
|
|
212
|
+
* ```
|
|
213
|
+
* @returns Tipo de definição do horário.
|
|
214
|
+
*/
|
|
215
|
+
get definitionType(): WorkscheduleDefinitionType {
|
|
216
|
+
return this._definitionType;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Retorna a carga horária do horário.
|
|
221
|
+
* @example
|
|
222
|
+
* ```typescript
|
|
223
|
+
* workschedule.workload; // Retorna a carga horária do horário.
|
|
224
|
+
* ```
|
|
225
|
+
* @returns Carga horária do horário.
|
|
226
|
+
*/
|
|
227
|
+
get workload(): number {
|
|
228
|
+
return this._workload;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Retorna a lista de marcações do horário.
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* ```typescript
|
|
236
|
+
* const registers = workschedule.clockingRegisters; // Retorna a lista de marcações do horário.
|
|
237
|
+
* registers.forEach(register => {
|
|
238
|
+
* console.log(register.clockingEvent); // Exibe o evento de marcação de cada registro.
|
|
239
|
+
* });
|
|
240
|
+
* ```
|
|
241
|
+
* @return Lista de marcações do horário.
|
|
242
|
+
* @see {@link WorkscheduleClockingRegister}
|
|
243
|
+
*/
|
|
244
|
+
get clockingRegisters(): WorkscheduleClockingRegister[] {
|
|
245
|
+
return this._clockingRegisters;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Retorna as definições da aba ponto do horário.
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```typescript
|
|
253
|
+
* const clockingEvent = workschedule.clockingEvent; // Retorna as definiçõesda aba ponto do horário.
|
|
254
|
+
* console.log(clockingEvent.workStartEndOvertimeTolerance); // Exibe a tolerância de horas extras no início e fim do expediente.
|
|
255
|
+
* ```
|
|
256
|
+
* @return Definições da aba ponto do horário.
|
|
257
|
+
* @see {@link WorkscheduleClockingEvent}
|
|
258
|
+
*/
|
|
259
|
+
get clockingEvent(): WorkscheduleClockingEvent {
|
|
260
|
+
return this._clockingEvent;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Retorna a quantidade de registros de marcação do horário.
|
|
265
|
+
* @example
|
|
266
|
+
* ```typescript
|
|
267
|
+
* const count = workschedule.clockingRegistersCount; // Retorna a quantidade de registros de marcação do horário.
|
|
268
|
+
* console.log(`Total de registros de marcação: ${count}`);
|
|
269
|
+
* ```
|
|
270
|
+
* @returns Quantidade de registros de marcação do horário.
|
|
271
|
+
*/
|
|
272
|
+
get clockingRegistersCount(): number {
|
|
273
|
+
return this._clockingRegisters.length;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Representa um registro de marcação do horário.
|
|
279
|
+
*/
|
|
280
|
+
export class WorkscheduleClockingRegister {
|
|
281
|
+
private readonly _sequence: number;
|
|
282
|
+
private readonly _clockingEvent: number;
|
|
283
|
+
private readonly _toleranceBefore: number;
|
|
284
|
+
private readonly _toleranceAfter: number;
|
|
285
|
+
private readonly _mobilityBefore: number;
|
|
286
|
+
private readonly _mobilityAfter: number;
|
|
287
|
+
private readonly _intervalType: IntervalType | null;
|
|
288
|
+
private readonly _clockingEventScheduleType: ClockingEventScheduleType;
|
|
289
|
+
private readonly _usingType: UsingType;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @hidden
|
|
293
|
+
* Construtor da classe WorkscheduleClockingRegister.
|
|
294
|
+
* @param params Parâmetros para inicializar o WorkscheduleClockingRegister.
|
|
295
|
+
*/
|
|
296
|
+
constructor(params: WorkscheduleClockingRegisterParams) {
|
|
297
|
+
this._sequence = params.sequence;
|
|
298
|
+
this._clockingEvent = params.clockingEvent;
|
|
299
|
+
this._toleranceBefore = params.toleranceBefore;
|
|
300
|
+
this._toleranceAfter = params.toleranceAfter;
|
|
301
|
+
this._mobilityBefore = params.mobilityBefore;
|
|
302
|
+
this._mobilityAfter = params.mobilityAfter;
|
|
303
|
+
this._intervalType = params.intervalType ?? null;
|
|
304
|
+
this._clockingEventScheduleType = params.clockingEventScheduleType;
|
|
305
|
+
this._usingType = params.usingType;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Retorna a sequência do registro de marcação.
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* ```typescript
|
|
313
|
+
* const sequence = clockingRegister.sequence; // Retorna a sequência do registro de marcação.
|
|
314
|
+
* console.log(`Sequência: ${sequence}`);
|
|
315
|
+
* ```
|
|
316
|
+
* @returns Sequência do registro de marcação.
|
|
317
|
+
*
|
|
318
|
+
*/
|
|
319
|
+
get sequence(): number {
|
|
320
|
+
return this._sequence;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Retorna a marcação.
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* ```typescript
|
|
328
|
+
* const clockingEvent = clockingRegister.clockingEvent; // Retorna a marcação em minutos
|
|
329
|
+
* console.log(`Marcação: ${clockingEvent} minutos`);
|
|
330
|
+
* ```
|
|
331
|
+
* @returns Marcação em minutos.
|
|
332
|
+
*/
|
|
333
|
+
get clockingEvent(): number {
|
|
334
|
+
return this._clockingEvent;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Retorna a tolerância antes do horário de marcação.
|
|
339
|
+
*
|
|
340
|
+
* @example
|
|
341
|
+
* ```typescript
|
|
342
|
+
* const toleranceBefore = clockingRegister.toleranceBefore; // Retorna a tolerância antes do horário de marcação em minutos.
|
|
343
|
+
* console.log(`Tolerância antes: ${toleranceBefore} minutos`);
|
|
344
|
+
* ```
|
|
345
|
+
* @return Tolerância antes do horário de marcação em minutos.
|
|
346
|
+
*/
|
|
347
|
+
get toleranceBefore(): number {
|
|
348
|
+
return this._toleranceBefore;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Retorna a tolerância após o horário de marcação.
|
|
353
|
+
*
|
|
354
|
+
* @example
|
|
355
|
+
* ```typescript
|
|
356
|
+
* const toleranceAfter = clockingRegister.toleranceAfter; // Retorna a tolerância após o horário de marcação em minutos.
|
|
357
|
+
* console.log(`Tolerância após: ${toleranceAfter} minutos`);
|
|
358
|
+
* ```
|
|
359
|
+
* @return Tolerância após o horário de marcação em minutos.
|
|
360
|
+
*/
|
|
361
|
+
get toleranceAfter(): number {
|
|
362
|
+
return this._toleranceAfter;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Retorna a mobilidade antes do horário de marcação.
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* ```typescript
|
|
370
|
+
* const mobilityBefore = clockingRegister.mobilityBefore; // Retorna a mobilidade antes do horário de marcação em minutos.
|
|
371
|
+
* console.log(`Mobilidade antes: ${mobilityBefore} minutos`);
|
|
372
|
+
* ```
|
|
373
|
+
* @return Mobilidade antes do horário de marcação em minutos.
|
|
374
|
+
*/
|
|
375
|
+
get mobilityBefore(): number {
|
|
376
|
+
return this._mobilityBefore;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Retorna a mobilidade após o horário de marcação.
|
|
381
|
+
* @example
|
|
382
|
+
* ```typescript
|
|
383
|
+
* const mobilityAfter = clockingRegister.mobilityAfter; // Retorna a mobilidade após o horário de marcação em minutos.
|
|
384
|
+
* console.log(`Mobilidade após: ${mobilityAfter} minutos`);
|
|
385
|
+
* ```
|
|
386
|
+
* @return Mobilidade após o horário de marcação em minutos.
|
|
387
|
+
*/
|
|
388
|
+
get mobilityAfter(): number {
|
|
389
|
+
return this._mobilityAfter;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Retorna o tipo de intervalo.
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* ```typescript
|
|
397
|
+
* const intervalType = clockingRegister.intervalType; // Retorna o tipo de intervalo.
|
|
398
|
+
* console.log(`Tipo de intervalo: ${intervalType}`);
|
|
399
|
+
* ```
|
|
400
|
+
* @returns Tipo de intervalo ou null se não existir.
|
|
401
|
+
*
|
|
402
|
+
*/
|
|
403
|
+
get intervalType(): IntervalType | null {
|
|
404
|
+
return this._intervalType;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Retorna o tipo de evento de marcação.
|
|
409
|
+
* @example
|
|
410
|
+
* ```typescript
|
|
411
|
+
* const clockingEventType = clockingRegister.clockingEventScheduleType; // Retorna o tipo de evento de marcação.
|
|
412
|
+
* console.log(`Tipo de evento de marcação: ${clockingEventType}`);
|
|
413
|
+
* ```
|
|
414
|
+
* @return Tipo de evento de marcação.
|
|
415
|
+
* @see {@link ClockingEventScheduleType}
|
|
416
|
+
*/
|
|
417
|
+
get clockingEventScheduleType(): ClockingEventScheduleType {
|
|
418
|
+
return this._clockingEventScheduleType;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Retorna o tipo de uso.
|
|
423
|
+
*
|
|
424
|
+
* @example
|
|
425
|
+
* ```typescript
|
|
426
|
+
* const usingType = clockingRegister.usingType; // Retorna o tipo de uso.
|
|
427
|
+
* console.log(`Tipo de uso: ${usingType}`);
|
|
428
|
+
* ```
|
|
429
|
+
* @returns Tipo de uso.
|
|
430
|
+
*/
|
|
431
|
+
get usingType(): UsingType {
|
|
432
|
+
return this._usingType;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Representa um evento da aba ponto no cadastro do horário.
|
|
438
|
+
*/
|
|
439
|
+
export class WorkscheduleClockingEvent {
|
|
440
|
+
private readonly _workStartEndOvertimeTolerance: number;
|
|
441
|
+
private readonly _mealOvertimeTolerance: number;
|
|
442
|
+
private readonly _overtimeDailyTotalTolerance: number;
|
|
443
|
+
private readonly _absenceDailyTotalTolerance: number;
|
|
444
|
+
private readonly _workStartEndAbsenceTolerance: number;
|
|
445
|
+
private readonly _mealAbsenceTolerance: number;
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* @hidden
|
|
449
|
+
* Construtor da classe WorkscheduleClockingEvent.
|
|
450
|
+
* @param params Parâmetros para inicializar a WorkscheduleClockingEvent.
|
|
451
|
+
*/
|
|
452
|
+
constructor(params: WorkscheduleClockingEventParams) {
|
|
453
|
+
this._workStartEndOvertimeTolerance = params.workStartEndOvertimeTolerance;
|
|
454
|
+
this._mealOvertimeTolerance = params.mealOvertimeTolerance;
|
|
455
|
+
this._overtimeDailyTotalTolerance = params.overtimeDailyTotalTolerance;
|
|
456
|
+
this._absenceDailyTotalTolerance = params.absenceDailyTotalTolerance;
|
|
457
|
+
this._workStartEndAbsenceTolerance = params.workStartEndAbsenceTolerance;
|
|
458
|
+
this._mealAbsenceTolerance = params.mealAbsenceTolerance;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Retorna a tolerância de horas extras no início e fim do expediente.
|
|
463
|
+
* @example
|
|
464
|
+
* ```typescript
|
|
465
|
+
* const overtimeTolerance = workschedule.clockingEvent.workStartEndOvertimeTolerance; // Retorna a tolerância de horas extras no início e fim do expediente em minutos.
|
|
466
|
+
* console.log(`Tolerância de horas extras no início e fim do expediente: ${overtimeTolerance} minutos`);
|
|
467
|
+
* ```
|
|
468
|
+
* @return Tolerância de horas extras no início e fim do expediente em minutos.
|
|
469
|
+
*/
|
|
470
|
+
get workStartEndOvertimeTolerance(): number {
|
|
471
|
+
return this._workStartEndOvertimeTolerance;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Retorna a tolerância de horas extras para refeições.
|
|
476
|
+
* @example
|
|
477
|
+
* ```typescript
|
|
478
|
+
* const mealOvertimeTolerance = workschedule.clockingEvent.mealOvertimeTolerance; // Retorna a tolerância de horas extras para refeições em minutos.
|
|
479
|
+
* console.log(`Tolerância de horas extras para refeições: ${mealOvertimeTolerance } minutos`);
|
|
480
|
+
* ```
|
|
481
|
+
* @return Tolerância de horas extras para refeições em minutos.
|
|
482
|
+
*/
|
|
483
|
+
get mealOvertimeTolerance(): number {
|
|
484
|
+
return this._mealOvertimeTolerance;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Retorna a tolerância total diária de horas extras.
|
|
489
|
+
* @example
|
|
490
|
+
* ```typescript
|
|
491
|
+
* const overtimeDailyTotalTolerance = workschedule.clockingEvent.overtimeDailyTotalTolerance; // Retorna a tolerância total diária de horas extras em minutos.
|
|
492
|
+
* console.log(`Tolerância total diária de horas extras: ${overtimeDailyTotalTolerance} minutos`);
|
|
493
|
+
* ```
|
|
494
|
+
* @return Tolerância total diária de horas extras em minutos.
|
|
495
|
+
*/
|
|
496
|
+
get overtimeDailyTotalTolerance(): number {
|
|
497
|
+
return this._overtimeDailyTotalTolerance;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Retorna a tolerância total diária de ausências.
|
|
502
|
+
*
|
|
503
|
+
* @example
|
|
504
|
+
* ```typescript
|
|
505
|
+
* const absenceDailyTotalTolerance = workschedule.clockingEvent.absenceDailyTotalTolerance; // Retorna a tolerância total diária de ausências em minutos.
|
|
506
|
+
* console.log(`Tolerância total diária de ausências: ${absenceDailyTotalTolerance} minutos`);
|
|
507
|
+
* ```
|
|
508
|
+
* @return Tolerância total diária de ausências em minutos.
|
|
509
|
+
*/
|
|
510
|
+
get absenceDailyTotalTolerance(): number {
|
|
511
|
+
return this._absenceDailyTotalTolerance;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Retorna a tolerância de ausência no início e fim do expediente.
|
|
516
|
+
*
|
|
517
|
+
* @example
|
|
518
|
+
* ```typescript
|
|
519
|
+
* const workStartEndAbsenceTolerance = workschedule.clockingEvent.workStartEndAbsenceTolerance; // Retorna a tolerância de ausência no início e fim do expediente em minutos.
|
|
520
|
+
* console.log(`Tolerância de ausência no início e fim do expediente: ${workStartEndAbsenceTolerance} minutos`);
|
|
521
|
+
* ```
|
|
522
|
+
* @return Tolerância de ausência no início e fim do expediente em minutos.
|
|
523
|
+
*/
|
|
524
|
+
get workStartEndAbsenceTolerance(): number {
|
|
525
|
+
return this._workStartEndAbsenceTolerance;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Retorna a tolerância de ausência para refeições.
|
|
530
|
+
*
|
|
531
|
+
* @example
|
|
532
|
+
* ```typescript
|
|
533
|
+
* const mealAbsenceTolerance = workschedule.clockingEvent.mealAbsenceTolerance; // Retorna a tolerância de ausência para refeições em minutos.
|
|
534
|
+
* console.log(`Tolerância de ausência para refeições: ${mealAbsenceTolerance} minutos`);
|
|
535
|
+
* ```
|
|
536
|
+
* @return Tolerância de ausência para refeições em minutos.
|
|
537
|
+
*/
|
|
538
|
+
get mealAbsenceTolerance(): number {
|
|
539
|
+
return this._mealAbsenceTolerance;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Enumeração para os tipos de definição do horário.
|
|
545
|
+
* @enum
|
|
546
|
+
*/
|
|
547
|
+
export enum WorkscheduleDefinitionType {
|
|
548
|
+
/**
|
|
549
|
+
* Normal.
|
|
550
|
+
*/
|
|
551
|
+
NORMAL = "NORMAL",
|
|
552
|
+
/**
|
|
553
|
+
* Folga.
|
|
554
|
+
*/
|
|
555
|
+
DAYOFF = "DAYOFF",
|
|
556
|
+
/**
|
|
557
|
+
* Feriado.
|
|
558
|
+
*/
|
|
559
|
+
HOLIDAY = "HOLIDAY",
|
|
560
|
+
/**
|
|
561
|
+
* Compensação.
|
|
562
|
+
*/
|
|
563
|
+
OFFSET = "OFFSET",
|
|
564
|
+
/**
|
|
565
|
+
* Descanso semanal remunerado.
|
|
566
|
+
*/
|
|
567
|
+
DSR = "DSR"
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Enumeração para os tipos de horário.
|
|
572
|
+
* @enum
|
|
573
|
+
*/
|
|
574
|
+
export enum WorkscheduleType {
|
|
575
|
+
/**
|
|
576
|
+
* Horário rígido.
|
|
577
|
+
*/
|
|
578
|
+
RIGID = "RIGID",
|
|
579
|
+
/**
|
|
580
|
+
* Horário móvel.
|
|
581
|
+
*/
|
|
582
|
+
MOBILE = "MOBILE",
|
|
583
|
+
/**
|
|
584
|
+
* Horário flexível.
|
|
585
|
+
*/
|
|
586
|
+
FLEXIBLE = "FLEXIBLE",
|
|
587
|
+
/**
|
|
588
|
+
* Horário móvel na entrada e saída.
|
|
589
|
+
*/
|
|
590
|
+
MOBILE_ENTRANCE_EXIT = "MOBILE_ENTRANCE_EXIT",
|
|
591
|
+
/**
|
|
592
|
+
* Horário móvel na refeição.
|
|
593
|
+
*/
|
|
594
|
+
MOBILE_MEAL = "MOBILE_MEAL",
|
|
595
|
+
/**
|
|
596
|
+
* Horário flexível nos intervalos.
|
|
597
|
+
*/
|
|
598
|
+
FLEXIBLE_AT_INTERVALS = "FLEXIBLE_AT_INTERVALS"
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Enumeração para os tipos de uso.
|
|
603
|
+
* @enum
|
|
604
|
+
*/
|
|
605
|
+
export enum UsingType {
|
|
606
|
+
/**
|
|
607
|
+
* Entrada e saída obrigatórias.
|
|
608
|
+
*/
|
|
609
|
+
MANDATORY_ENTRY_OR_EXIT = "MANDATORY_ENTRY_OR_EXIT",
|
|
610
|
+
/**
|
|
611
|
+
* Entrada e saída não obrigatórias.
|
|
612
|
+
*/
|
|
613
|
+
NON_MANDATORY_ENTRY_OR_EXIT = "NON_MANDATORY_ENTRY_OR_EXIT",
|
|
614
|
+
/**
|
|
615
|
+
* Entrada e saída geradas.
|
|
616
|
+
*/
|
|
617
|
+
GENERATED_ENTRY_OR_EXIT = "GENERATED_ENTRY_OR_EXIT",
|
|
618
|
+
/**
|
|
619
|
+
* Refeição obrigatória.
|
|
620
|
+
*/
|
|
621
|
+
MANDATORY_MEAL = "MANDATORY_MEAL",
|
|
622
|
+
/**
|
|
623
|
+
* Refeição não obrigatória.
|
|
624
|
+
*/
|
|
625
|
+
NON_MANDATORY_PRE_ASSIGNED_MEAL = "NON_MANDATORY_PRE_ASSIGNED_MEAL",
|
|
626
|
+
/**
|
|
627
|
+
* Refeição obrigatória extra.
|
|
628
|
+
*/
|
|
629
|
+
MANDATORY_EXTRA_MEAL = "MANDATORY_EXTRA_MEAL",
|
|
630
|
+
/**
|
|
631
|
+
* Refeição gerada.
|
|
632
|
+
*/
|
|
633
|
+
GENERATED_PRE_ASSIGNED_MEAL = "GENERATED_PRE_ASSIGNED_MEAL",
|
|
634
|
+
/**
|
|
635
|
+
* Lanche obrigatório.
|
|
636
|
+
*/
|
|
637
|
+
MANDATORY_SNACK = "MANDATORY_SNACK",
|
|
638
|
+
/**
|
|
639
|
+
* Lanche não obrigatório.
|
|
640
|
+
*/
|
|
641
|
+
NON_MANDATORY_SNACK = "NON_MANDATORY_SNACK",
|
|
642
|
+
/**
|
|
643
|
+
* Lanche obrigatório extra.
|
|
644
|
+
*/
|
|
645
|
+
EXTRA_MANDATORY_SNACK = "EXTRA_MANDATORY_SNACK",
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Enumeração para os tipos de intervalos de cálculo de marcações do horário.
|
|
650
|
+
* @enum
|
|
651
|
+
*/
|
|
652
|
+
export enum IntervalType {
|
|
653
|
+
/**
|
|
654
|
+
* Intervalo rígido.
|
|
655
|
+
*/
|
|
656
|
+
RIGID = "RIGID",
|
|
657
|
+
/**
|
|
658
|
+
* Intervalo móvel.
|
|
659
|
+
*/
|
|
660
|
+
MOBILE = "MOBILE",
|
|
661
|
+
/**
|
|
662
|
+
* Intervalo flexível.
|
|
663
|
+
*/
|
|
664
|
+
FLEXIBLE = "FLEXIBLE",
|
|
665
|
+
/**
|
|
666
|
+
* Intervalo núcleo.
|
|
667
|
+
*/
|
|
668
|
+
CORE = "CORE",
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* Enumeração para os tipos de evento de marcação.
|
|
673
|
+
* @enum
|
|
674
|
+
*/
|
|
675
|
+
export enum ClockingEventScheduleType {
|
|
676
|
+
/**
|
|
677
|
+
* Evento de marcação obrigatório.
|
|
678
|
+
*/
|
|
679
|
+
MANDATORY = "MANDATORY",
|
|
680
|
+
/**
|
|
681
|
+
* Evento de marcação não obrigatório.
|
|
682
|
+
*/
|
|
683
|
+
NON_MANDATORY = "NON_MANDATORY",
|
|
684
|
+
/**
|
|
685
|
+
* Evento de marcação gerado.
|
|
686
|
+
*/
|
|
687
|
+
GENERATED = "GENERATED",
|
|
688
|
+
}
|