@nomalism-com/types 0.45.62 → 0.45.64
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 +20 -5
- package/dist/index.js +20 -5
- package/dist/modules/user/timeSheet/interfaces.d.ts +8 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5840,11 +5840,14 @@ __export(route_schema_exports118, {
|
|
|
5840
5840
|
import joi119 from "joi";
|
|
5841
5841
|
var clockSchema = joi119.object({
|
|
5842
5842
|
id: joi119.string().uuid(),
|
|
5843
|
-
// Opcional no create/update (indica se já existe ou é novo)
|
|
5844
5843
|
time: joi119.date().required(),
|
|
5845
5844
|
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5846
5845
|
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5847
|
-
note: joi119.string().allow("", null).optional()
|
|
5846
|
+
note: joi119.string().allow("", null).optional(),
|
|
5847
|
+
created_by: joi119.string().uuid().required(),
|
|
5848
|
+
// 👈 Adicionado para auditoria nos updates
|
|
5849
|
+
updated_by: joi119.string().uuid().required()
|
|
5850
|
+
// 👈 Adicionado para auditoria nos updates
|
|
5848
5851
|
});
|
|
5849
5852
|
var createBodyKeys64 = {
|
|
5850
5853
|
date: joi119.date().required(),
|
|
@@ -5852,12 +5855,20 @@ var createBodyKeys64 = {
|
|
|
5852
5855
|
total_worked: joi119.number().integer().min(0),
|
|
5853
5856
|
balance: joi119.number().integer(),
|
|
5854
5857
|
state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
|
|
5855
|
-
|
|
5858
|
+
created_by: joi119.string().uuid().required(),
|
|
5859
|
+
// 👈 Adicionado na raiz do dia
|
|
5860
|
+
updated_by: joi119.string().uuid().required(),
|
|
5861
|
+
// 👈 Adicionado na raiz do dia
|
|
5862
|
+
// Objeto opcional para quando se cria o dia já com a primeira picagem
|
|
5856
5863
|
clock: joi119.object({
|
|
5857
5864
|
time: joi119.date(),
|
|
5858
5865
|
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5859
5866
|
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5860
|
-
note: joi119.string().allow("", null).optional()
|
|
5867
|
+
note: joi119.string().allow("", null).optional(),
|
|
5868
|
+
created_by: joi119.string().uuid().required(),
|
|
5869
|
+
// 👈 Adicionado no clock interno
|
|
5870
|
+
updated_by: joi119.string().uuid().required()
|
|
5871
|
+
// 👈 Adicionado no clock interno
|
|
5861
5872
|
})
|
|
5862
5873
|
};
|
|
5863
5874
|
var createBody65 = joi119.object().keys(createBodyKeys64).messages(messages);
|
|
@@ -5865,7 +5876,11 @@ var updateBodyKeys54 = {
|
|
|
5865
5876
|
total_worked: joi119.number().integer().min(0),
|
|
5866
5877
|
balance: joi119.number().integer(),
|
|
5867
5878
|
state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
|
|
5868
|
-
|
|
5879
|
+
created_by: joi119.string().uuid().optional(),
|
|
5880
|
+
// 💡 Opcional no update para manter o original se quiseres
|
|
5881
|
+
updated_by: joi119.string().uuid().required(),
|
|
5882
|
+
// 👈 Obrigatório no update do dia
|
|
5883
|
+
// Array de picagens enviado pelo formulário de edição
|
|
5869
5884
|
clocks: joi119.array().items(clockSchema)
|
|
5870
5885
|
};
|
|
5871
5886
|
var updateBody56 = joi119.object().keys(updateBodyKeys54).messages(messages);
|
package/dist/index.js
CHANGED
|
@@ -5840,11 +5840,14 @@ __export(route_schema_exports118, {
|
|
|
5840
5840
|
import joi119 from "joi";
|
|
5841
5841
|
var clockSchema = joi119.object({
|
|
5842
5842
|
id: joi119.string().uuid(),
|
|
5843
|
-
// Opcional no create/update (indica se já existe ou é novo)
|
|
5844
5843
|
time: joi119.date().required(),
|
|
5845
5844
|
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5846
5845
|
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5847
|
-
note: joi119.string().allow("", null).optional()
|
|
5846
|
+
note: joi119.string().allow("", null).optional(),
|
|
5847
|
+
created_by: joi119.string().uuid().required(),
|
|
5848
|
+
// 👈 Adicionado para auditoria nos updates
|
|
5849
|
+
updated_by: joi119.string().uuid().required()
|
|
5850
|
+
// 👈 Adicionado para auditoria nos updates
|
|
5848
5851
|
});
|
|
5849
5852
|
var createBodyKeys64 = {
|
|
5850
5853
|
date: joi119.date().required(),
|
|
@@ -5852,12 +5855,20 @@ var createBodyKeys64 = {
|
|
|
5852
5855
|
total_worked: joi119.number().integer().min(0),
|
|
5853
5856
|
balance: joi119.number().integer(),
|
|
5854
5857
|
state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
|
|
5855
|
-
|
|
5858
|
+
created_by: joi119.string().uuid().required(),
|
|
5859
|
+
// 👈 Adicionado na raiz do dia
|
|
5860
|
+
updated_by: joi119.string().uuid().required(),
|
|
5861
|
+
// 👈 Adicionado na raiz do dia
|
|
5862
|
+
// Objeto opcional para quando se cria o dia já com a primeira picagem
|
|
5856
5863
|
clock: joi119.object({
|
|
5857
5864
|
time: joi119.date(),
|
|
5858
5865
|
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5859
5866
|
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5860
|
-
note: joi119.string().allow("", null).optional()
|
|
5867
|
+
note: joi119.string().allow("", null).optional(),
|
|
5868
|
+
created_by: joi119.string().uuid().required(),
|
|
5869
|
+
// 👈 Adicionado no clock interno
|
|
5870
|
+
updated_by: joi119.string().uuid().required()
|
|
5871
|
+
// 👈 Adicionado no clock interno
|
|
5861
5872
|
})
|
|
5862
5873
|
};
|
|
5863
5874
|
var createBody65 = joi119.object().keys(createBodyKeys64).messages(messages);
|
|
@@ -5865,7 +5876,11 @@ var updateBodyKeys54 = {
|
|
|
5865
5876
|
total_worked: joi119.number().integer().min(0),
|
|
5866
5877
|
balance: joi119.number().integer(),
|
|
5867
5878
|
state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
|
|
5868
|
-
|
|
5879
|
+
created_by: joi119.string().uuid().optional(),
|
|
5880
|
+
// 💡 Opcional no update para manter o original se quiseres
|
|
5881
|
+
updated_by: joi119.string().uuid().required(),
|
|
5882
|
+
// 👈 Obrigatório no update do dia
|
|
5883
|
+
// Array de picagens enviado pelo formulário de edição
|
|
5869
5884
|
clocks: joi119.array().items(clockSchema)
|
|
5870
5885
|
};
|
|
5871
5886
|
var updateBody56 = joi119.object().keys(updateBodyKeys54).messages(messages);
|
|
@@ -35,23 +35,31 @@ export interface ICreateRequest {
|
|
|
35
35
|
total_worked?: number;
|
|
36
36
|
balance?: number;
|
|
37
37
|
state?: ITimesheetState;
|
|
38
|
+
created_by: string;
|
|
39
|
+
updated_by: string;
|
|
38
40
|
clock?: {
|
|
39
41
|
time?: Date;
|
|
40
42
|
type: IClockType;
|
|
41
43
|
registry_type: IRegistryType;
|
|
42
44
|
note?: string | null;
|
|
45
|
+
created_by: string;
|
|
46
|
+
updated_by: string;
|
|
43
47
|
};
|
|
44
48
|
}
|
|
45
49
|
export interface IUpdateRequest {
|
|
46
50
|
total_worked?: number;
|
|
47
51
|
balance?: number;
|
|
48
52
|
state?: ITimesheetState;
|
|
53
|
+
created_by?: string;
|
|
54
|
+
updated_by: string;
|
|
49
55
|
clocks?: {
|
|
50
56
|
id?: string;
|
|
51
57
|
time: Date;
|
|
52
58
|
type: IClockType;
|
|
53
59
|
registry_type: IRegistryType;
|
|
54
60
|
note?: string | null;
|
|
61
|
+
created_by: string;
|
|
62
|
+
updated_by: string;
|
|
55
63
|
}[];
|
|
56
64
|
}
|
|
57
65
|
export interface IRepository {
|
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.45.
|
|
4
|
+
"version": "0.45.64",
|
|
5
5
|
"author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|