@nomalism-com/types 0.46.2 → 0.46.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/dist/index.cjs +27 -11
- package/dist/index.js +27 -11
- package/dist/modules/user/timeSheet/interfaces.d.ts +23 -1
- package/dist/shared/entities/user.d.ts +12 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5842,10 +5842,12 @@ var printLocationsQuery = joi118.object({
|
|
|
5842
5842
|
// src/modules/user/timeSheet/interfaces.ts
|
|
5843
5843
|
var interfaces_exports61 = {};
|
|
5844
5844
|
__export(interfaces_exports61, {
|
|
5845
|
+
IAdjustmentTypeEnum: () => IAdjustmentTypeEnum,
|
|
5845
5846
|
IClockTypeEnum: () => IClockTypeEnum,
|
|
5846
5847
|
IRegistryTypeEnum: () => IRegistryTypeEnum,
|
|
5847
5848
|
ITimesheetStateEnum: () => ITimesheetStateEnum,
|
|
5848
5849
|
Route: () => Route131,
|
|
5850
|
+
adjustmentTypes: () => adjustmentTypes,
|
|
5849
5851
|
clockTypes: () => clockTypes,
|
|
5850
5852
|
registryTypes: () => registryTypes,
|
|
5851
5853
|
timesheetStates: () => timesheetStates
|
|
@@ -5856,6 +5858,11 @@ var IClockTypeEnum = {
|
|
|
5856
5858
|
EXIT: "EXIT"
|
|
5857
5859
|
};
|
|
5858
5860
|
var clockTypes = Object.keys(IClockTypeEnum);
|
|
5861
|
+
var IAdjustmentTypeEnum = {
|
|
5862
|
+
CREDIT: "CREDIT",
|
|
5863
|
+
DEBIT: "DEBIT"
|
|
5864
|
+
};
|
|
5865
|
+
var adjustmentTypes = Object.keys(IAdjustmentTypeEnum);
|
|
5859
5866
|
var IRegistryTypeEnum = {
|
|
5860
5867
|
AUTOMATIC: "AUTOMATIC",
|
|
5861
5868
|
MANUAL: "MANUAL"
|
|
@@ -5882,9 +5889,16 @@ var clockSchema = joi119.object({
|
|
|
5882
5889
|
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5883
5890
|
note: joi119.string().allow("", null).optional(),
|
|
5884
5891
|
created_by: joi119.string().uuid().required(),
|
|
5885
|
-
// 👈 Adicionado para auditoria nos updates
|
|
5886
5892
|
updated_by: joi119.string().uuid().required()
|
|
5887
|
-
|
|
5893
|
+
});
|
|
5894
|
+
var adjustmentSchema = joi119.object({
|
|
5895
|
+
id: joi119.string().uuid(),
|
|
5896
|
+
type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
|
|
5897
|
+
minutes: joi119.number().integer().min(1).required(),
|
|
5898
|
+
// Mínimo 1 minuto de ajuste
|
|
5899
|
+
note: joi119.string().allow("", null).optional(),
|
|
5900
|
+
created_by: joi119.string().uuid().required(),
|
|
5901
|
+
updated_by: joi119.string().uuid().required()
|
|
5888
5902
|
});
|
|
5889
5903
|
var createBodyKeys64 = {
|
|
5890
5904
|
date: joi119.date().required(),
|
|
@@ -5893,19 +5907,22 @@ var createBodyKeys64 = {
|
|
|
5893
5907
|
balance: joi119.number().integer(),
|
|
5894
5908
|
state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
|
|
5895
5909
|
created_by: joi119.string().uuid().required(),
|
|
5896
|
-
// 👈 Adicionado na raiz do dia
|
|
5897
5910
|
updated_by: joi119.string().uuid().required(),
|
|
5898
|
-
// 👈 Adicionado na raiz do dia
|
|
5899
|
-
// Objeto opcional para quando se cria o dia já com a primeira picagem
|
|
5900
5911
|
clock: joi119.object({
|
|
5901
5912
|
time: joi119.date(),
|
|
5902
5913
|
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5903
5914
|
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5904
5915
|
note: joi119.string().allow("", null).optional(),
|
|
5905
5916
|
created_by: joi119.string().uuid().required(),
|
|
5906
|
-
// 👈 Adicionado no clock interno
|
|
5907
5917
|
updated_by: joi119.string().uuid().required()
|
|
5908
|
-
|
|
5918
|
+
}),
|
|
5919
|
+
// 🔥 NOVO: Validador do objeto opcional de acerto na criação do dia
|
|
5920
|
+
adjustment: joi119.object({
|
|
5921
|
+
type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
|
|
5922
|
+
minutes: joi119.number().integer().min(1).required(),
|
|
5923
|
+
note: joi119.string().allow("", null).optional(),
|
|
5924
|
+
created_by: joi119.string().uuid().required(),
|
|
5925
|
+
updated_by: joi119.string().uuid().required()
|
|
5909
5926
|
})
|
|
5910
5927
|
};
|
|
5911
5928
|
var createBody65 = joi119.object().keys(createBodyKeys64).messages(messages);
|
|
@@ -5914,11 +5931,10 @@ var updateBodyKeys54 = {
|
|
|
5914
5931
|
balance: joi119.number().integer(),
|
|
5915
5932
|
state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
|
|
5916
5933
|
created_by: joi119.string().uuid().optional(),
|
|
5917
|
-
// 💡 Opcional no update para manter o original se quiseres
|
|
5918
5934
|
updated_by: joi119.string().uuid().required(),
|
|
5919
|
-
|
|
5920
|
-
//
|
|
5921
|
-
|
|
5935
|
+
clocks: joi119.array().items(clockSchema),
|
|
5936
|
+
// 🔥 NOVO: Validador do array de acertos extraordinários enviados via PUT
|
|
5937
|
+
adjustments: joi119.array().items(adjustmentSchema)
|
|
5922
5938
|
};
|
|
5923
5939
|
var updateBody56 = joi119.object().keys(updateBodyKeys54).messages(messages);
|
|
5924
5940
|
|
package/dist/index.js
CHANGED
|
@@ -5842,10 +5842,12 @@ var printLocationsQuery = joi118.object({
|
|
|
5842
5842
|
// src/modules/user/timeSheet/interfaces.ts
|
|
5843
5843
|
var interfaces_exports61 = {};
|
|
5844
5844
|
__export(interfaces_exports61, {
|
|
5845
|
+
IAdjustmentTypeEnum: () => IAdjustmentTypeEnum,
|
|
5845
5846
|
IClockTypeEnum: () => IClockTypeEnum,
|
|
5846
5847
|
IRegistryTypeEnum: () => IRegistryTypeEnum,
|
|
5847
5848
|
ITimesheetStateEnum: () => ITimesheetStateEnum,
|
|
5848
5849
|
Route: () => Route131,
|
|
5850
|
+
adjustmentTypes: () => adjustmentTypes,
|
|
5849
5851
|
clockTypes: () => clockTypes,
|
|
5850
5852
|
registryTypes: () => registryTypes,
|
|
5851
5853
|
timesheetStates: () => timesheetStates
|
|
@@ -5856,6 +5858,11 @@ var IClockTypeEnum = {
|
|
|
5856
5858
|
EXIT: "EXIT"
|
|
5857
5859
|
};
|
|
5858
5860
|
var clockTypes = Object.keys(IClockTypeEnum);
|
|
5861
|
+
var IAdjustmentTypeEnum = {
|
|
5862
|
+
CREDIT: "CREDIT",
|
|
5863
|
+
DEBIT: "DEBIT"
|
|
5864
|
+
};
|
|
5865
|
+
var adjustmentTypes = Object.keys(IAdjustmentTypeEnum);
|
|
5859
5866
|
var IRegistryTypeEnum = {
|
|
5860
5867
|
AUTOMATIC: "AUTOMATIC",
|
|
5861
5868
|
MANUAL: "MANUAL"
|
|
@@ -5882,9 +5889,16 @@ var clockSchema = joi119.object({
|
|
|
5882
5889
|
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5883
5890
|
note: joi119.string().allow("", null).optional(),
|
|
5884
5891
|
created_by: joi119.string().uuid().required(),
|
|
5885
|
-
// 👈 Adicionado para auditoria nos updates
|
|
5886
5892
|
updated_by: joi119.string().uuid().required()
|
|
5887
|
-
|
|
5893
|
+
});
|
|
5894
|
+
var adjustmentSchema = joi119.object({
|
|
5895
|
+
id: joi119.string().uuid(),
|
|
5896
|
+
type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
|
|
5897
|
+
minutes: joi119.number().integer().min(1).required(),
|
|
5898
|
+
// Mínimo 1 minuto de ajuste
|
|
5899
|
+
note: joi119.string().allow("", null).optional(),
|
|
5900
|
+
created_by: joi119.string().uuid().required(),
|
|
5901
|
+
updated_by: joi119.string().uuid().required()
|
|
5888
5902
|
});
|
|
5889
5903
|
var createBodyKeys64 = {
|
|
5890
5904
|
date: joi119.date().required(),
|
|
@@ -5893,19 +5907,22 @@ var createBodyKeys64 = {
|
|
|
5893
5907
|
balance: joi119.number().integer(),
|
|
5894
5908
|
state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
|
|
5895
5909
|
created_by: joi119.string().uuid().required(),
|
|
5896
|
-
// 👈 Adicionado na raiz do dia
|
|
5897
5910
|
updated_by: joi119.string().uuid().required(),
|
|
5898
|
-
// 👈 Adicionado na raiz do dia
|
|
5899
|
-
// Objeto opcional para quando se cria o dia já com a primeira picagem
|
|
5900
5911
|
clock: joi119.object({
|
|
5901
5912
|
time: joi119.date(),
|
|
5902
5913
|
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5903
5914
|
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5904
5915
|
note: joi119.string().allow("", null).optional(),
|
|
5905
5916
|
created_by: joi119.string().uuid().required(),
|
|
5906
|
-
// 👈 Adicionado no clock interno
|
|
5907
5917
|
updated_by: joi119.string().uuid().required()
|
|
5908
|
-
|
|
5918
|
+
}),
|
|
5919
|
+
// 🔥 NOVO: Validador do objeto opcional de acerto na criação do dia
|
|
5920
|
+
adjustment: joi119.object({
|
|
5921
|
+
type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
|
|
5922
|
+
minutes: joi119.number().integer().min(1).required(),
|
|
5923
|
+
note: joi119.string().allow("", null).optional(),
|
|
5924
|
+
created_by: joi119.string().uuid().required(),
|
|
5925
|
+
updated_by: joi119.string().uuid().required()
|
|
5909
5926
|
})
|
|
5910
5927
|
};
|
|
5911
5928
|
var createBody65 = joi119.object().keys(createBodyKeys64).messages(messages);
|
|
@@ -5914,11 +5931,10 @@ var updateBodyKeys54 = {
|
|
|
5914
5931
|
balance: joi119.number().integer(),
|
|
5915
5932
|
state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
|
|
5916
5933
|
created_by: joi119.string().uuid().optional(),
|
|
5917
|
-
// 💡 Opcional no update para manter o original se quiseres
|
|
5918
5934
|
updated_by: joi119.string().uuid().required(),
|
|
5919
|
-
|
|
5920
|
-
//
|
|
5921
|
-
|
|
5935
|
+
clocks: joi119.array().items(clockSchema),
|
|
5936
|
+
// 🔥 NOVO: Validador do array de acertos extraordinários enviados via PUT
|
|
5937
|
+
adjustments: joi119.array().items(adjustmentSchema)
|
|
5922
5938
|
};
|
|
5923
5939
|
var updateBody56 = joi119.object().keys(updateBodyKeys54).messages(messages);
|
|
5924
5940
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { TimeSheetDay, TimeSheetClock } from '../../../shared/entities/user';
|
|
2
|
+
import { TimeSheetDay, TimeSheetClock, TimeSheetAdjustment } from '../../../shared/entities/user';
|
|
3
3
|
export type Entity = TimeSheetDay & {
|
|
4
4
|
clocks: TimeSheetClock[];
|
|
5
|
+
adjustments: TimeSheetAdjustment[];
|
|
5
6
|
};
|
|
6
7
|
export declare const Route = "time_sheet";
|
|
7
8
|
export declare const IClockTypeEnum: {
|
|
@@ -10,6 +11,12 @@ export declare const IClockTypeEnum: {
|
|
|
10
11
|
};
|
|
11
12
|
export type IClockType = (typeof IClockTypeEnum)[keyof typeof IClockTypeEnum];
|
|
12
13
|
export declare const clockTypes: string[];
|
|
14
|
+
export declare const IAdjustmentTypeEnum: {
|
|
15
|
+
CREDIT: 'CREDIT';
|
|
16
|
+
DEBIT: 'DEBIT';
|
|
17
|
+
};
|
|
18
|
+
export type IAdjustmentType = (typeof IAdjustmentTypeEnum)[keyof typeof IAdjustmentTypeEnum];
|
|
19
|
+
export declare const adjustmentTypes: string[];
|
|
13
20
|
export declare const IRegistryTypeEnum: {
|
|
14
21
|
AUTOMATIC: 'AUTOMATIC';
|
|
15
22
|
MANUAL: 'MANUAL';
|
|
@@ -45,6 +52,13 @@ export interface ICreateRequest {
|
|
|
45
52
|
created_by: string;
|
|
46
53
|
updated_by: string;
|
|
47
54
|
};
|
|
55
|
+
adjustment?: {
|
|
56
|
+
type: IAdjustmentType;
|
|
57
|
+
minutes: number;
|
|
58
|
+
note?: string | null;
|
|
59
|
+
created_by: string;
|
|
60
|
+
updated_by: string;
|
|
61
|
+
};
|
|
48
62
|
}
|
|
49
63
|
export interface IUpdateRequest {
|
|
50
64
|
total_worked?: number;
|
|
@@ -61,6 +75,14 @@ export interface IUpdateRequest {
|
|
|
61
75
|
created_by: string;
|
|
62
76
|
updated_by: string;
|
|
63
77
|
}[];
|
|
78
|
+
adjustments?: {
|
|
79
|
+
id?: string;
|
|
80
|
+
type: IAdjustmentType;
|
|
81
|
+
minutes: number;
|
|
82
|
+
note?: string | null;
|
|
83
|
+
created_by: string;
|
|
84
|
+
updated_by: string;
|
|
85
|
+
}[];
|
|
64
86
|
}
|
|
65
87
|
export interface IRepository {
|
|
66
88
|
find(filters?: IFindRequest): Promise<Entity[]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IPaymentMethodsSaftCodeEnum } from '../../modules/user/paymentMethods/interfaces';
|
|
2
2
|
import type { IReasonForExemptionType } from '../../modules/user/reasonForExemption/interface';
|
|
3
3
|
import type { SystemModuleEnum } from '../../modules/user/systemModule/interface';
|
|
4
|
-
import { IClockType, IRegistryType, ITimesheetState } from '../../modules/user/timeSheet/interfaces';
|
|
4
|
+
import { IClockType, IRegistryType, ITimesheetState, IAdjustmentType } from '../../modules/user/timeSheet/interfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Model Users
|
|
7
7
|
*
|
|
@@ -510,3 +510,14 @@ export interface TimeSheetClock {
|
|
|
510
510
|
created_by: string;
|
|
511
511
|
updated_by: string;
|
|
512
512
|
}
|
|
513
|
+
export interface TimeSheetAdjustment {
|
|
514
|
+
id: string;
|
|
515
|
+
timesheet_day_id: string;
|
|
516
|
+
type: IAdjustmentType;
|
|
517
|
+
minutes: number;
|
|
518
|
+
note: string | null;
|
|
519
|
+
created_at: Date;
|
|
520
|
+
updated_at: Date;
|
|
521
|
+
created_by: string;
|
|
522
|
+
updated_by: string;
|
|
523
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nomalism-com/types",
|
|
3
3
|
"description": "A nomalism package with all necessary types and validations for developing APIs",
|
|
4
|
-
"version": "0.46.
|
|
4
|
+
"version": "0.46.3",
|
|
5
5
|
"author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|