@nomalism-com/types 0.46.2 → 0.46.4

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
@@ -4519,7 +4519,8 @@ __export(route_schema_exports81, {
4519
4519
  import joi82 from "joi";
4520
4520
  var finalizarEntradaDeMaterialBodyKeys = {
4521
4521
  provider_id: joi82.string().uuid().required(),
4522
- saved_em_picking_ids: joi82.array().items(joi82.string().uuid().required()).optional()
4522
+ saved_em_picking_ids: joi82.array().items(joi82.string().uuid().required()).optional(),
4523
+ store_operator_id: joi82.string().uuid().required()
4523
4524
  };
4524
4525
  var finalizarEntradaDeMaterialBody = joi82.object().keys(finalizarEntradaDeMaterialBodyKeys).messages(messages);
4525
4526
  var undoEntradaDeMaterialBodyKeys = {
@@ -5842,10 +5843,12 @@ var printLocationsQuery = joi118.object({
5842
5843
  // src/modules/user/timeSheet/interfaces.ts
5843
5844
  var interfaces_exports61 = {};
5844
5845
  __export(interfaces_exports61, {
5846
+ IAdjustmentTypeEnum: () => IAdjustmentTypeEnum,
5845
5847
  IClockTypeEnum: () => IClockTypeEnum,
5846
5848
  IRegistryTypeEnum: () => IRegistryTypeEnum,
5847
5849
  ITimesheetStateEnum: () => ITimesheetStateEnum,
5848
5850
  Route: () => Route131,
5851
+ adjustmentTypes: () => adjustmentTypes,
5849
5852
  clockTypes: () => clockTypes,
5850
5853
  registryTypes: () => registryTypes,
5851
5854
  timesheetStates: () => timesheetStates
@@ -5856,6 +5859,11 @@ var IClockTypeEnum = {
5856
5859
  EXIT: "EXIT"
5857
5860
  };
5858
5861
  var clockTypes = Object.keys(IClockTypeEnum);
5862
+ var IAdjustmentTypeEnum = {
5863
+ CREDIT: "CREDIT",
5864
+ DEBIT: "DEBIT"
5865
+ };
5866
+ var adjustmentTypes = Object.keys(IAdjustmentTypeEnum);
5859
5867
  var IRegistryTypeEnum = {
5860
5868
  AUTOMATIC: "AUTOMATIC",
5861
5869
  MANUAL: "MANUAL"
@@ -5882,9 +5890,16 @@ var clockSchema = joi119.object({
5882
5890
  registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
5883
5891
  note: joi119.string().allow("", null).optional(),
5884
5892
  created_by: joi119.string().uuid().required(),
5885
- // 👈 Adicionado para auditoria nos updates
5886
5893
  updated_by: joi119.string().uuid().required()
5887
- // 👈 Adicionado para auditoria nos updates
5894
+ });
5895
+ var adjustmentSchema = joi119.object({
5896
+ id: joi119.string().uuid(),
5897
+ type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
5898
+ minutes: joi119.number().integer().min(1).required(),
5899
+ // Mínimo 1 minuto de ajuste
5900
+ note: joi119.string().allow("", null).optional(),
5901
+ created_by: joi119.string().uuid().required(),
5902
+ updated_by: joi119.string().uuid().required()
5888
5903
  });
5889
5904
  var createBodyKeys64 = {
5890
5905
  date: joi119.date().required(),
@@ -5893,19 +5908,22 @@ var createBodyKeys64 = {
5893
5908
  balance: joi119.number().integer(),
5894
5909
  state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
5895
5910
  created_by: joi119.string().uuid().required(),
5896
- // 👈 Adicionado na raiz do dia
5897
5911
  updated_by: joi119.string().uuid().required(),
5898
- // 👈 Adicionado na raiz do dia
5899
- // Objeto opcional para quando se cria o dia já com a primeira picagem
5900
5912
  clock: joi119.object({
5901
5913
  time: joi119.date(),
5902
5914
  type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
5903
5915
  registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
5904
5916
  note: joi119.string().allow("", null).optional(),
5905
5917
  created_by: joi119.string().uuid().required(),
5906
- // 👈 Adicionado no clock interno
5907
5918
  updated_by: joi119.string().uuid().required()
5908
- // 👈 Adicionado no clock interno
5919
+ }),
5920
+ // 🔥 NOVO: Validador do objeto opcional de acerto na criação do dia
5921
+ adjustment: joi119.object({
5922
+ type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
5923
+ minutes: joi119.number().integer().min(1).required(),
5924
+ note: joi119.string().allow("", null).optional(),
5925
+ created_by: joi119.string().uuid().required(),
5926
+ updated_by: joi119.string().uuid().required()
5909
5927
  })
5910
5928
  };
5911
5929
  var createBody65 = joi119.object().keys(createBodyKeys64).messages(messages);
@@ -5914,11 +5932,10 @@ var updateBodyKeys54 = {
5914
5932
  balance: joi119.number().integer(),
5915
5933
  state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
5916
5934
  created_by: joi119.string().uuid().optional(),
5917
- // 💡 Opcional no update para manter o original se quiseres
5918
5935
  updated_by: joi119.string().uuid().required(),
5919
- // 👈 Obrigatório no update do dia
5920
- // Array de picagens enviado pelo formulário de edição
5921
- clocks: joi119.array().items(clockSchema)
5936
+ clocks: joi119.array().items(clockSchema),
5937
+ // 🔥 NOVO: Validador do array de acertos extraordinários enviados via PUT
5938
+ adjustments: joi119.array().items(adjustmentSchema)
5922
5939
  };
5923
5940
  var updateBody56 = joi119.object().keys(updateBodyKeys54).messages(messages);
5924
5941
 
package/dist/index.js CHANGED
@@ -4519,7 +4519,8 @@ __export(route_schema_exports81, {
4519
4519
  import joi82 from "joi";
4520
4520
  var finalizarEntradaDeMaterialBodyKeys = {
4521
4521
  provider_id: joi82.string().uuid().required(),
4522
- saved_em_picking_ids: joi82.array().items(joi82.string().uuid().required()).optional()
4522
+ saved_em_picking_ids: joi82.array().items(joi82.string().uuid().required()).optional(),
4523
+ store_operator_id: joi82.string().uuid().required()
4523
4524
  };
4524
4525
  var finalizarEntradaDeMaterialBody = joi82.object().keys(finalizarEntradaDeMaterialBodyKeys).messages(messages);
4525
4526
  var undoEntradaDeMaterialBodyKeys = {
@@ -5842,10 +5843,12 @@ var printLocationsQuery = joi118.object({
5842
5843
  // src/modules/user/timeSheet/interfaces.ts
5843
5844
  var interfaces_exports61 = {};
5844
5845
  __export(interfaces_exports61, {
5846
+ IAdjustmentTypeEnum: () => IAdjustmentTypeEnum,
5845
5847
  IClockTypeEnum: () => IClockTypeEnum,
5846
5848
  IRegistryTypeEnum: () => IRegistryTypeEnum,
5847
5849
  ITimesheetStateEnum: () => ITimesheetStateEnum,
5848
5850
  Route: () => Route131,
5851
+ adjustmentTypes: () => adjustmentTypes,
5849
5852
  clockTypes: () => clockTypes,
5850
5853
  registryTypes: () => registryTypes,
5851
5854
  timesheetStates: () => timesheetStates
@@ -5856,6 +5859,11 @@ var IClockTypeEnum = {
5856
5859
  EXIT: "EXIT"
5857
5860
  };
5858
5861
  var clockTypes = Object.keys(IClockTypeEnum);
5862
+ var IAdjustmentTypeEnum = {
5863
+ CREDIT: "CREDIT",
5864
+ DEBIT: "DEBIT"
5865
+ };
5866
+ var adjustmentTypes = Object.keys(IAdjustmentTypeEnum);
5859
5867
  var IRegistryTypeEnum = {
5860
5868
  AUTOMATIC: "AUTOMATIC",
5861
5869
  MANUAL: "MANUAL"
@@ -5882,9 +5890,16 @@ var clockSchema = joi119.object({
5882
5890
  registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
5883
5891
  note: joi119.string().allow("", null).optional(),
5884
5892
  created_by: joi119.string().uuid().required(),
5885
- // 👈 Adicionado para auditoria nos updates
5886
5893
  updated_by: joi119.string().uuid().required()
5887
- // 👈 Adicionado para auditoria nos updates
5894
+ });
5895
+ var adjustmentSchema = joi119.object({
5896
+ id: joi119.string().uuid(),
5897
+ type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
5898
+ minutes: joi119.number().integer().min(1).required(),
5899
+ // Mínimo 1 minuto de ajuste
5900
+ note: joi119.string().allow("", null).optional(),
5901
+ created_by: joi119.string().uuid().required(),
5902
+ updated_by: joi119.string().uuid().required()
5888
5903
  });
5889
5904
  var createBodyKeys64 = {
5890
5905
  date: joi119.date().required(),
@@ -5893,19 +5908,22 @@ var createBodyKeys64 = {
5893
5908
  balance: joi119.number().integer(),
5894
5909
  state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
5895
5910
  created_by: joi119.string().uuid().required(),
5896
- // 👈 Adicionado na raiz do dia
5897
5911
  updated_by: joi119.string().uuid().required(),
5898
- // 👈 Adicionado na raiz do dia
5899
- // Objeto opcional para quando se cria o dia já com a primeira picagem
5900
5912
  clock: joi119.object({
5901
5913
  time: joi119.date(),
5902
5914
  type: joi119.string().valid(...Object.values(IClockTypeEnum)).required(),
5903
5915
  registry_type: joi119.string().valid(...Object.values(IRegistryTypeEnum)).required(),
5904
5916
  note: joi119.string().allow("", null).optional(),
5905
5917
  created_by: joi119.string().uuid().required(),
5906
- // 👈 Adicionado no clock interno
5907
5918
  updated_by: joi119.string().uuid().required()
5908
- // 👈 Adicionado no clock interno
5919
+ }),
5920
+ // 🔥 NOVO: Validador do objeto opcional de acerto na criação do dia
5921
+ adjustment: joi119.object({
5922
+ type: joi119.string().valid(...Object.values(IAdjustmentTypeEnum)).required(),
5923
+ minutes: joi119.number().integer().min(1).required(),
5924
+ note: joi119.string().allow("", null).optional(),
5925
+ created_by: joi119.string().uuid().required(),
5926
+ updated_by: joi119.string().uuid().required()
5909
5927
  })
5910
5928
  };
5911
5929
  var createBody65 = joi119.object().keys(createBodyKeys64).messages(messages);
@@ -5914,11 +5932,10 @@ var updateBodyKeys54 = {
5914
5932
  balance: joi119.number().integer(),
5915
5933
  state: joi119.string().valid(...Object.values(ITimesheetStateEnum)),
5916
5934
  created_by: joi119.string().uuid().optional(),
5917
- // 💡 Opcional no update para manter o original se quiseres
5918
5935
  updated_by: joi119.string().uuid().required(),
5919
- // 👈 Obrigatório no update do dia
5920
- // Array de picagens enviado pelo formulário de edição
5921
- clocks: joi119.array().items(clockSchema)
5936
+ clocks: joi119.array().items(clockSchema),
5937
+ // 🔥 NOVO: Validador do array de acertos extraordinários enviados via PUT
5938
+ adjustments: joi119.array().items(adjustmentSchema)
5922
5939
  };
5923
5940
  var updateBody56 = joi119.object().keys(updateBodyKeys54).messages(messages);
5924
5941
 
@@ -97,6 +97,7 @@ export interface IUndoEntradaDeMaterialRequest {
97
97
  export interface IFinalizarEntradaDeMaterialRequest {
98
98
  provider_id: string;
99
99
  saved_em_picking_ids?: string[];
100
+ store_operator_id: string;
100
101
  }
101
102
  export interface IFinalizarEntradaDeMaterialResponse {
102
103
  broker_messages: IShared.IBrokerMessage<IShared.IBrokerTopic>[];
@@ -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,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 { IClockType, IRegistryType, ITimesheetState } from '../../modules/user/timeSheet/interfaces';
4
+ import { IClockType, IRegistryType, ITimesheetState, IAdjustmentType } from '../../modules/user/timeSheet/interfaces';
5
5
  /**
6
6
  * Model Users
7
7
  *
@@ -510,3 +510,14 @@ export interface TimeSheetClock {
510
510
  created_by: string;
511
511
  updated_by: string;
512
512
  }
513
+ export interface TimeSheetAdjustment {
514
+ id: string;
515
+ timesheet_day_id: string;
516
+ type: IAdjustmentType;
517
+ minutes: number;
518
+ note: string | null;
519
+ created_at: Date;
520
+ updated_at: Date;
521
+ created_by: string;
522
+ updated_by: string;
523
+ }
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.2",
4
+ "version": "0.46.4",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",