@nomalism-com/types 0.46.9 → 0.46.10
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
CHANGED
|
@@ -5855,101 +5855,89 @@ var printLocationsQuery = joi118.object({
|
|
|
5855
5855
|
// src/modules/user/timeSheet/interfaces.ts
|
|
5856
5856
|
var interfaces_exports61 = {};
|
|
5857
5857
|
__export(interfaces_exports61, {
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
IRegistryTypeEnum: () => IRegistryTypeEnum,
|
|
5861
|
-
ITimesheetStateEnum: () => ITimesheetStateEnum,
|
|
5858
|
+
ITimeSheetRecordTypeEnum: () => ITimeSheetRecordTypeEnum,
|
|
5859
|
+
ITimeSheetRegistryTypeEnum: () => ITimeSheetRegistryTypeEnum,
|
|
5862
5860
|
Route: () => Route131,
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
registryTypes: () => registryTypes,
|
|
5866
|
-
timesheetStates: () => timesheetStates
|
|
5861
|
+
timeSheetRecordTypes: () => timeSheetRecordTypes,
|
|
5862
|
+
timeSheetRegistryTypes: () => timeSheetRegistryTypes
|
|
5867
5863
|
});
|
|
5868
5864
|
var Route131 = "time_sheet";
|
|
5869
|
-
var
|
|
5865
|
+
var ITimeSheetRecordTypeEnum = {
|
|
5870
5866
|
ENTRY: "ENTRY",
|
|
5871
|
-
EXIT: "EXIT"
|
|
5872
|
-
};
|
|
5873
|
-
var clockTypes = Object.keys(IClockTypeEnum);
|
|
5874
|
-
var IAdjustmentTypeEnum = {
|
|
5867
|
+
EXIT: "EXIT",
|
|
5875
5868
|
CREDIT: "CREDIT",
|
|
5876
5869
|
DEBIT: "DEBIT"
|
|
5877
5870
|
};
|
|
5878
|
-
var
|
|
5879
|
-
var
|
|
5871
|
+
var timeSheetRecordTypes = Object.values(ITimeSheetRecordTypeEnum);
|
|
5872
|
+
var ITimeSheetRegistryTypeEnum = {
|
|
5880
5873
|
AUTOMATIC: "AUTOMATIC",
|
|
5881
5874
|
MANUAL: "MANUAL"
|
|
5882
5875
|
};
|
|
5883
|
-
var
|
|
5884
|
-
var ITimesheetStateEnum = {
|
|
5885
|
-
CONFIRMED: "CONFIRMED",
|
|
5886
|
-
PENDING: "PENDING",
|
|
5887
|
-
ERROR: "ERROR"
|
|
5888
|
-
};
|
|
5889
|
-
var timesheetStates = Object.keys(ITimesheetStateEnum);
|
|
5876
|
+
var timeSheetRegistryTypes = Object.values(ITimeSheetRegistryTypeEnum);
|
|
5890
5877
|
|
|
5891
5878
|
// src/modules/user/timeSheet/route.schema.ts
|
|
5892
5879
|
var route_schema_exports118 = {};
|
|
5893
5880
|
__export(route_schema_exports118, {
|
|
5894
5881
|
createBody: () => createBody65,
|
|
5882
|
+
dailySummaryQuery: () => dailySummaryQuery,
|
|
5883
|
+
findByDateQuery: () => findByDateQuery,
|
|
5884
|
+
findQuery: () => findQuery34,
|
|
5895
5885
|
updateBody: () => updateBody56
|
|
5896
5886
|
});
|
|
5897
5887
|
import joi119 from "joi";
|
|
5898
|
-
var clockSchema = joi119.object({
|
|
5899
|
-
id: joi119.string().uuid(),
|
|
5900
|
-
time: joi119.date().required(),
|
|
5901
|
-
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5902
|
-
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5903
|
-
note: joi119.string().allow("", null).optional(),
|
|
5904
|
-
created_by: joi119.string().uuid().required(),
|
|
5905
|
-
updated_by: joi119.string().uuid().required()
|
|
5906
|
-
});
|
|
5907
|
-
var adjustmentSchema = joi119.object({
|
|
5908
|
-
id: joi119.string().uuid(),
|
|
5909
|
-
type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
|
|
5910
|
-
minutes: joi119.number().integer().min(1).required(),
|
|
5911
|
-
// Mínimo 1 minuto de ajuste
|
|
5912
|
-
note: joi119.string().allow("", null).optional(),
|
|
5913
|
-
created_by: joi119.string().uuid().required(),
|
|
5914
|
-
updated_by: joi119.string().uuid().required()
|
|
5915
|
-
});
|
|
5916
5888
|
var createBodyKeys64 = {
|
|
5917
|
-
date: joi119.date().required(),
|
|
5918
5889
|
user_id: joi119.string().uuid().required(),
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
clock: joi119.object({
|
|
5925
|
-
time: joi119.date(),
|
|
5926
|
-
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5927
|
-
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5928
|
-
note: joi119.string().allow("", null).optional(),
|
|
5929
|
-
created_by: joi119.string().uuid().required(),
|
|
5930
|
-
updated_by: joi119.string().uuid().required()
|
|
5890
|
+
type: joi119.string().valid("ENTRY", "EXIT", "CREDIT", "DEBIT").required(),
|
|
5891
|
+
time: joi119.when("type", {
|
|
5892
|
+
is: joi119.string().valid("ENTRY", "EXIT"),
|
|
5893
|
+
then: joi119.date().required(),
|
|
5894
|
+
otherwise: joi119.date().optional().allow(null)
|
|
5931
5895
|
}),
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5896
|
+
minutes: joi119.when("type", {
|
|
5897
|
+
is: joi119.string().valid("CREDIT", "DEBIT"),
|
|
5898
|
+
then: joi119.number().integer().min(1).required(),
|
|
5899
|
+
otherwise: joi119.number().optional().allow(null)
|
|
5900
|
+
}),
|
|
5901
|
+
registry_type: joi119.string().valid("AUTOMATIC", "MANUAL").default("MANUAL").optional(),
|
|
5902
|
+
note: joi119.string().allow("", null).optional(),
|
|
5903
|
+
created_by: joi119.string().uuid().required(),
|
|
5904
|
+
updated_by: joi119.string().uuid().required()
|
|
5940
5905
|
};
|
|
5941
5906
|
var createBody65 = joi119.object().keys(createBodyKeys64).messages(messages);
|
|
5942
5907
|
var updateBodyKeys54 = {
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5908
|
+
type: joi119.string().valid("ENTRY", "EXIT", "CREDIT", "DEBIT").optional(),
|
|
5909
|
+
time: joi119.when("type", {
|
|
5910
|
+
is: joi119.string().valid("ENTRY", "EXIT"),
|
|
5911
|
+
then: joi119.date().optional(),
|
|
5912
|
+
otherwise: joi119.date().optional().allow(null)
|
|
5913
|
+
}),
|
|
5914
|
+
minutes: joi119.when("type", {
|
|
5915
|
+
is: joi119.string().valid("CREDIT", "DEBIT"),
|
|
5916
|
+
then: joi119.number().integer().min(1).optional(),
|
|
5917
|
+
otherwise: joi119.number().optional().allow(null)
|
|
5918
|
+
}),
|
|
5919
|
+
note: joi119.string().allow("", null).optional(),
|
|
5947
5920
|
updated_by: joi119.string().uuid().required(),
|
|
5948
|
-
|
|
5949
|
-
// 🔥 NOVO: Validador do array de acertos extraordinários enviados via PUT
|
|
5950
|
-
adjustments: joi119.array().items(adjustmentSchema)
|
|
5921
|
+
updated_at: joi119.date().optional()
|
|
5951
5922
|
};
|
|
5952
5923
|
var updateBody56 = joi119.object().keys(updateBodyKeys54).messages(messages);
|
|
5924
|
+
var findQueryKeys32 = {
|
|
5925
|
+
user_id: joi119.string().uuid().optional(),
|
|
5926
|
+
start_date: joi119.date().optional(),
|
|
5927
|
+
end_date: joi119.date().optional()
|
|
5928
|
+
};
|
|
5929
|
+
var findQuery34 = joi119.object().keys(findQueryKeys32).messages(messages);
|
|
5930
|
+
var findByDateQueryKeys = {
|
|
5931
|
+
user_id: joi119.string().uuid().required(),
|
|
5932
|
+
date: joi119.string().isoDate().required()
|
|
5933
|
+
};
|
|
5934
|
+
var findByDateQuery = joi119.object().keys(findByDateQueryKeys).messages(messages);
|
|
5935
|
+
var dailySummaryQueryKeys = {
|
|
5936
|
+
user_id: joi119.string().uuid().required(),
|
|
5937
|
+
start_date: joi119.string().isoDate().required(),
|
|
5938
|
+
end_date: joi119.string().isoDate().required()
|
|
5939
|
+
};
|
|
5940
|
+
var dailySummaryQuery = joi119.object().keys(dailySummaryQueryKeys).messages(messages);
|
|
5953
5941
|
|
|
5954
5942
|
// src/modules/document/CAT/interfaces.ts
|
|
5955
5943
|
var interfaces_exports62 = {};
|
package/dist/index.js
CHANGED
|
@@ -5855,101 +5855,89 @@ var printLocationsQuery = joi118.object({
|
|
|
5855
5855
|
// src/modules/user/timeSheet/interfaces.ts
|
|
5856
5856
|
var interfaces_exports61 = {};
|
|
5857
5857
|
__export(interfaces_exports61, {
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
IRegistryTypeEnum: () => IRegistryTypeEnum,
|
|
5861
|
-
ITimesheetStateEnum: () => ITimesheetStateEnum,
|
|
5858
|
+
ITimeSheetRecordTypeEnum: () => ITimeSheetRecordTypeEnum,
|
|
5859
|
+
ITimeSheetRegistryTypeEnum: () => ITimeSheetRegistryTypeEnum,
|
|
5862
5860
|
Route: () => Route131,
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
registryTypes: () => registryTypes,
|
|
5866
|
-
timesheetStates: () => timesheetStates
|
|
5861
|
+
timeSheetRecordTypes: () => timeSheetRecordTypes,
|
|
5862
|
+
timeSheetRegistryTypes: () => timeSheetRegistryTypes
|
|
5867
5863
|
});
|
|
5868
5864
|
var Route131 = "time_sheet";
|
|
5869
|
-
var
|
|
5865
|
+
var ITimeSheetRecordTypeEnum = {
|
|
5870
5866
|
ENTRY: "ENTRY",
|
|
5871
|
-
EXIT: "EXIT"
|
|
5872
|
-
};
|
|
5873
|
-
var clockTypes = Object.keys(IClockTypeEnum);
|
|
5874
|
-
var IAdjustmentTypeEnum = {
|
|
5867
|
+
EXIT: "EXIT",
|
|
5875
5868
|
CREDIT: "CREDIT",
|
|
5876
5869
|
DEBIT: "DEBIT"
|
|
5877
5870
|
};
|
|
5878
|
-
var
|
|
5879
|
-
var
|
|
5871
|
+
var timeSheetRecordTypes = Object.values(ITimeSheetRecordTypeEnum);
|
|
5872
|
+
var ITimeSheetRegistryTypeEnum = {
|
|
5880
5873
|
AUTOMATIC: "AUTOMATIC",
|
|
5881
5874
|
MANUAL: "MANUAL"
|
|
5882
5875
|
};
|
|
5883
|
-
var
|
|
5884
|
-
var ITimesheetStateEnum = {
|
|
5885
|
-
CONFIRMED: "CONFIRMED",
|
|
5886
|
-
PENDING: "PENDING",
|
|
5887
|
-
ERROR: "ERROR"
|
|
5888
|
-
};
|
|
5889
|
-
var timesheetStates = Object.keys(ITimesheetStateEnum);
|
|
5876
|
+
var timeSheetRegistryTypes = Object.values(ITimeSheetRegistryTypeEnum);
|
|
5890
5877
|
|
|
5891
5878
|
// src/modules/user/timeSheet/route.schema.ts
|
|
5892
5879
|
var route_schema_exports118 = {};
|
|
5893
5880
|
__export(route_schema_exports118, {
|
|
5894
5881
|
createBody: () => createBody65,
|
|
5882
|
+
dailySummaryQuery: () => dailySummaryQuery,
|
|
5883
|
+
findByDateQuery: () => findByDateQuery,
|
|
5884
|
+
findQuery: () => findQuery34,
|
|
5895
5885
|
updateBody: () => updateBody56
|
|
5896
5886
|
});
|
|
5897
5887
|
import joi119 from "joi";
|
|
5898
|
-
var clockSchema = joi119.object({
|
|
5899
|
-
id: joi119.string().uuid(),
|
|
5900
|
-
time: joi119.date().required(),
|
|
5901
|
-
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5902
|
-
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5903
|
-
note: joi119.string().allow("", null).optional(),
|
|
5904
|
-
created_by: joi119.string().uuid().required(),
|
|
5905
|
-
updated_by: joi119.string().uuid().required()
|
|
5906
|
-
});
|
|
5907
|
-
var adjustmentSchema = joi119.object({
|
|
5908
|
-
id: joi119.string().uuid(),
|
|
5909
|
-
type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
|
|
5910
|
-
minutes: joi119.number().integer().min(1).required(),
|
|
5911
|
-
// Mínimo 1 minuto de ajuste
|
|
5912
|
-
note: joi119.string().allow("", null).optional(),
|
|
5913
|
-
created_by: joi119.string().uuid().required(),
|
|
5914
|
-
updated_by: joi119.string().uuid().required()
|
|
5915
|
-
});
|
|
5916
5888
|
var createBodyKeys64 = {
|
|
5917
|
-
date: joi119.date().required(),
|
|
5918
5889
|
user_id: joi119.string().uuid().required(),
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
clock: joi119.object({
|
|
5925
|
-
time: joi119.date(),
|
|
5926
|
-
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5927
|
-
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5928
|
-
note: joi119.string().allow("", null).optional(),
|
|
5929
|
-
created_by: joi119.string().uuid().required(),
|
|
5930
|
-
updated_by: joi119.string().uuid().required()
|
|
5890
|
+
type: joi119.string().valid("ENTRY", "EXIT", "CREDIT", "DEBIT").required(),
|
|
5891
|
+
time: joi119.when("type", {
|
|
5892
|
+
is: joi119.string().valid("ENTRY", "EXIT"),
|
|
5893
|
+
then: joi119.date().required(),
|
|
5894
|
+
otherwise: joi119.date().optional().allow(null)
|
|
5931
5895
|
}),
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5896
|
+
minutes: joi119.when("type", {
|
|
5897
|
+
is: joi119.string().valid("CREDIT", "DEBIT"),
|
|
5898
|
+
then: joi119.number().integer().min(1).required(),
|
|
5899
|
+
otherwise: joi119.number().optional().allow(null)
|
|
5900
|
+
}),
|
|
5901
|
+
registry_type: joi119.string().valid("AUTOMATIC", "MANUAL").default("MANUAL").optional(),
|
|
5902
|
+
note: joi119.string().allow("", null).optional(),
|
|
5903
|
+
created_by: joi119.string().uuid().required(),
|
|
5904
|
+
updated_by: joi119.string().uuid().required()
|
|
5940
5905
|
};
|
|
5941
5906
|
var createBody65 = joi119.object().keys(createBodyKeys64).messages(messages);
|
|
5942
5907
|
var updateBodyKeys54 = {
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5908
|
+
type: joi119.string().valid("ENTRY", "EXIT", "CREDIT", "DEBIT").optional(),
|
|
5909
|
+
time: joi119.when("type", {
|
|
5910
|
+
is: joi119.string().valid("ENTRY", "EXIT"),
|
|
5911
|
+
then: joi119.date().optional(),
|
|
5912
|
+
otherwise: joi119.date().optional().allow(null)
|
|
5913
|
+
}),
|
|
5914
|
+
minutes: joi119.when("type", {
|
|
5915
|
+
is: joi119.string().valid("CREDIT", "DEBIT"),
|
|
5916
|
+
then: joi119.number().integer().min(1).optional(),
|
|
5917
|
+
otherwise: joi119.number().optional().allow(null)
|
|
5918
|
+
}),
|
|
5919
|
+
note: joi119.string().allow("", null).optional(),
|
|
5947
5920
|
updated_by: joi119.string().uuid().required(),
|
|
5948
|
-
|
|
5949
|
-
// 🔥 NOVO: Validador do array de acertos extraordinários enviados via PUT
|
|
5950
|
-
adjustments: joi119.array().items(adjustmentSchema)
|
|
5921
|
+
updated_at: joi119.date().optional()
|
|
5951
5922
|
};
|
|
5952
5923
|
var updateBody56 = joi119.object().keys(updateBodyKeys54).messages(messages);
|
|
5924
|
+
var findQueryKeys32 = {
|
|
5925
|
+
user_id: joi119.string().uuid().optional(),
|
|
5926
|
+
start_date: joi119.date().optional(),
|
|
5927
|
+
end_date: joi119.date().optional()
|
|
5928
|
+
};
|
|
5929
|
+
var findQuery34 = joi119.object().keys(findQueryKeys32).messages(messages);
|
|
5930
|
+
var findByDateQueryKeys = {
|
|
5931
|
+
user_id: joi119.string().uuid().required(),
|
|
5932
|
+
date: joi119.string().isoDate().required()
|
|
5933
|
+
};
|
|
5934
|
+
var findByDateQuery = joi119.object().keys(findByDateQueryKeys).messages(messages);
|
|
5935
|
+
var dailySummaryQueryKeys = {
|
|
5936
|
+
user_id: joi119.string().uuid().required(),
|
|
5937
|
+
start_date: joi119.string().isoDate().required(),
|
|
5938
|
+
end_date: joi119.string().isoDate().required()
|
|
5939
|
+
};
|
|
5940
|
+
var dailySummaryQuery = joi119.object().keys(dailySummaryQueryKeys).messages(messages);
|
|
5953
5941
|
|
|
5954
5942
|
// src/modules/document/CAT/interfaces.ts
|
|
5955
5943
|
var interfaces_exports62 = {};
|
|
@@ -1,95 +1,52 @@
|
|
|
1
1
|
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import {
|
|
3
|
-
export type Entity =
|
|
4
|
-
clocks: TimeSheetClock[];
|
|
5
|
-
adjustments: TimeSheetAdjustment[];
|
|
6
|
-
};
|
|
2
|
+
import { TimeSheet } from '../../../shared/entities/user';
|
|
3
|
+
export type Entity = TimeSheet;
|
|
7
4
|
export declare const Route = "time_sheet";
|
|
8
|
-
export declare const
|
|
9
|
-
ENTRY:
|
|
10
|
-
EXIT:
|
|
11
|
-
|
|
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[];
|
|
20
|
-
export declare const IRegistryTypeEnum: {
|
|
21
|
-
AUTOMATIC: 'AUTOMATIC';
|
|
22
|
-
MANUAL: 'MANUAL';
|
|
5
|
+
export declare const ITimeSheetRecordTypeEnum: {
|
|
6
|
+
readonly ENTRY: "ENTRY";
|
|
7
|
+
readonly EXIT: "EXIT";
|
|
8
|
+
readonly CREDIT: "CREDIT";
|
|
9
|
+
readonly DEBIT: "DEBIT";
|
|
23
10
|
};
|
|
24
|
-
export type
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
ERROR: 'ERROR';
|
|
11
|
+
export type ITimeSheetRecordType = (typeof ITimeSheetRecordTypeEnum)[keyof typeof ITimeSheetRecordTypeEnum];
|
|
12
|
+
export declare const timeSheetRecordTypes: ("ENTRY" | "EXIT" | "CREDIT" | "DEBIT")[];
|
|
13
|
+
export declare const ITimeSheetRegistryTypeEnum: {
|
|
14
|
+
readonly AUTOMATIC: "AUTOMATIC";
|
|
15
|
+
readonly MANUAL: "MANUAL";
|
|
30
16
|
};
|
|
31
|
-
export type
|
|
32
|
-
export declare const
|
|
17
|
+
export type ITimeSheetRegistryType = (typeof ITimeSheetRegistryTypeEnum)[keyof typeof ITimeSheetRegistryTypeEnum];
|
|
18
|
+
export declare const timeSheetRegistryTypes: ("AUTOMATIC" | "MANUAL")[];
|
|
33
19
|
export interface IFindRequest {
|
|
34
20
|
user_id?: string;
|
|
35
21
|
start_date?: string;
|
|
36
22
|
end_date?: string;
|
|
37
|
-
state?: ITimesheetState;
|
|
38
23
|
}
|
|
39
|
-
export interface
|
|
40
|
-
date: Date;
|
|
24
|
+
export interface IFindByDateRequest {
|
|
41
25
|
user_id: string;
|
|
42
|
-
|
|
43
|
-
balance?: number;
|
|
44
|
-
state?: ITimesheetState;
|
|
45
|
-
created_by: string;
|
|
46
|
-
updated_by: string;
|
|
47
|
-
clock?: {
|
|
48
|
-
time?: Date;
|
|
49
|
-
type: IClockType;
|
|
50
|
-
registry_type: IRegistryType;
|
|
51
|
-
note?: string | null;
|
|
52
|
-
created_by: string;
|
|
53
|
-
updated_by: string;
|
|
54
|
-
};
|
|
55
|
-
adjustment?: {
|
|
56
|
-
type: IAdjustmentType;
|
|
57
|
-
minutes: number;
|
|
58
|
-
note?: string | null;
|
|
59
|
-
created_by: string;
|
|
60
|
-
updated_by: string;
|
|
61
|
-
};
|
|
26
|
+
date: string;
|
|
62
27
|
}
|
|
63
|
-
export interface
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
note?: string | null;
|
|
75
|
-
created_by: string;
|
|
76
|
-
updated_by: string;
|
|
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
|
-
}[];
|
|
28
|
+
export interface IDailySummaryRequest {
|
|
29
|
+
user_id: string;
|
|
30
|
+
start_date: string;
|
|
31
|
+
end_date: string;
|
|
32
|
+
}
|
|
33
|
+
export interface IDailySummaryResponse {
|
|
34
|
+
user_id: string;
|
|
35
|
+
date: string;
|
|
36
|
+
total_worked: number;
|
|
37
|
+
balance: number;
|
|
38
|
+
record_count: number;
|
|
86
39
|
}
|
|
40
|
+
export type ICreateRequest = Omit<Entity, 'id' | 'created_at' | 'updated_at'>;
|
|
41
|
+
export type IUpdateRequest = Partial<Pick<Entity, 'type' | 'time' | 'minutes' | 'note' | 'updated_by' | 'updated_at'>>;
|
|
87
42
|
export interface IRepository {
|
|
88
43
|
find(filters?: IFindRequest): Promise<Entity[]>;
|
|
89
44
|
findById(id: string): Promise<Entity | null>;
|
|
90
45
|
create(data: ICreateRequest): Promise<Entity>;
|
|
91
46
|
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
|
|
92
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<
|
|
47
|
+
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
48
|
+
findByUserAndDate(filters: IFindByDateRequest): Promise<Entity[]>;
|
|
49
|
+
getDailySummary(filters: IDailySummaryRequest): Promise<IDailySummaryResponse[]>;
|
|
93
50
|
}
|
|
94
51
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
95
52
|
export type IApi = Omit<IRepository, 'findById'>;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import joi from 'joi';
|
|
2
2
|
export declare const createBody: joi.ObjectSchema<any>;
|
|
3
3
|
export declare const updateBody: joi.ObjectSchema<any>;
|
|
4
|
+
export declare const findQuery: joi.ObjectSchema<any>;
|
|
5
|
+
export declare const findByDateQuery: joi.ObjectSchema<any>;
|
|
6
|
+
export declare const dailySummaryQuery: joi.ObjectSchema<any>;
|
|
@@ -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 {
|
|
4
|
+
import { ITimeSheetRecordType, ITimeSheetRegistryType } from '../../modules/user/timeSheet/interfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Model Users
|
|
7
7
|
*
|
|
@@ -484,37 +484,14 @@ export type SystemModule = {
|
|
|
484
484
|
};
|
|
485
485
|
/**
|
|
486
486
|
* Model TimeSheet
|
|
487
|
-
*
|
|
488
487
|
*/
|
|
489
|
-
export interface
|
|
488
|
+
export interface TimeSheet {
|
|
490
489
|
id: string;
|
|
491
|
-
date: Date;
|
|
492
|
-
total_worked: number;
|
|
493
|
-
balance: number;
|
|
494
490
|
user_id: string;
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
updated_by: string;
|
|
500
|
-
}
|
|
501
|
-
export interface TimeSheetClock {
|
|
502
|
-
id: string;
|
|
503
|
-
timesheet_day_id: string;
|
|
504
|
-
time: Date;
|
|
505
|
-
type: IClockType;
|
|
506
|
-
registry_type: IRegistryType;
|
|
507
|
-
note: string | null;
|
|
508
|
-
created_at: Date;
|
|
509
|
-
updated_at: Date;
|
|
510
|
-
created_by: string;
|
|
511
|
-
updated_by: string;
|
|
512
|
-
}
|
|
513
|
-
export interface TimeSheetAdjustment {
|
|
514
|
-
id: string;
|
|
515
|
-
timesheet_day_id: string;
|
|
516
|
-
type: IAdjustmentType;
|
|
517
|
-
minutes: number;
|
|
491
|
+
type: ITimeSheetRecordType;
|
|
492
|
+
time: Date | null;
|
|
493
|
+
minutes: number | null;
|
|
494
|
+
registry_type: ITimeSheetRegistryType;
|
|
518
495
|
note: string | null;
|
|
519
496
|
created_at: Date;
|
|
520
497
|
updated_at: Date;
|
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.10",
|
|
5
5
|
"author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|