@nomalism-com/types 0.45.69 → 0.45.70
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
|
@@ -5812,101 +5812,89 @@ var printLocationsQuery = joi118.object({
|
|
|
5812
5812
|
// src/modules/user/timeSheet/interfaces.ts
|
|
5813
5813
|
var interfaces_exports61 = {};
|
|
5814
5814
|
__export(interfaces_exports61, {
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
IRegistryTypeEnum: () => IRegistryTypeEnum,
|
|
5818
|
-
ITimesheetStateEnum: () => ITimesheetStateEnum,
|
|
5815
|
+
ITimeSheetRecordTypeEnum: () => ITimeSheetRecordTypeEnum,
|
|
5816
|
+
ITimeSheetRegistryTypeEnum: () => ITimeSheetRegistryTypeEnum,
|
|
5819
5817
|
Route: () => Route131,
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
registryTypes: () => registryTypes,
|
|
5823
|
-
timesheetStates: () => timesheetStates
|
|
5818
|
+
timeSheetRecordTypes: () => timeSheetRecordTypes,
|
|
5819
|
+
timeSheetRegistryTypes: () => timeSheetRegistryTypes
|
|
5824
5820
|
});
|
|
5825
5821
|
var Route131 = "time_sheet";
|
|
5826
|
-
var
|
|
5822
|
+
var ITimeSheetRecordTypeEnum = {
|
|
5827
5823
|
ENTRY: "ENTRY",
|
|
5828
|
-
EXIT: "EXIT"
|
|
5829
|
-
};
|
|
5830
|
-
var clockTypes = Object.keys(IClockTypeEnum);
|
|
5831
|
-
var IAdjustmentTypeEnum = {
|
|
5824
|
+
EXIT: "EXIT",
|
|
5832
5825
|
CREDIT: "CREDIT",
|
|
5833
5826
|
DEBIT: "DEBIT"
|
|
5834
5827
|
};
|
|
5835
|
-
var
|
|
5836
|
-
var
|
|
5828
|
+
var timeSheetRecordTypes = Object.values(ITimeSheetRecordTypeEnum);
|
|
5829
|
+
var ITimeSheetRegistryTypeEnum = {
|
|
5837
5830
|
AUTOMATIC: "AUTOMATIC",
|
|
5838
5831
|
MANUAL: "MANUAL"
|
|
5839
5832
|
};
|
|
5840
|
-
var
|
|
5841
|
-
var ITimesheetStateEnum = {
|
|
5842
|
-
CONFIRMED: "CONFIRMED",
|
|
5843
|
-
PENDING: "PENDING",
|
|
5844
|
-
ERROR: "ERROR"
|
|
5845
|
-
};
|
|
5846
|
-
var timesheetStates = Object.keys(ITimesheetStateEnum);
|
|
5833
|
+
var timeSheetRegistryTypes = Object.values(ITimeSheetRegistryTypeEnum);
|
|
5847
5834
|
|
|
5848
5835
|
// src/modules/user/timeSheet/route.schema.ts
|
|
5849
5836
|
var route_schema_exports118 = {};
|
|
5850
5837
|
__export(route_schema_exports118, {
|
|
5851
5838
|
createBody: () => createBody65,
|
|
5839
|
+
dailySummaryQuery: () => dailySummaryQuery,
|
|
5840
|
+
findByDateQuery: () => findByDateQuery,
|
|
5841
|
+
findQuery: () => findQuery34,
|
|
5852
5842
|
updateBody: () => updateBody56
|
|
5853
5843
|
});
|
|
5854
5844
|
import joi119 from "joi";
|
|
5855
|
-
var clockSchema = joi119.object({
|
|
5856
|
-
id: joi119.string().uuid(),
|
|
5857
|
-
time: joi119.date().required(),
|
|
5858
|
-
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5859
|
-
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5860
|
-
note: joi119.string().allow("", null).optional(),
|
|
5861
|
-
created_by: joi119.string().uuid().required(),
|
|
5862
|
-
updated_by: joi119.string().uuid().required()
|
|
5863
|
-
});
|
|
5864
|
-
var adjustmentSchema = joi119.object({
|
|
5865
|
-
id: joi119.string().uuid(),
|
|
5866
|
-
type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
|
|
5867
|
-
minutes: joi119.number().integer().min(1).required(),
|
|
5868
|
-
// Mínimo 1 minuto de ajuste
|
|
5869
|
-
note: joi119.string().allow("", null).optional(),
|
|
5870
|
-
created_by: joi119.string().uuid().required(),
|
|
5871
|
-
updated_by: joi119.string().uuid().required()
|
|
5872
|
-
});
|
|
5873
5845
|
var createBodyKeys64 = {
|
|
5874
|
-
date: joi119.date().required(),
|
|
5875
5846
|
user_id: joi119.string().uuid().required(),
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
clock: joi119.object({
|
|
5882
|
-
time: joi119.date(),
|
|
5883
|
-
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5884
|
-
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5885
|
-
note: joi119.string().allow("", null).optional(),
|
|
5886
|
-
created_by: joi119.string().uuid().required(),
|
|
5887
|
-
updated_by: joi119.string().uuid().required()
|
|
5847
|
+
type: joi119.string().valid("ENTRY", "EXIT", "CREDIT", "DEBIT").required(),
|
|
5848
|
+
time: joi119.when("type", {
|
|
5849
|
+
is: joi119.string().valid("ENTRY", "EXIT"),
|
|
5850
|
+
then: joi119.date().required(),
|
|
5851
|
+
otherwise: joi119.date().optional().allow(null)
|
|
5888
5852
|
}),
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5853
|
+
minutes: joi119.when("type", {
|
|
5854
|
+
is: joi119.string().valid("CREDIT", "DEBIT"),
|
|
5855
|
+
then: joi119.number().integer().min(1).required(),
|
|
5856
|
+
otherwise: joi119.number().optional().allow(null)
|
|
5857
|
+
}),
|
|
5858
|
+
registry_type: joi119.string().valid("AUTOMATIC", "MANUAL").default("MANUAL").optional(),
|
|
5859
|
+
note: joi119.string().allow("", null).optional(),
|
|
5860
|
+
created_by: joi119.string().uuid().required(),
|
|
5861
|
+
updated_by: joi119.string().uuid().required()
|
|
5897
5862
|
};
|
|
5898
5863
|
var createBody65 = joi119.object().keys(createBodyKeys64).messages(messages);
|
|
5899
5864
|
var updateBodyKeys54 = {
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5865
|
+
type: joi119.string().valid("ENTRY", "EXIT", "CREDIT", "DEBIT").optional(),
|
|
5866
|
+
time: joi119.when("type", {
|
|
5867
|
+
is: joi119.string().valid("ENTRY", "EXIT"),
|
|
5868
|
+
then: joi119.date().optional(),
|
|
5869
|
+
otherwise: joi119.date().optional().allow(null)
|
|
5870
|
+
}),
|
|
5871
|
+
minutes: joi119.when("type", {
|
|
5872
|
+
is: joi119.string().valid("CREDIT", "DEBIT"),
|
|
5873
|
+
then: joi119.number().integer().min(1).optional(),
|
|
5874
|
+
otherwise: joi119.number().optional().allow(null)
|
|
5875
|
+
}),
|
|
5876
|
+
note: joi119.string().allow("", null).optional(),
|
|
5904
5877
|
updated_by: joi119.string().uuid().required(),
|
|
5905
|
-
|
|
5906
|
-
// 🔥 NOVO: Validador do array de acertos extraordinários enviados via PUT
|
|
5907
|
-
adjustments: joi119.array().items(adjustmentSchema)
|
|
5878
|
+
updated_at: joi119.date().optional()
|
|
5908
5879
|
};
|
|
5909
5880
|
var updateBody56 = joi119.object().keys(updateBodyKeys54).messages(messages);
|
|
5881
|
+
var findQueryKeys32 = {
|
|
5882
|
+
user_id: joi119.string().uuid().optional(),
|
|
5883
|
+
start_date: joi119.date().optional(),
|
|
5884
|
+
end_date: joi119.date().optional()
|
|
5885
|
+
};
|
|
5886
|
+
var findQuery34 = joi119.object().keys(findQueryKeys32).messages(messages);
|
|
5887
|
+
var findByDateQueryKeys = {
|
|
5888
|
+
user_id: joi119.string().uuid().required(),
|
|
5889
|
+
date: joi119.string().isoDate().required()
|
|
5890
|
+
};
|
|
5891
|
+
var findByDateQuery = joi119.object().keys(findByDateQueryKeys).messages(messages);
|
|
5892
|
+
var dailySummaryQueryKeys = {
|
|
5893
|
+
user_id: joi119.string().uuid().required(),
|
|
5894
|
+
start_date: joi119.string().isoDate().required(),
|
|
5895
|
+
end_date: joi119.string().isoDate().required()
|
|
5896
|
+
};
|
|
5897
|
+
var dailySummaryQuery = joi119.object().keys(dailySummaryQueryKeys).messages(messages);
|
|
5910
5898
|
|
|
5911
5899
|
// src/modules/document/CAT/interfaces.ts
|
|
5912
5900
|
var interfaces_exports62 = {};
|
package/dist/index.js
CHANGED
|
@@ -5812,101 +5812,89 @@ var printLocationsQuery = joi118.object({
|
|
|
5812
5812
|
// src/modules/user/timeSheet/interfaces.ts
|
|
5813
5813
|
var interfaces_exports61 = {};
|
|
5814
5814
|
__export(interfaces_exports61, {
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
IRegistryTypeEnum: () => IRegistryTypeEnum,
|
|
5818
|
-
ITimesheetStateEnum: () => ITimesheetStateEnum,
|
|
5815
|
+
ITimeSheetRecordTypeEnum: () => ITimeSheetRecordTypeEnum,
|
|
5816
|
+
ITimeSheetRegistryTypeEnum: () => ITimeSheetRegistryTypeEnum,
|
|
5819
5817
|
Route: () => Route131,
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
registryTypes: () => registryTypes,
|
|
5823
|
-
timesheetStates: () => timesheetStates
|
|
5818
|
+
timeSheetRecordTypes: () => timeSheetRecordTypes,
|
|
5819
|
+
timeSheetRegistryTypes: () => timeSheetRegistryTypes
|
|
5824
5820
|
});
|
|
5825
5821
|
var Route131 = "time_sheet";
|
|
5826
|
-
var
|
|
5822
|
+
var ITimeSheetRecordTypeEnum = {
|
|
5827
5823
|
ENTRY: "ENTRY",
|
|
5828
|
-
EXIT: "EXIT"
|
|
5829
|
-
};
|
|
5830
|
-
var clockTypes = Object.keys(IClockTypeEnum);
|
|
5831
|
-
var IAdjustmentTypeEnum = {
|
|
5824
|
+
EXIT: "EXIT",
|
|
5832
5825
|
CREDIT: "CREDIT",
|
|
5833
5826
|
DEBIT: "DEBIT"
|
|
5834
5827
|
};
|
|
5835
|
-
var
|
|
5836
|
-
var
|
|
5828
|
+
var timeSheetRecordTypes = Object.values(ITimeSheetRecordTypeEnum);
|
|
5829
|
+
var ITimeSheetRegistryTypeEnum = {
|
|
5837
5830
|
AUTOMATIC: "AUTOMATIC",
|
|
5838
5831
|
MANUAL: "MANUAL"
|
|
5839
5832
|
};
|
|
5840
|
-
var
|
|
5841
|
-
var ITimesheetStateEnum = {
|
|
5842
|
-
CONFIRMED: "CONFIRMED",
|
|
5843
|
-
PENDING: "PENDING",
|
|
5844
|
-
ERROR: "ERROR"
|
|
5845
|
-
};
|
|
5846
|
-
var timesheetStates = Object.keys(ITimesheetStateEnum);
|
|
5833
|
+
var timeSheetRegistryTypes = Object.values(ITimeSheetRegistryTypeEnum);
|
|
5847
5834
|
|
|
5848
5835
|
// src/modules/user/timeSheet/route.schema.ts
|
|
5849
5836
|
var route_schema_exports118 = {};
|
|
5850
5837
|
__export(route_schema_exports118, {
|
|
5851
5838
|
createBody: () => createBody65,
|
|
5839
|
+
dailySummaryQuery: () => dailySummaryQuery,
|
|
5840
|
+
findByDateQuery: () => findByDateQuery,
|
|
5841
|
+
findQuery: () => findQuery34,
|
|
5852
5842
|
updateBody: () => updateBody56
|
|
5853
5843
|
});
|
|
5854
5844
|
import joi119 from "joi";
|
|
5855
|
-
var clockSchema = joi119.object({
|
|
5856
|
-
id: joi119.string().uuid(),
|
|
5857
|
-
time: joi119.date().required(),
|
|
5858
|
-
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5859
|
-
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5860
|
-
note: joi119.string().allow("", null).optional(),
|
|
5861
|
-
created_by: joi119.string().uuid().required(),
|
|
5862
|
-
updated_by: joi119.string().uuid().required()
|
|
5863
|
-
});
|
|
5864
|
-
var adjustmentSchema = joi119.object({
|
|
5865
|
-
id: joi119.string().uuid(),
|
|
5866
|
-
type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
|
|
5867
|
-
minutes: joi119.number().integer().min(1).required(),
|
|
5868
|
-
// Mínimo 1 minuto de ajuste
|
|
5869
|
-
note: joi119.string().allow("", null).optional(),
|
|
5870
|
-
created_by: joi119.string().uuid().required(),
|
|
5871
|
-
updated_by: joi119.string().uuid().required()
|
|
5872
|
-
});
|
|
5873
5845
|
var createBodyKeys64 = {
|
|
5874
|
-
date: joi119.date().required(),
|
|
5875
5846
|
user_id: joi119.string().uuid().required(),
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
clock: joi119.object({
|
|
5882
|
-
time: joi119.date(),
|
|
5883
|
-
type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
|
|
5884
|
-
registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
|
|
5885
|
-
note: joi119.string().allow("", null).optional(),
|
|
5886
|
-
created_by: joi119.string().uuid().required(),
|
|
5887
|
-
updated_by: joi119.string().uuid().required()
|
|
5847
|
+
type: joi119.string().valid("ENTRY", "EXIT", "CREDIT", "DEBIT").required(),
|
|
5848
|
+
time: joi119.when("type", {
|
|
5849
|
+
is: joi119.string().valid("ENTRY", "EXIT"),
|
|
5850
|
+
then: joi119.date().required(),
|
|
5851
|
+
otherwise: joi119.date().optional().allow(null)
|
|
5888
5852
|
}),
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5853
|
+
minutes: joi119.when("type", {
|
|
5854
|
+
is: joi119.string().valid("CREDIT", "DEBIT"),
|
|
5855
|
+
then: joi119.number().integer().min(1).required(),
|
|
5856
|
+
otherwise: joi119.number().optional().allow(null)
|
|
5857
|
+
}),
|
|
5858
|
+
registry_type: joi119.string().valid("AUTOMATIC", "MANUAL").default("MANUAL").optional(),
|
|
5859
|
+
note: joi119.string().allow("", null).optional(),
|
|
5860
|
+
created_by: joi119.string().uuid().required(),
|
|
5861
|
+
updated_by: joi119.string().uuid().required()
|
|
5897
5862
|
};
|
|
5898
5863
|
var createBody65 = joi119.object().keys(createBodyKeys64).messages(messages);
|
|
5899
5864
|
var updateBodyKeys54 = {
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5865
|
+
type: joi119.string().valid("ENTRY", "EXIT", "CREDIT", "DEBIT").optional(),
|
|
5866
|
+
time: joi119.when("type", {
|
|
5867
|
+
is: joi119.string().valid("ENTRY", "EXIT"),
|
|
5868
|
+
then: joi119.date().optional(),
|
|
5869
|
+
otherwise: joi119.date().optional().allow(null)
|
|
5870
|
+
}),
|
|
5871
|
+
minutes: joi119.when("type", {
|
|
5872
|
+
is: joi119.string().valid("CREDIT", "DEBIT"),
|
|
5873
|
+
then: joi119.number().integer().min(1).optional(),
|
|
5874
|
+
otherwise: joi119.number().optional().allow(null)
|
|
5875
|
+
}),
|
|
5876
|
+
note: joi119.string().allow("", null).optional(),
|
|
5904
5877
|
updated_by: joi119.string().uuid().required(),
|
|
5905
|
-
|
|
5906
|
-
// 🔥 NOVO: Validador do array de acertos extraordinários enviados via PUT
|
|
5907
|
-
adjustments: joi119.array().items(adjustmentSchema)
|
|
5878
|
+
updated_at: joi119.date().optional()
|
|
5908
5879
|
};
|
|
5909
5880
|
var updateBody56 = joi119.object().keys(updateBodyKeys54).messages(messages);
|
|
5881
|
+
var findQueryKeys32 = {
|
|
5882
|
+
user_id: joi119.string().uuid().optional(),
|
|
5883
|
+
start_date: joi119.date().optional(),
|
|
5884
|
+
end_date: joi119.date().optional()
|
|
5885
|
+
};
|
|
5886
|
+
var findQuery34 = joi119.object().keys(findQueryKeys32).messages(messages);
|
|
5887
|
+
var findByDateQueryKeys = {
|
|
5888
|
+
user_id: joi119.string().uuid().required(),
|
|
5889
|
+
date: joi119.string().isoDate().required()
|
|
5890
|
+
};
|
|
5891
|
+
var findByDateQuery = joi119.object().keys(findByDateQueryKeys).messages(messages);
|
|
5892
|
+
var dailySummaryQueryKeys = {
|
|
5893
|
+
user_id: joi119.string().uuid().required(),
|
|
5894
|
+
start_date: joi119.string().isoDate().required(),
|
|
5895
|
+
end_date: joi119.string().isoDate().required()
|
|
5896
|
+
};
|
|
5897
|
+
var dailySummaryQuery = joi119.object().keys(dailySummaryQueryKeys).messages(messages);
|
|
5910
5898
|
|
|
5911
5899
|
// src/modules/document/CAT/interfaces.ts
|
|
5912
5900
|
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
47
|
deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { IPaymentMethodsSaftCodeEnum } from '../../modules/user/paymentMethods/interfaces';
|
|
2
2
|
import type { SystemModuleEnum } from '../../modules/user/systemModule/interface';
|
|
3
|
-
import {
|
|
3
|
+
import { ITimeSheetRecordType, ITimeSheetRegistryType } from '../../modules/user/timeSheet/interfaces';
|
|
4
4
|
/**
|
|
5
5
|
* Model Users
|
|
6
6
|
*
|
|
@@ -483,36 +483,14 @@ export type SystemModule = {
|
|
|
483
483
|
* Model TimeSheet
|
|
484
484
|
*
|
|
485
485
|
*/
|
|
486
|
-
export interface
|
|
486
|
+
export interface TimeSheet {
|
|
487
487
|
id: string;
|
|
488
|
-
date: Date;
|
|
489
|
-
total_worked: number;
|
|
490
|
-
balance: number;
|
|
491
488
|
user_id: string;
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
}
|
|
498
|
-
export interface TimeSheetClock {
|
|
499
|
-
id: string;
|
|
500
|
-
timesheet_day_id: string;
|
|
501
|
-
time: Date;
|
|
502
|
-
type: IClockType;
|
|
503
|
-
registry_type: IRegistryType;
|
|
504
|
-
note: string | null;
|
|
505
|
-
created_at: Date;
|
|
506
|
-
updated_at: Date;
|
|
507
|
-
created_by: string;
|
|
508
|
-
updated_by: string;
|
|
509
|
-
}
|
|
510
|
-
export interface TimeSheetAdjustment {
|
|
511
|
-
id: string;
|
|
512
|
-
timesheet_day_id: string;
|
|
513
|
-
type: IAdjustmentType;
|
|
514
|
-
minutes: number;
|
|
515
|
-
note: string | null;
|
|
489
|
+
type: ITimeSheetRecordType;
|
|
490
|
+
time?: Date;
|
|
491
|
+
minutes?: number;
|
|
492
|
+
registry_type: ITimeSheetRegistryType;
|
|
493
|
+
note?: string;
|
|
516
494
|
created_at: Date;
|
|
517
495
|
updated_at: Date;
|
|
518
496
|
created_by: string;
|
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.70",
|
|
5
5
|
"author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|