@nomalism-com/types 0.45.68 → 0.45.69

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,10 +5812,12 @@ var printLocationsQuery = joi118.object({
5812
5812
  // src/modules/user/timeSheet/interfaces.ts
5813
5813
  var interfaces_exports61 = {};
5814
5814
  __export(interfaces_exports61, {
5815
+ IAdjustmentTypeEnum: () => IAdjustmentTypeEnum,
5815
5816
  IClockTypeEnum: () => IClockTypeEnum,
5816
5817
  IRegistryTypeEnum: () => IRegistryTypeEnum,
5817
5818
  ITimesheetStateEnum: () => ITimesheetStateEnum,
5818
5819
  Route: () => Route131,
5820
+ adjustmentTypes: () => adjustmentTypes,
5819
5821
  clockTypes: () => clockTypes,
5820
5822
  registryTypes: () => registryTypes,
5821
5823
  timesheetStates: () => timesheetStates
@@ -5826,6 +5828,11 @@ var IClockTypeEnum = {
5826
5828
  EXIT: "EXIT"
5827
5829
  };
5828
5830
  var clockTypes = Object.keys(IClockTypeEnum);
5831
+ var IAdjustmentTypeEnum = {
5832
+ CREDIT: "CREDIT",
5833
+ DEBIT: "DEBIT"
5834
+ };
5835
+ var adjustmentTypes = Object.keys(IAdjustmentTypeEnum);
5829
5836
  var IRegistryTypeEnum = {
5830
5837
  AUTOMATIC: "AUTOMATIC",
5831
5838
  MANUAL: "MANUAL"
@@ -5852,9 +5859,16 @@ var clockSchema = joi119.object({
5852
5859
  registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
5853
5860
  note: joi119.string().allow("", null).optional(),
5854
5861
  created_by: joi119.string().uuid().required(),
5855
- // 👈 Adicionado para auditoria nos updates
5856
5862
  updated_by: joi119.string().uuid().required()
5857
- // 👈 Adicionado para auditoria nos updates
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()
5858
5872
  });
5859
5873
  var createBodyKeys64 = {
5860
5874
  date: joi119.date().required(),
@@ -5863,19 +5877,22 @@ var createBodyKeys64 = {
5863
5877
  balance: joi119.number().integer(),
5864
5878
  state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
5865
5879
  created_by: joi119.string().uuid().required(),
5866
- // 👈 Adicionado na raiz do dia
5867
5880
  updated_by: joi119.string().uuid().required(),
5868
- // 👈 Adicionado na raiz do dia
5869
- // Objeto opcional para quando se cria o dia já com a primeira picagem
5870
5881
  clock: joi119.object({
5871
5882
  time: joi119.date(),
5872
5883
  type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
5873
5884
  registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
5874
5885
  note: joi119.string().allow("", null).optional(),
5875
5886
  created_by: joi119.string().uuid().required(),
5876
- // 👈 Adicionado no clock interno
5877
5887
  updated_by: joi119.string().uuid().required()
5878
- // 👈 Adicionado no clock interno
5888
+ }),
5889
+ // 🔥 NOVO: Validador do objeto opcional de acerto na criação do dia
5890
+ adjustment: joi119.object({
5891
+ type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
5892
+ minutes: joi119.number().integer().min(1).required(),
5893
+ note: joi119.string().allow("", null).optional(),
5894
+ created_by: joi119.string().uuid().required(),
5895
+ updated_by: joi119.string().uuid().required()
5879
5896
  })
5880
5897
  };
5881
5898
  var createBody65 = joi119.object().keys(createBodyKeys64).messages(messages);
@@ -5884,11 +5901,10 @@ var updateBodyKeys54 = {
5884
5901
  balance: joi119.number().integer(),
5885
5902
  state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
5886
5903
  created_by: joi119.string().uuid().optional(),
5887
- // 💡 Opcional no update para manter o original se quiseres
5888
5904
  updated_by: joi119.string().uuid().required(),
5889
- // 👈 Obrigatório no update do dia
5890
- // Array de picagens enviado pelo formulário de edição
5891
- clocks: joi119.array().items(clockSchema)
5905
+ clocks: joi119.array().items(clockSchema),
5906
+ // 🔥 NOVO: Validador do array de acertos extraordinários enviados via PUT
5907
+ adjustments: joi119.array().items(adjustmentSchema)
5892
5908
  };
5893
5909
  var updateBody56 = joi119.object().keys(updateBodyKeys54).messages(messages);
5894
5910
 
package/dist/index.js CHANGED
@@ -5812,10 +5812,12 @@ var printLocationsQuery = joi118.object({
5812
5812
  // src/modules/user/timeSheet/interfaces.ts
5813
5813
  var interfaces_exports61 = {};
5814
5814
  __export(interfaces_exports61, {
5815
+ IAdjustmentTypeEnum: () => IAdjustmentTypeEnum,
5815
5816
  IClockTypeEnum: () => IClockTypeEnum,
5816
5817
  IRegistryTypeEnum: () => IRegistryTypeEnum,
5817
5818
  ITimesheetStateEnum: () => ITimesheetStateEnum,
5818
5819
  Route: () => Route131,
5820
+ adjustmentTypes: () => adjustmentTypes,
5819
5821
  clockTypes: () => clockTypes,
5820
5822
  registryTypes: () => registryTypes,
5821
5823
  timesheetStates: () => timesheetStates
@@ -5826,6 +5828,11 @@ var IClockTypeEnum = {
5826
5828
  EXIT: "EXIT"
5827
5829
  };
5828
5830
  var clockTypes = Object.keys(IClockTypeEnum);
5831
+ var IAdjustmentTypeEnum = {
5832
+ CREDIT: "CREDIT",
5833
+ DEBIT: "DEBIT"
5834
+ };
5835
+ var adjustmentTypes = Object.keys(IAdjustmentTypeEnum);
5829
5836
  var IRegistryTypeEnum = {
5830
5837
  AUTOMATIC: "AUTOMATIC",
5831
5838
  MANUAL: "MANUAL"
@@ -5852,9 +5859,16 @@ var clockSchema = joi119.object({
5852
5859
  registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
5853
5860
  note: joi119.string().allow("", null).optional(),
5854
5861
  created_by: joi119.string().uuid().required(),
5855
- // 👈 Adicionado para auditoria nos updates
5856
5862
  updated_by: joi119.string().uuid().required()
5857
- // 👈 Adicionado para auditoria nos updates
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()
5858
5872
  });
5859
5873
  var createBodyKeys64 = {
5860
5874
  date: joi119.date().required(),
@@ -5863,19 +5877,22 @@ var createBodyKeys64 = {
5863
5877
  balance: joi119.number().integer(),
5864
5878
  state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
5865
5879
  created_by: joi119.string().uuid().required(),
5866
- // 👈 Adicionado na raiz do dia
5867
5880
  updated_by: joi119.string().uuid().required(),
5868
- // 👈 Adicionado na raiz do dia
5869
- // Objeto opcional para quando se cria o dia já com a primeira picagem
5870
5881
  clock: joi119.object({
5871
5882
  time: joi119.date(),
5872
5883
  type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
5873
5884
  registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
5874
5885
  note: joi119.string().allow("", null).optional(),
5875
5886
  created_by: joi119.string().uuid().required(),
5876
- // 👈 Adicionado no clock interno
5877
5887
  updated_by: joi119.string().uuid().required()
5878
- // 👈 Adicionado no clock interno
5888
+ }),
5889
+ // 🔥 NOVO: Validador do objeto opcional de acerto na criação do dia
5890
+ adjustment: joi119.object({
5891
+ type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
5892
+ minutes: joi119.number().integer().min(1).required(),
5893
+ note: joi119.string().allow("", null).optional(),
5894
+ created_by: joi119.string().uuid().required(),
5895
+ updated_by: joi119.string().uuid().required()
5879
5896
  })
5880
5897
  };
5881
5898
  var createBody65 = joi119.object().keys(createBodyKeys64).messages(messages);
@@ -5884,11 +5901,10 @@ var updateBodyKeys54 = {
5884
5901
  balance: joi119.number().integer(),
5885
5902
  state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
5886
5903
  created_by: joi119.string().uuid().optional(),
5887
- // 💡 Opcional no update para manter o original se quiseres
5888
5904
  updated_by: joi119.string().uuid().required(),
5889
- // 👈 Obrigatório no update do dia
5890
- // Array de picagens enviado pelo formulário de edição
5891
- clocks: joi119.array().items(clockSchema)
5905
+ clocks: joi119.array().items(clockSchema),
5906
+ // 🔥 NOVO: Validador do array de acertos extraordinários enviados via PUT
5907
+ adjustments: joi119.array().items(adjustmentSchema)
5892
5908
  };
5893
5909
  var updateBody56 = joi119.object().keys(updateBodyKeys54).messages(messages);
5894
5910
 
@@ -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,6 +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
+ import { IClockType, IRegistryType, ITimesheetState, IAdjustmentType } from '../../modules/user/timeSheet/interfaces';
4
4
  /**
5
5
  * Model Users
6
6
  *
@@ -507,3 +507,14 @@ export interface TimeSheetClock {
507
507
  created_by: string;
508
508
  updated_by: string;
509
509
  }
510
+ export interface TimeSheetAdjustment {
511
+ id: string;
512
+ timesheet_day_id: string;
513
+ type: IAdjustmentType;
514
+ minutes: number;
515
+ note: string | null;
516
+ created_at: Date;
517
+ updated_at: Date;
518
+ created_by: string;
519
+ updated_by: string;
520
+ }
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.68",
4
+ "version": "0.45.69",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -29,15 +29,15 @@
29
29
  "joi": "^18.2.1"
30
30
  },
31
31
  "devDependencies": {
32
- "@swc/core": "^1.15.40",
33
- "@types/node": "^24.13.1",
32
+ "@swc/core": "^1.15.41",
33
+ "@types/node": "^24.13.2",
34
34
  "@typescript-eslint/eslint-plugin": "^8.61.0",
35
35
  "@typescript-eslint/parser": "^8.61.0",
36
36
  "eslint": "^9.39.4",
37
37
  "eslint-config-prettier": "^10.1.8",
38
38
  "eslint-import-resolver-typescript": "^4.4.5",
39
39
  "eslint-plugin-prettier": "^5.5.6",
40
- "prettier": "^3.8.3",
40
+ "prettier": "^3.8.4",
41
41
  "tsup": "^8.5.1"
42
42
  },
43
43
  "repository": {