@pksep/zod-shared 0.0.520 → 0.0.522

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.
Files changed (35) hide show
  1. package/dist/detal/schemas/detal-deficit.schema.d.ts +5 -0
  2. package/dist/detal/schemas/detal.schema.d.ts +5 -0
  3. package/dist/material/dto/create-subtype-material.dto.d.ts +3 -3
  4. package/dist/material/dto/create-subtype-material.dto.js +1 -1
  5. package/dist/metaloworking/schemas/metaloworking-by-operation.schema.d.ts +1 -1
  6. package/dist/production-tasks/dto/get-production-task-by-user.dto.d.ts +3 -0
  7. package/dist/production-tasks/dto/get-production-task-by-user.dto.js +1 -0
  8. package/dist/production-tasks/interfaces/production-tasks.d.ts +6 -4
  9. package/dist/production-tasks/schemas/operation-positions.schema.d.ts +3 -0
  10. package/dist/production-tasks/schemas/operation-positions.schema.js +1 -0
  11. package/dist/sclad/dto/set-warehouse-readiness-date.dto.d.ts +3 -3
  12. package/dist/sclad/dto/set-warehouse-readiness-date.dto.js +1 -1
  13. package/dist/sclad/index.d.ts +1 -0
  14. package/dist/sclad/index.js +1 -0
  15. package/dist/specification/schema/attributes.schema.d.ts +7 -0
  16. package/dist/stock-order/dto/create-stock-order.dto.d.ts +5 -0
  17. package/dist/stock-order/dto/update-stock-order.dto.d.ts +3 -3
  18. package/dist/stock-order/dto/update-stock-order.dto.js +1 -1
  19. package/dist/stock-order/schemas/stock-order-item.schema.d.ts +3 -0
  20. package/dist/stock-order/schemas/stock-order-item.schema.js +1 -0
  21. package/dist/stock-order/type/type.d.ts +3 -0
  22. package/dist/stock-order/type/type.js +2 -1
  23. package/dist/user/dto/get-one-user.dto.d.ts +16 -0
  24. package/dist/user/dto/get-one-user.dto.js +25 -0
  25. package/dist/user/index.d.ts +1 -0
  26. package/dist/user/index.js +1 -0
  27. package/dist/utils/date.methods.d.ts +7 -1
  28. package/dist/utils/date.methods.js +14 -1
  29. package/dist/utils/methods.d.ts +17 -11
  30. package/dist/utils/methods.js +15 -20
  31. package/dist/utils/operation.d.ts +1 -1
  32. package/dist/utils/tables-config/enum.d.ts +1 -0
  33. package/dist/utils/tables-config/enum.js +2 -0
  34. package/dist/utils/tables-config/tables-array.js +2 -0
  35. package/package.json +2 -2
