@nomalism-com/types 0.45.54 → 0.45.56
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
|
@@ -5797,7 +5797,7 @@ __export(route_schema_exports117, {
|
|
|
5797
5797
|
});
|
|
5798
5798
|
import joi118 from "joi";
|
|
5799
5799
|
var printLocationsQuery = joi118.object({
|
|
5800
|
-
locations_ids: joi118.
|
|
5800
|
+
locations_ids: joi118.string().required()
|
|
5801
5801
|
}).messages(messages);
|
|
5802
5802
|
|
|
5803
5803
|
// src/index.ts
|
package/dist/index.js
CHANGED
|
@@ -5797,7 +5797,7 @@ __export(route_schema_exports117, {
|
|
|
5797
5797
|
});
|
|
5798
5798
|
import joi118 from "joi";
|
|
5799
5799
|
var printLocationsQuery = joi118.object({
|
|
5800
|
-
locations_ids: joi118.
|
|
5800
|
+
locations_ids: joi118.string().required()
|
|
5801
5801
|
}).messages(messages);
|
|
5802
5802
|
|
|
5803
5803
|
// src/index.ts
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as IShared from '../../../shared/interface';
|
|
2
|
+
import { TimeSheetDay, TimeSheetClock } from '../../../shared/entities/user';
|
|
3
|
+
export declare const IClockTypeEnum: {
|
|
4
|
+
ENTRY: 'ENTRY';
|
|
5
|
+
EXIT: 'EXIT';
|
|
6
|
+
};
|
|
7
|
+
export type IClockType = (typeof IClockTypeEnum)[keyof typeof IClockTypeEnum];
|
|
8
|
+
export declare const clockTypes: string[];
|
|
9
|
+
export declare const IRegistryTypeEnum: {
|
|
10
|
+
AUTOMATIC: 'AUTOMATIC';
|
|
11
|
+
MANUAL: 'MANUAL';
|
|
12
|
+
};
|
|
13
|
+
export type IRegistryType = (typeof IRegistryTypeEnum)[keyof typeof IRegistryTypeEnum];
|
|
14
|
+
export declare const registryTypes: string[];
|
|
15
|
+
export declare const ITimesheetStateEnum: {
|
|
16
|
+
CONFIRMED: 'CONFIRMED';
|
|
17
|
+
PENDING: 'PENDING';
|
|
18
|
+
ERROR: 'ERROR';
|
|
19
|
+
};
|
|
20
|
+
export type ITimesheetState = (typeof ITimesheetStateEnum)[keyof typeof ITimesheetStateEnum];
|
|
21
|
+
export declare const timesheetStates: string[];
|
|
22
|
+
export type DayEntity = TimeSheetDay;
|
|
23
|
+
export type ClockEntity = TimeSheetClock;
|
|
24
|
+
export declare const DayRoute = "timesheet-days";
|
|
25
|
+
export declare const ClockRoute = "timesheet-clocks";
|
|
26
|
+
export interface IDayFilterRequest {
|
|
27
|
+
persona_id?: string;
|
|
28
|
+
start_date?: string;
|
|
29
|
+
end_date?: string;
|
|
30
|
+
state?: ITimesheetState;
|
|
31
|
+
}
|
|
32
|
+
export interface IDayCreateRequest {
|
|
33
|
+
date: Date;
|
|
34
|
+
persona_id: string;
|
|
35
|
+
total_worked?: number;
|
|
36
|
+
balance?: number;
|
|
37
|
+
state?: ITimesheetState;
|
|
38
|
+
}
|
|
39
|
+
export interface IDayUpdateRequest {
|
|
40
|
+
total_worked?: number;
|
|
41
|
+
balance?: number;
|
|
42
|
+
state?: ITimesheetState;
|
|
43
|
+
}
|
|
44
|
+
export interface IClockCreateRequest {
|
|
45
|
+
timesheet_day_id: string;
|
|
46
|
+
time?: Date;
|
|
47
|
+
type: IClockType;
|
|
48
|
+
registry_type: IRegistryType;
|
|
49
|
+
}
|
|
50
|
+
export interface IClockUpdateRequest {
|
|
51
|
+
time?: Date;
|
|
52
|
+
type?: IClockType;
|
|
53
|
+
registry_type?: IRegistryType;
|
|
54
|
+
}
|
|
55
|
+
export interface IDayRepository {
|
|
56
|
+
find(filters?: IDayFilterRequest): Promise<DayEntity[]>;
|
|
57
|
+
findById(id: string): Promise<DayEntity | null>;
|
|
58
|
+
create(data: IDayCreateRequest): Promise<DayEntity>;
|
|
59
|
+
update(selector: IShared.IFindByIdRequest, data: IDayUpdateRequest): Promise<DayEntity | null>;
|
|
60
|
+
deleteOne(selector: IShared.IFindByIdRequest): Promise<DayEntity | null>;
|
|
61
|
+
}
|
|
62
|
+
export interface IClockRepository {
|
|
63
|
+
find(filters?: {
|
|
64
|
+
timesheet_day_id: string;
|
|
65
|
+
}): Promise<ClockEntity[]>;
|
|
66
|
+
findById(id: string): Promise<ClockEntity | null>;
|
|
67
|
+
create(data: IClockCreateRequest): Promise<ClockEntity>;
|
|
68
|
+
update(selector: IShared.IFindByIdRequest, data: IClockUpdateRequest): Promise<ClockEntity | null>;
|
|
69
|
+
deleteOne(selector: IShared.IFindByIdRequest): Promise<ClockEntity | null>;
|
|
70
|
+
}
|
|
71
|
+
export type IDayController = IShared.IEntityWithUserToken<IDayRepository>;
|
|
72
|
+
export type IDayApi = Omit<IDayRepository, 'findById'>;
|
|
73
|
+
export type IClockController = IShared.IEntityWithUserToken<IClockRepository>;
|
|
74
|
+
export type IClockApi = Omit<IClockRepository, 'findById'>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IPaymentMethodsSaftCodeEnum } from '../../modules/user/paymentMethods/interfaces';
|
|
2
2
|
import type { SystemModuleEnum } from '../../modules/user/systemModule/interface';
|
|
3
|
+
import { IClockType, IRegistryType, ITimesheetState } from '../../modules/user/timeSheet/interfaces';
|
|
3
4
|
/**
|
|
4
5
|
* Model Users
|
|
5
6
|
*
|
|
@@ -520,3 +521,29 @@ export type SystemModule = {
|
|
|
520
521
|
created_by: string;
|
|
521
522
|
updated_by: string;
|
|
522
523
|
};
|
|
524
|
+
/**
|
|
525
|
+
* Model TimeSheet
|
|
526
|
+
*
|
|
527
|
+
*/
|
|
528
|
+
export interface TimeSheetDay {
|
|
529
|
+
id: string;
|
|
530
|
+
date: Date;
|
|
531
|
+
total_worked: number;
|
|
532
|
+
balance: number;
|
|
533
|
+
state: ITimesheetState;
|
|
534
|
+
created_at: Date;
|
|
535
|
+
updated_at: Date;
|
|
536
|
+
created_by: string;
|
|
537
|
+
updated_by: string;
|
|
538
|
+
}
|
|
539
|
+
export interface TimeSheetClock {
|
|
540
|
+
id: string;
|
|
541
|
+
timesheet_day_id: string;
|
|
542
|
+
time: Date;
|
|
543
|
+
type: IClockType;
|
|
544
|
+
registry_type: IRegistryType;
|
|
545
|
+
created_at: Date;
|
|
546
|
+
updated_at: Date;
|
|
547
|
+
created_by: string;
|
|
548
|
+
updated_by: string;
|
|
549
|
+
}
|
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.56",
|
|
5
5
|
"author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|