@@ -861,6 +861,7 @@ export declare const DetalDeficitSchema: z.ZodObject<{
861
861
  type: z.ZodNativeEnum<typeof import("../..").IzdType>;
862
862
  ban: z.ZodDefault<z.ZodBoolean>;
863
863
  description: z.ZodOptional<z.ZodString>;
864
+ warehouse_readiness_date: z.ZodNullable<z.ZodDate>;
864
865
  detal_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
865
866
  cbed_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
866
867
  product_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -872,6 +873,7 @@ export declare const DetalDeficitSchema: z.ZodObject<{
872
873
  count_shipments: number;
873
874
  count_create: number;
874
875
  closing_date: Date | null;
876
+ warehouse_readiness_date: Date | null;
875
877
  description?: string | undefined;
876
878
  id?: number | null | undefined;
877
879
  cbed_id?: number | null | undefined;
@@ -882,6 +884,7 @@ export declare const DetalDeficitSchema: z.ZodObject<{
882
884
  stock_order_id: number;
883
885
  count_shipments: number;
884
886
  closing_date: Date | null;
887
+ warehouse_readiness_date: Date | null;
885
888
  ban?: boolean | undefined;
886
889
  description?: string | undefined;
887
890
  id?: number | null | undefined;
@@ -1428,6 +1431,7 @@ export declare const DetalDeficitSchema: z.ZodObject<{
1428
1431
  count_shipments: number;
1429
1432
  count_create: number;
1430
1433
  closing_date: Date | null;
1434
+ warehouse_readiness_date: Date | null;
1431
1435
  description?: string | undefined;
1432
1436
  id?: number | null | undefined;
1433
1437
  cbed_id?: number | null | undefined;
@@ -1741,6 +1745,7 @@ export declare const DetalDeficitSchema: z.ZodObject<{
1741
1745
  stock_order_id: number;
1742
1746
  count_shipments: number;
1743
1747
  closing_date: Date | null;
1748
+ warehouse_readiness_date: Date | null;
1744
1749
  ban?: boolean | undefined;
1745
1750
  description?: string | undefined;
1746
1751
  id?: number | null | undefined;
@@ -867,6 +867,7 @@ export declare const DetalSchema: z.ZodObject<{
867
867
  type: z.ZodNativeEnum<typeof IzdType>;
868
868
  ban: z.ZodDefault<z.ZodBoolean>;
869
869
  description: z.ZodOptional<z.ZodString>;
870
+ warehouse_readiness_date: z.ZodNullable<z.ZodDate>;
870
871
  detal_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
871
872
  cbed_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
872
873
  product_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -878,6 +879,7 @@ export declare const DetalSchema: z.ZodObject<{
878
879
  count_shipments: number;
879
880
  count_create: number;
880
881
  closing_date: Date | null;
882
+ warehouse_readiness_date: Date | null;
881
883
  description?: string | undefined;
882
884
  id?: number | null | undefined;
883
885
  cbed_id?: number | null | undefined;
@@ -888,6 +890,7 @@ export declare const DetalSchema: z.ZodObject<{
888
890
  stock_order_id: number;
889
891
  count_shipments: number;
890
892
  closing_date: Date | null;
893
+ warehouse_readiness_date: Date | null;
891
894
  ban?: boolean | undefined;
892
895
  description?: string | undefined;
893
896
  id?: number | null | undefined;
@@ -1287,6 +1290,7 @@ export declare const DetalSchema: z.ZodObject<{
1287
1290
  count_shipments: number;
1288
1291
  count_create: number;
1289
1292
  closing_date: Date | null;
1293
+ warehouse_readiness_date: Date | null;
1290
1294
  description?: string | undefined;
1291
1295
  id?: number | null | undefined;
1292
1296
  cbed_id?: number | null | undefined;
@@ -1568,6 +1572,7 @@ export declare const DetalSchema: z.ZodObject<{
1568
1572
  stock_order_id: number;
1569
1573
  count_shipments: number;
1570
1574
  closing_date: Date | null;
1575
+ warehouse_readiness_date: Date | null;
1571
1576
  ban?: boolean | undefined;
1572
1577
  description?: string | undefined;
1573
1578
  id?: number | null | undefined;
@@ -5,18 +5,18 @@ export declare const CreateSubtypeMaterialDtoZod: z.ZodObject<{
5
5
  density: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
6
6
  id: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
7
7
  instance_type: z.ZodNativeEnum<typeof InstansMaterial>;
8
- parentMaterialId: z.ZodAny;
8
+ parentMaterialIds: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>>;
9
9
  }, "strip", z.ZodTypeAny, {
10
10
  name: string;
11
11
  instance_type: InstansMaterial;
12
+ parentMaterialIds: number[] | null;
12
13
  id?: number | null | undefined;
13
14
  density?: number | null | undefined;
14
- parentMaterialId?: any;
15
15
  }, {
16
16
  name: string;
17
17
  instance_type: InstansMaterial;
18
18
  id?: number | null | undefined;
19
19
  density?: number | null | undefined;
20
- parentMaterialId?: any;
20
+ parentMaterialIds?: number[] | null | undefined;
21
21
  }>;
22
22
  export type CreateSubtypeMaterialDtoZodType = z.infer<typeof CreateSubtypeMaterialDtoZod>;
@@ -8,5 +8,5 @@ exports.CreateSubtypeMaterialDtoZod = zod_1.z.object({
8
8
  density: zod_1.z.number().optional().nullable(),
9
9
  id: zod_1.z.number().optional().nullable(),
10
10
  instance_type: zod_1.z.nativeEnum(utils_1.InstansMaterial),
11
- parentMaterialId: zod_1.z.any()
11
+ parentMaterialIds: zod_1.z.array(zod_1.z.number()).nullish().default([])
12
12
  });
@@ -59,7 +59,7 @@ export type ModelMetaloworkingByOperation = z.infer<typeof MetaloworkingByOperat
59
59
  shipment?: ModelShipments;
60
60
  entity?: ModelDetal;
61
61
  current?: ModelOperation & {
62
- createCount: number;
62
+ countCreated: number;
63
63
  };
64
64
  after?: ModelOperation;
65
65
  before?: ModelOperation;
@@ -2,6 +2,7 @@ import { z } from 'zod';
2
2
  export declare const GetProductionTaskByUserDtoZod: z.ZodObject<{
3
3
  userId: z.ZodNumber;
4
4
  searchString: z.ZodOptional<z.ZodString>;
5
+ page: z.ZodDefault<z.ZodNumber>;
5
6
  taskId: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
6
7
  onlyTOperation: z.ZodOptional<z.ZodNumber>;
7
8
  range: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -16,6 +17,7 @@ export declare const GetProductionTaskByUserDtoZod: z.ZodObject<{
16
17
  }>>>;
17
18
  }, "strip", z.ZodTypeAny, {
18
19
  userId: number;
20
+ page: number;
19
21
  searchString?: string | undefined;
20
22
  range?: {
21
23
  start?: any;
@@ -25,6 +27,7 @@ export declare const GetProductionTaskByUserDtoZod: z.ZodObject<{
25
27
  onlyTOperation?: number | undefined;
26
28
  }, {
27
29
  userId: number;
30
+ page?: number | undefined;
28
31
  searchString?: string | undefined;
29
32
  range?: {
30
33
  start?: any;
@@ -5,6 +5,7 @@ const zod_1 = require("zod");
5
5
  exports.GetProductionTaskByUserDtoZod = zod_1.z.object({
6
6
  userId: zod_1.z.number().int(),
7
7
  searchString: zod_1.z.string().optional(),
8
+ page: zod_1.z.number().int().min(0).default(0),
8
9
  taskId: zod_1.z.number().int().nullable().default(null).optional(),
9
10
  onlyTOperation: zod_1.z.number().int().optional(),
10
11
  range: zod_1.z
@@ -254,7 +254,7 @@ export interface IGetByEquipment {
254
254
  id: number;
255
255
  };
256
256
  detalIdx: number;
257
- calculatedCreateTime: number;
257
+ calculatedCreateTime: Date;
258
258
  remainingByProductionTask: number;
259
259
  calculateNeedsTime: number;
260
260
  mainShipment: ModelShipments | null;
@@ -263,7 +263,7 @@ export interface IGetByEquipment {
263
263
  prevOperation: ModelOperation | null;
264
264
  nextOperation: ModelOperation | null;
265
265
  orderedByCurrentTask: number;
266
- timeToPrepare: string;
266
+ timeToPrepare: number;
267
267
  operationQuantity: number;
268
268
  entityType: IzdType;
269
269
  planReadyTime: Date;
@@ -285,12 +285,14 @@ export interface IGetByUser {
285
285
  production_time_metalloworking: ProductionTimeType;
286
286
  production_time_assemble: ProductionTimeType;
287
287
  };
288
+ deltaTime: number;
289
+ isHasIncorrectDate: boolean;
288
290
  planReadyTime: Date;
289
291
  assembleTime: number;
290
292
  createTimeMax: number;
291
293
  metalloworkingTime: number;
292
294
  mainShipment: ModelShipments;
293
- calculatedCreateTime: number;
295
+ calculatedCreateTime: Date;
294
296
  responsibleUser: ModelUser;
295
297
  calculateNeedsTime: number;
296
298
  totalProductionTAskOrdered: number;
@@ -299,7 +301,7 @@ export interface IGetByUser {
299
301
  nextOperation: ModelOperation | null;
300
302
  remainingByProductionTask: number;
301
303
  myQuantity: number;
302
- timeToPrepare: string;
304
+ timeToPrepare: number;
303
305
  operationQuantity: number;
304
306
  entityType: IzdType;
305
307
  productionItemId: number;
@@ -14,6 +14,7 @@ export declare const OperationPositionSchema: z.ZodObject<{
14
14
  equipment_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
15
15
  production_operation_pos_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16
16
  operation_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
17
+ count_created: z.ZodDefault<z.ZodNumber>;
17
18
  plan_ready_time: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
18
19
  is_relevance: z.ZodDefault<z.ZodBoolean>;
19
20
  createdAt: z.ZodDate;
@@ -24,6 +25,7 @@ export declare const OperationPositionSchema: z.ZodObject<{
24
25
  createdAt: Date;
25
26
  updatedAt: Date;
26
27
  create_time_minutes: number;
28
+ count_created: number;
27
29
  is_relevance: boolean;
28
30
  user_id?: number | null | undefined;
29
31
  idx?: number | undefined;
@@ -46,6 +48,7 @@ export declare const OperationPositionSchema: z.ZodObject<{
46
48
  detal_idx?: number | undefined;
47
49
  create_time_minutes?: number | undefined;
48
50
  production_operation_pos_id?: number | null | undefined;
51
+ count_created?: number | undefined;
49
52
  plan_ready_time?: Date | null | undefined;
50
53
  is_relevance?: boolean | undefined;
51
54
  }>;
@@ -13,6 +13,7 @@ exports.OperationPositionSchema = zod_1.z.object({
13
13
  equipment_id: zod_1.z.number().int().nullish(),
14
14
  production_operation_pos_id: zod_1.z.number().nullish(),
15
15
  operation_id: zod_1.z.number().int().nullish(),
16
+ count_created: zod_1.z.number().int().nonnegative().default(0),
16
17
  plan_ready_time: zod_1.z.date().nullish(),
17
18
  is_relevance: zod_1.z.boolean().default(true),
18
19
  createdAt: zod_1.z.date(),
@@ -1,12 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  export declare const setWarehouseReadinessDateSchema: z.ZodObject<{
3
- id: z.ZodNumber;
3
+ stockOrderItemId: z.ZodNumber;
4
4
  date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5
5
  }, "strip", z.ZodTypeAny, {
6
- id: number;
6
+ stockOrderItemId: number;
7
7
  date?: string | null | undefined;
8
8
  }, {
9
- id: number;
9
+ stockOrderItemId: number;
10
10
  date?: string | null | undefined;
11
11
  }>;
12
12
  export type setWarehouseReadinessDateDto = z.infer<typeof setWarehouseReadinessDateSchema>;
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setWarehouseReadinessDateSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.setWarehouseReadinessDateSchema = zod_1.z.object({
6
- id: zod_1.z.number(),
6
+ stockOrderItemId: zod_1.z.number(),
7
7
  date: zod_1.z.string().nullish()
8
8
  });
@@ -7,3 +7,4 @@ export * from './dto/get-revision-history.dto';
7
7
  export * from './dto/need-by-parent.dto';
8
8
  export * from './dto/revision-update.dto';
9
9
  export * from './schemas/remain.schema';
10
+ export * from './dto/set-warehouse-readiness-date.dto';
@@ -23,3 +23,4 @@ __exportStar(require("./dto/get-revision-history.dto"), exports);
23
23
  __exportStar(require("./dto/need-by-parent.dto"), exports);
24
24
  __exportStar(require("./dto/revision-update.dto"), exports);
25
25
  __exportStar(require("./schemas/remain.schema"), exports);
26
+ __exportStar(require("./dto/set-warehouse-readiness-date.dto"), exports);
@@ -862,6 +862,7 @@ export declare const SpecificationAttributesSchema: z.ZodObject<{
862
862
  type: z.ZodNativeEnum<typeof import("../..").IzdType>;
863
863
  ban: z.ZodDefault<z.ZodBoolean>;
864
864
  description: z.ZodOptional<z.ZodString>;
865
+ warehouse_readiness_date: z.ZodNullable<z.ZodDate>;
865
866
  detal_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
866
867
  cbed_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
867
868
  product_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -873,6 +874,7 @@ export declare const SpecificationAttributesSchema: z.ZodObject<{
873
874
  count_shipments: number;
874
875
  count_create: number;
875
876
  closing_date: Date | null;
877
+ warehouse_readiness_date: Date | null;
876
878
  description?: string | undefined;
877
879
  id?: number | null | undefined;
878
880
  cbed_id?: number | null | undefined;
@@ -883,6 +885,7 @@ export declare const SpecificationAttributesSchema: z.ZodObject<{
883
885
  stock_order_id: number;
884
886
  count_shipments: number;
885
887
  closing_date: Date | null;
888
+ warehouse_readiness_date: Date | null;
886
889
  ban?: boolean | undefined;
887
890
  description?: string | undefined;
888
891
  id?: number | null | undefined;
@@ -1282,6 +1285,7 @@ export declare const SpecificationAttributesSchema: z.ZodObject<{
1282
1285
  count_shipments: number;
1283
1286
  count_create: number;
1284
1287
  closing_date: Date | null;
1288
+ warehouse_readiness_date: Date | null;
1285
1289
  description?: string | undefined;
1286
1290
  id?: number | null | undefined;
1287
1291
  cbed_id?: number | null | undefined;
@@ -1563,6 +1567,7 @@ export declare const SpecificationAttributesSchema: z.ZodObject<{
1563
1567
  stock_order_id: number;
1564
1568
  count_shipments: number;
1565
1569
  closing_date: Date | null;
1570
+ warehouse_readiness_date: Date | null;
1566
1571
  ban?: boolean | undefined;
1567
1572
  description?: string | undefined;
1568
1573
  id?: number | null | undefined;
@@ -2654,6 +2659,7 @@ export declare const SpecificationAttributesSchema: z.ZodObject<{
2654
2659
  count_shipments: number;
2655
2660
  count_create: number;
2656
2661
  closing_date: Date | null;
2662
+ warehouse_readiness_date: Date | null;
2657
2663
  description?: string | undefined;
2658
2664
  id?: number | null | undefined;
2659
2665
  cbed_id?: number | null | undefined;
@@ -3084,6 +3090,7 @@ export declare const SpecificationAttributesSchema: z.ZodObject<{
3084
3090
  stock_order_id: number;
3085
3091
  count_shipments: number;
3086
3092
  closing_date: Date | null;
3093
+ warehouse_readiness_date: Date | null;
3087
3094
  ban?: boolean | undefined;
3088
3095
  description?: string | undefined;
3089
3096
  id?: number | null | undefined;
@@ -16,12 +16,15 @@ export declare const CreateStockOrderDtoZod: z.ZodObject<{
16
16
  workersComplect: z.ZodArray<z.ZodObject<{
17
17
  my_kolvo: z.ZodNullable<z.ZodNumber>;
18
18
  object_id: z.ZodNumber;
19
+ warehouseReadinessDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
19
20
  }, "strip", z.ZodTypeAny, {
20
21
  my_kolvo: number | null;
21
22
  object_id: number;
23
+ warehouseReadinessDate?: string | null | undefined;
22
24
  }, {
23
25
  my_kolvo: number | null;
24
26
  object_id: number;
27
+ warehouseReadinessDate?: string | null | undefined;
25
28
  }>, "many">;
26
29
  }, "strip", z.ZodTypeAny, {
27
30
  workersData: {
@@ -32,6 +35,7 @@ export declare const CreateStockOrderDtoZod: z.ZodObject<{
32
35
  workersComplect: {
33
36
  my_kolvo: number | null;
34
37
  object_id: number;
38
+ warehouseReadinessDate?: string | null | undefined;
35
39
  }[];
36
40
  }, {
37
41
  workersData: {
@@ -42,6 +46,7 @@ export declare const CreateStockOrderDtoZod: z.ZodObject<{
42
46
  workersComplect: {
43
47
  my_kolvo: number | null;
44
48
  object_id: number;
49
+ warehouseReadinessDate?: string | null | undefined;
45
50
  }[];
46
51
  }>;
47
52
  export type CreateStockOrderDtoZodType = z.infer<typeof CreateStockOrderDtoZod>;
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  export declare const UpdateStockOrderDtoZod: z.ZodObject<{
3
- description: z.ZodString;
3
+ description: z.ZodOptional<z.ZodString>;
4
4
  }, "strip", z.ZodTypeAny, {
5
- description: string;
5
+ description?: string | undefined;
6
6
  }, {
7
- description: string;
7
+ description?: string | undefined;
8
8
  }>;
9
9
  export type UpdateStockOrderDtoZodType = z.infer<typeof UpdateStockOrderDtoZod>;
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UpdateStockOrderDtoZod = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.UpdateStockOrderDtoZod = zod_1.z.object({
6
- description: zod_1.z.string()
6
+ description: zod_1.z.string().optional()
7
7
  });
@@ -12,6 +12,7 @@ export declare const StockOrderItemSchema: z.ZodObject<{
12
12
  type: z.ZodNativeEnum<typeof IzdType>;
13
13
  ban: z.ZodDefault<z.ZodBoolean>;
14
14
  description: z.ZodOptional<z.ZodString>;
15
+ warehouse_readiness_date: z.ZodNullable<z.ZodDate>;
15
16
  detal_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16
17
  cbed_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
17
18
  product_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -23,6 +24,7 @@ export declare const StockOrderItemSchema: z.ZodObject<{
23
24
  count_shipments: number;
24
25
  count_create: number;
25
26
  closing_date: Date | null;
27
+ warehouse_readiness_date: Date | null;
26
28
  description?: string | undefined;
27
29
  id?: number | null | undefined;
28
30
  cbed_id?: number | null | undefined;
@@ -33,6 +35,7 @@ export declare const StockOrderItemSchema: z.ZodObject<{
33
35
  stock_order_id: number;
34
36
  count_shipments: number;
35
37
  closing_date: Date | null;
38
+ warehouse_readiness_date: Date | null;
36
39
  ban?: boolean | undefined;
37
40
  description?: string | undefined;
38
41
  id?: number | null | undefined;
@@ -11,6 +11,7 @@ exports.StockOrderItemSchema = zod_1.z.object({
11
11
  type: zod_1.z.nativeEnum(utils_1.IzdType),
12
12
  ban: zod_1.z.boolean().default(false),
13
13
  description: zod_1.z.string().optional(),
14
+ warehouse_readiness_date: zod_1.z.coerce.date().nullable(),
14
15
  detal_id: zod_1.z.number().nullish(),
15
16
  cbed_id: zod_1.z.number().nullish(),
16
17
  product_id: zod_1.z.number().nullish(),
@@ -3,12 +3,15 @@ import { IzdType } from '../../utils';
3
3
  export declare const StockOrderComplectZod: z.ZodObject<{
4
4
  my_kolvo: z.ZodNullable<z.ZodNumber>;
5
5
  object_id: z.ZodNumber;
6
+ warehouseReadinessDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
7
  }, "strip", z.ZodTypeAny, {
7
8
  my_kolvo: number | null;
8
9
  object_id: number;
10
+ warehouseReadinessDate?: string | null | undefined;
9
11
  }, {
10
12
  my_kolvo: number | null;
11
13
  object_id: number;
14
+ warehouseReadinessDate?: string | null | undefined;
12
15
  }>;
13
16
  export declare const StockOrderDataZod: z.ZodObject<{
14
17
  date_order: z.ZodAny;
@@ -5,7 +5,8 @@ const zod_1 = require("zod");
5
5
  const utils_1 = require("../../utils");
6
6
  exports.StockOrderComplectZod = zod_1.z.object({
7
7
  my_kolvo: zod_1.z.number().nullable(),
8
- object_id: zod_1.z.number().int().positive()
8
+ object_id: zod_1.z.number().int().positive(),
9
+ warehouseReadinessDate: zod_1.z.string().nullish()
9
10
  });
10
11
  exports.StockOrderDataZod = zod_1.z.object({
11
12
  date_order: zod_1.z.any(),
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ export declare const UserIncludeSchema: z.ZodEnum<["role", "documents", "avatars", "detals", "cbeds", "products", "equipments", "actions", "actionsUser", "responsibleForProduct", "responsibleForDocuments", "typeOperations", "tableConfigs"]>;
3
+ export declare const GetOneUserDtoSchema: z.ZodObject<{
4
+ id: z.ZodNumber;
5
+ includes: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["role", "documents", "avatars", "detals", "cbeds", "products", "equipments", "actions", "actionsUser", "responsibleForProduct", "responsibleForDocuments", "typeOperations", "tableConfigs"]>, "many">>>, ("role" | "documents" | "equipments" | "actions" | "products" | "cbeds" | "responsibleForProduct" | "responsibleForDocuments" | "typeOperations" | "detals" | "avatars" | "actionsUser" | "tableConfigs")[], unknown>;
6
+ attributes: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>, string[], unknown>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ includes: ("role" | "documents" | "equipments" | "actions" | "products" | "cbeds" | "responsibleForProduct" | "responsibleForDocuments" | "typeOperations" | "detals" | "avatars" | "actionsUser" | "tableConfigs")[];
9
+ id: number;
10
+ attributes: string[];
11
+ }, {
12
+ id: number;
13
+ includes?: unknown;
14
+ attributes?: unknown;
15
+ }>;
16
+ export type GetOneUserDtoType = z.infer<typeof GetOneUserDtoSchema>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetOneUserDtoSchema = exports.UserIncludeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const utils_1 = require("../../utils");
6
+ exports.UserIncludeSchema = zod_1.z.enum([
7
+ 'role',
8
+ 'documents',
9
+ 'avatars',
10
+ 'detals',
11
+ 'cbeds',
12
+ 'products',
13
+ 'equipments',
14
+ 'actions',
15
+ 'actionsUser',
16
+ 'responsibleForProduct',
17
+ 'responsibleForDocuments',
18
+ 'typeOperations',
19
+ 'tableConfigs'
20
+ ]);
21
+ exports.GetOneUserDtoSchema = zod_1.z.object({
22
+ id: zod_1.z.number(),
23
+ includes: zod_1.z.preprocess(value => typeof value === 'string' ? (0, utils_1.parseParamsOrBody)({ value }, []) : value, zod_1.z.array(exports.UserIncludeSchema).optional().default([])),
24
+ attributes: zod_1.z.preprocess(value => typeof value === 'string' ? (0, utils_1.parseParamsOrBody)({ value }, []) : value, zod_1.z.array(zod_1.z.string()).optional().default([]))
25
+ });
@@ -1,6 +1,7 @@
1
1
  export * from './dto/add-role.dto';
2
2
  export * from './dto/ban-user.dto';
3
3
  export * from './dto/get-users.dto';
4
+ export * from './dto/get-one-user.dto';
4
5
  export * from './dto/create-user.dto';
5
6
  export * from './schemas/user.schema';
6
7
  export * from './interfaces/create-user.interface';
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./dto/add-role.dto"), exports);
18
18
  __exportStar(require("./dto/ban-user.dto"), exports);
19
19
  __exportStar(require("./dto/get-users.dto"), exports);
20
+ __exportStar(require("./dto/get-one-user.dto"), exports);
20
21
  __exportStar(require("./dto/create-user.dto"), exports);
21
22
  __exportStar(require("./schemas/user.schema"), exports);
22
23
  __exportStar(require("./interfaces/create-user.interface"), exports);
@@ -28,7 +28,13 @@ export declare class DateMethods {
28
28
  * @param planReadyTime
29
29
  * @returns
30
30
  */
31
- calculateDeltaTime: (calculatedCreateTime: Date, planReadyTime: Date) => number;
31
+ calculateDeltaTime: (calculatedCreateTime: Date, planReadyTime: Date, config?: {
32
+ holidays?: Array<{
33
+ month: number;
34
+ day: number;
35
+ }>;
36
+ skipDefaultJanuaryHolidays?: boolean;
37
+ }) => number;
32
38
  /**
33
39
  * Функция возвращает текущее время в UTC формате
34
40
  * @param config
@@ -54,7 +54,7 @@ class DateMethods {
54
54
  * @param planReadyTime
55
55
  * @returns
56
56
  */
57
- this.calculateDeltaTime = (calculatedCreateTime, planReadyTime) => {
57
+ this.calculateDeltaTime = (calculatedCreateTime, planReadyTime, config) => {
58
58
  const calculatedCreateTimeDate = new Date(calculatedCreateTime);
59
59
  const planReadyTimeDate = new Date(planReadyTime);
60
60
  const sign = calculatedCreateTimeDate <= planReadyTimeDate ? 1 : -1;
@@ -68,7 +68,20 @@ class DateMethods {
68
68
  const workDayHours = 8;
69
69
  const workDayEndHour = workDayStartHour + workDayHours;
70
70
  const isWorkDay = (date) => {
71
+ var _a, _b;
71
72
  const dayOfWeek = date.getUTCDay();
73
+ const month = date.getUTCMonth();
74
+ const day = date.getUTCDate();
75
+ const skipJanuary = (_a = config === null || config === void 0 ? void 0 : config.skipDefaultJanuaryHolidays) !== null && _a !== void 0 ? _a : true;
76
+ if (skipJanuary && month === 0 && day >= 1 && day <= 14) {
77
+ return false;
78
+ }
79
+ if ((_b = config === null || config === void 0 ? void 0 : config.holidays) === null || _b === void 0 ? void 0 : _b.length) {
80
+ const isHoliday = config.holidays.some((h) => h.month === month && h.day === day);
81
+ if (isHoliday) {
82
+ return false;
83
+ }
84
+ }
72
85
  return dayOfWeek !== 0 && dayOfWeek !== 6;
73
86
  };
74
87
  let totalMinutes = 0;
@@ -40,21 +40,27 @@ export declare const leftToDoByProductionTask: (marks: ModelMarks[], myQuantity:
40
40
  * @param startDate
41
41
  * @param totalMinutes
42
42
  * @returns
43
- * Возвращает время окончания работы над ТЗ
44
- * Обратить внимание, что считается только рабочее время.
45
- * Суббота и воскресенье не считаются за рабочий день.
46
- */
47
- /**
48
- *
49
- * @param startDate
50
- * @param totalMinutes
51
- * @returns
52
- * Возвращает время окончания работы над ТЗ
43
+ * Возвращает время окончания работы над ПЗ
53
44
  * Обратить внимание, что считается только рабочее время.
54
45
  * Суббота и воскресенье не считаются за рабочий день.
55
46
  * Если startDate выходит за пределы рабочего времени, отсчет начинается от ближайшей рабочей даты.
56
47
  */
57
- export declare const calculateEndDate: (startDate: Date, totalMinutes: number) => Date;
48
+ export interface HolidayConfig {
49
+ /**
50
+ * Массив кастомных выходных дней
51
+ * month: 0-11 (где 0 - январь), day: 1-31
52
+ */
53
+ holidays?: Array<{
54
+ month: number;
55
+ day: number;
56
+ }>;
57
+ /**
58
+ * Пропускать стандартные новогодние праздники (с 1 по 14 января).
59
+ * По умолчанию true.
60
+ */
61
+ skipDefaultJanuaryHolidays?: boolean;
62
+ }
63
+ export declare const calculateEndDate: (startDate: Date, totalMinutes: number, config?: HolidayConfig) => Date;
58
64
  /**
59
65
  * Функция получает сущность и генерирует из него элемент спецификации
60
66
  * @param entity
@@ -113,26 +113,7 @@ const leftToDoByProductionTask = (marks, myQuantity) => {
113
113
  return moreMinusNum(myQuantity - createByMarks);
114
114
  };
115
115
  exports.leftToDoByProductionTask = leftToDoByProductionTask;
116
- /**
117
- *
118
- * @param startDate
119
- * @param totalMinutes
120
- * @returns
121
- * Возвращает время окончания работы над ТЗ
122
- * Обратить внимание, что считается только рабочее время.
123
- * Суббота и воскресенье не считаются за рабочий день.
124
- */
125
- /**
126
- *
127
- * @param startDate
128
- * @param totalMinutes
129
- * @returns
130
- * Возвращает время окончания работы над ТЗ
131
- * Обратить внимание, что считается только рабочее время.
132
- * Суббота и воскресенье не считаются за рабочий день.
133
- * Если startDate выходит за пределы рабочего времени, отсчет начинается от ближайшей рабочей даты.
134
- */
135
- const calculateEndDate = (startDate, totalMinutes) => {
116
+ const calculateEndDate = (startDate, totalMinutes, config) => {
136
117
  let currentDate = new Date(startDate);
137
118
  let remainingMinutes = totalMinutes;
138
119
  const workDayStartHour = 5;
@@ -140,7 +121,21 @@ const calculateEndDate = (startDate, totalMinutes) => {
140
121
  const workDayEndHour = workDayStartHour + workDayHours;
141
122
  // Функция для проверки, является ли дата рабочим днем
142
123
  const isWorkDay = (date) => {
124
+ var _a, _b;
143
125
  const dayOfWeek = date.getUTCDay();
126
+ const month = date.getUTCMonth();
127
+ const day = date.getUTCDate();
128
+ const skipJanuary = (_a = config === null || config === void 0 ? void 0 : config.skipDefaultJanuaryHolidays) !== null && _a !== void 0 ? _a : true;
129
+ if (skipJanuary && month === 0 && day >= 1 && day <= 14) {
130
+ return false;
131
+ }
132
+ // Проверяем кастомные праздники из конфига
133
+ if ((_b = config === null || config === void 0 ? void 0 : config.holidays) === null || _b === void 0 ? void 0 : _b.length) {
134
+ const isHoliday = config.holidays.some(holiday => holiday.month === month && holiday.day === day);
135
+ if (isHoliday) {
136
+ return false;
137
+ }
138
+ }
144
139
  return dayOfWeek !== 0 && dayOfWeek !== 6;
145
140
  };
146
141
  const getWorkDayStart = (date) => {
@@ -25,7 +25,7 @@ export declare class OperationTime {
25
25
  preTime: number;
26
26
  mainTime: number;
27
27
  helperTime: number;
28
- } | null, count?: number);
28
+ } | null | ModelOperation, count?: number);
29
29
  private timeKolvo;
30
30
  }
31
31
  export declare function worksHors(operation: any, kolvo_all?: number): number;
@@ -3,6 +3,7 @@ export declare enum tablesEnumConfig {
3
3
  image = "image",
4
4
  designation = "designation",
5
5
  name = "name",
6
+ warehouseReadinessDate = "warehouseReadinessDate",
6
7
  description = "description",
7
8
  createMarkLabel = "createMarkLabel",
8
9
  calculatedCreateTime = "calculatedCreateTime",
@@ -9,6 +9,8 @@ var tablesEnumConfig;
9
9
  tablesEnumConfig["designation"] = "designation";
10
10
  // наименование
11
11
  tablesEnumConfig["name"] = "name";
12
+ // Дата готовности склада
13
+ tablesEnumConfig["warehouseReadinessDate"] = "warehouseReadinessDate";
12
14
  // описание
13
15
  tablesEnumConfig["description"] = "description";
14
16
  // Создать отметку
@@ -54,6 +54,7 @@ exports.onlineBoardProductionTableConfig = [
54
54
  enum_1.tablesEnumConfig.dateByUrgency,
55
55
  enum_1.tablesEnumConfig.startTime,
56
56
  enum_1.tablesEnumConfig.calculatedCreateTime,
57
+ enum_1.tablesEnumConfig.warehouseReadinessDate,
57
58
  enum_1.tablesEnumConfig.calculateNeedsTime,
58
59
  enum_1.tablesEnumConfig.dateShipment,
59
60
  enum_1.tablesEnumConfig.deficitByCurrentProductionTask,
@@ -70,6 +71,7 @@ exports.onlineBoardProductionTableConfig = [
70
71
  exports.onlineBoardTableConfig = [
71
72
  enum_1.tablesEnumConfig.number,
72
73
  enum_1.tablesEnumConfig.image,
74
+ enum_1.tablesEnumConfig.warehouseReadinessDate,
73
75
  enum_1.tablesEnumConfig.designation,
74
76
  enum_1.tablesEnumConfig.name,
75
77
  enum_1.tablesEnumConfig.entityType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pksep/zod-shared",
3
- "version": "0.0.520",
3
+ "version": "0.0.522",
4
4
  "description": "Zod package for erp project. Contains dto, interfaces, schems, types, enum",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  "lint": "eslint \"**/*.ts\" --fix",
15
15
  "prettier": "prettier --write .",
16
16
  "prettier:check": "prettier --check ./**/*.ts",
17
- "prepublishOnly": "pnpm run update-version && pnpm run build",
17
+ "prepublishOnly": "bun run update-version && bun run build",
18
18
  "update-version": "node bin/update-version.mjs",
19
19
  "version": "git add -A src"
20
20
  },