@pksep/zod-shared 0.0.547 → 0.0.549

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 (50) hide show
  1. package/dist/assemble-kit/dto/assemble-kit-paginate.dto.d.ts +2 -2
  2. package/dist/deliveries/dto/create-deliveries.dto.d.ts +185 -0
  3. package/dist/deliveries/dto/create-deliveries.dto.js +70 -1
  4. package/dist/deliveries/schemas/deliveries-position.schema.d.ts +46 -26
  5. package/dist/deliveries/schemas/deliveries-position.schema.js +16 -9
  6. package/dist/deliveries/schemas/deliveries.schema.d.ts +5 -6
  7. package/dist/deliveries/schemas/deliveries.schema.js +0 -1
  8. package/dist/equipment/schemas/equipment.schema.d.ts +0 -5
  9. package/dist/expenditure/schema/expenditure-consumption.schema.d.ts +2 -2
  10. package/dist/material/dto/get-deficit.dto.d.ts +19 -5
  11. package/dist/material/dto/get-deficit.dto.js +10 -2
  12. package/dist/material/schemas/material-shipments-response.schema.d.ts +0 -8
  13. package/dist/material/schemas/material.schema.d.ts +1 -0
  14. package/dist/utils/interface/status-flags.interface.d.ts +4 -0
  15. package/dist/utils/sorting.d.ts +5 -1
  16. package/package.json +1 -1
  17. package/dist/issue/dto/up-create-issue.dto.d.ts +0 -49
  18. package/dist/issue/dto/up-create-issue.dto.js +0 -21
  19. package/dist/issue/index.d.ts +0 -5
  20. package/dist/issue/index.js +0 -21
  21. package/dist/issue/interfaces/interface.d.ts +0 -4
  22. package/dist/issue/schemas/issue-user-controller.schema.d.ts +0 -15
  23. package/dist/issue/schemas/issue-user-controller.schema.js +0 -9
  24. package/dist/issue/schemas/issue-user.schema.d.ts +0 -15
  25. package/dist/issue/schemas/issue-user.schema.js +0 -9
  26. package/dist/issue/schemas/issue.schema.d.ts +0 -51
  27. package/dist/issue/schemas/issue.schema.js +0 -21
  28. package/dist/library/dto/create-chapter.dto.d.ts +0 -12
  29. package/dist/library/dto/create-chapter.dto.js +0 -8
  30. package/dist/library/dto/create-link.dto.d.ts +0 -30
  31. package/dist/library/dto/create-link.dto.js +0 -14
  32. package/dist/library/index.d.ts +0 -5
  33. package/dist/library/index.js +0 -21
  34. package/dist/library/interfaces/interface.d.ts +0 -3
  35. package/dist/library/interfaces/interface.js +0 -2
  36. package/dist/library/schemas/links-user.schema.d.ts +0 -15
  37. package/dist/library/schemas/links-user.schema.js +0 -9
  38. package/dist/library/schemas/links.schema.d.ts +0 -30
  39. package/dist/library/schemas/links.schema.js +0 -14
  40. package/dist/production-tasks/dto/update-marks.dto.d.ts +0 -13
  41. package/dist/production-tasks/dto/update-marks.dto.js +0 -8
  42. package/dist/production-tasks/dto/update-responsible.dto.d.ts +0 -12
  43. package/dist/production-tasks/dto/update-responsible.dto.js +0 -8
  44. package/dist/production-tasks/dto/update-status.dto.d.ts +0 -13
  45. package/dist/production-tasks/dto/update-status.dto.js +0 -9
  46. package/dist/tech-process/schemas/tech-process-with-options.schema.d.ts +0 -306
  47. package/dist/tech-process/schemas/tech-process-with-options.schema.js +0 -8
  48. package/dist/utils/interface/mat.interface.d.ts +0 -10
  49. package/dist/utils/interface/mat.interface.js +0 -2
  50. /package/dist/{issue/interfaces/interface.js → utils/interface/status-flags.interface.js} +0 -0
@@ -17,10 +17,10 @@ export declare const AssembleKitPaginateDtoZod: z.ZodObject<{
17
17
  }, "strip", z.ZodTypeAny, {
18
18
  status: string;
19
19
  responsibleId: number | null;
20
+ offset: number;
20
21
  isShowDeactivate: boolean;
21
22
  productIds: number[];
22
23
  searchStr: string;
23
- offset: number;
24
24
  currentPage: number;
25
25
  sortKitCount: string;
26
26
  cbedsIds: number[];
@@ -30,8 +30,8 @@ export declare const AssembleKitPaginateDtoZod: z.ZodObject<{
30
30
  assemblyId?: number | null | undefined;
31
31
  }, {
32
32
  status: string;
33
- searchStr: string;
34
33
  offset: number;
34
+ searchStr: string;
35
35
  currentPage: number;
36
36
  sortKitCount: string;
37
37
  responsibleId?: number | null | undefined;
@@ -4,6 +4,7 @@ export declare const DeliveryPositionListItemSchema: z.ZodObject<{
4
4
  entityId: z.ZodNumber;
5
5
  type: z.ZodNativeEnum<typeof EnumEntityDeliveryItem>;
6
6
  ezId: z.ZodNumber;
7
+ plannedDeliveryDate: z.ZodOptional<z.ZodString>;
7
8
  shipped: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
8
9
  quantity: z.ZodNumber;
9
10
  sum: z.ZodNumber;
@@ -18,6 +19,7 @@ export declare const DeliveryPositionListItemSchema: z.ZodObject<{
18
19
  ezId: number;
19
20
  sum: number;
20
21
  coming: number;
22
+ plannedDeliveryDate?: string | undefined;
21
23
  }, {
22
24
  type: EnumEntityDeliveryItem;
23
25
  description: string;
@@ -27,6 +29,7 @@ export declare const DeliveryPositionListItemSchema: z.ZodObject<{
27
29
  sum: number;
28
30
  coming: number;
29
31
  shipped?: number | undefined;
32
+ plannedDeliveryDate?: string | undefined;
30
33
  }>;
31
34
  export declare const CreateDeliveriesDtoZod: z.ZodObject<{
32
35
  companyId: z.ZodNumber;
@@ -37,6 +40,7 @@ export declare const CreateDeliveriesDtoZod: z.ZodObject<{
37
40
  entityId: z.ZodNumber;
38
41
  type: z.ZodNativeEnum<typeof EnumEntityDeliveryItem>;
39
42
  ezId: z.ZodNumber;
43
+ plannedDeliveryDate: z.ZodOptional<z.ZodString>;
40
44
  shipped: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
41
45
  quantity: z.ZodNumber;
42
46
  sum: z.ZodNumber;
@@ -51,6 +55,7 @@ export declare const CreateDeliveriesDtoZod: z.ZodObject<{
51
55
  ezId: number;
52
56
  sum: number;
53
57
  coming: number;
58
+ plannedDeliveryDate?: string | undefined;
54
59
  }, {
55
60
  type: EnumEntityDeliveryItem;
56
61
  description: string;
@@ -60,6 +65,7 @@ export declare const CreateDeliveriesDtoZod: z.ZodObject<{
60
65
  sum: number;
61
66
  coming: number;
62
67
  shipped?: number | undefined;
68
+ plannedDeliveryDate?: string | undefined;
63
69
  }>, "many">;
64
70
  documentsIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
65
71
  dateShipments: z.ZodString;
@@ -79,6 +85,7 @@ export declare const CreateDeliveriesDtoZod: z.ZodObject<{
79
85
  ezId: number;
80
86
  sum: number;
81
87
  coming: number;
88
+ plannedDeliveryDate?: string | undefined;
82
89
  }[];
83
90
  dateShipments: string;
84
91
  documentsIds?: number[] | null | undefined;
@@ -97,8 +104,186 @@ export declare const CreateDeliveriesDtoZod: z.ZodObject<{
97
104
  sum: number;
98
105
  coming: number;
99
106
  shipped?: number | undefined;
107
+ plannedDeliveryDate?: string | undefined;
100
108
  }[];
101
109
  dateShipments: string;
102
110
  documentsIds?: number[] | null | undefined;
103
111
  }>;
104
112
  export type CreateDeliveriesDtoZodType = z.infer<typeof CreateDeliveriesDtoZod>;
113
+ export declare const CreateDeliveryPositionDtoZod: z.ZodEffects<z.ZodObject<Omit<{
114
+ id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
115
+ deliveryId: z.ZodNumber;
116
+ entityType: z.ZodNativeEnum<typeof EnumEntityDeliveryItem>;
117
+ materialId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
118
+ equipmentId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
119
+ instrumentId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
120
+ inventaryId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
121
+ unitMeasurementId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
122
+ orderedQuantity: z.ZodNumber;
123
+ receivedQuantity: z.ZodDefault<z.ZodNumber>;
124
+ plannedDeliveryDate: z.ZodDate;
125
+ totalAmount: z.ZodDefault<z.ZodNumber>;
126
+ description: z.ZodDefault<z.ZodString>;
127
+ createdAt: z.ZodOptional<z.ZodString>;
128
+ updatedAt: z.ZodOptional<z.ZodString>;
129
+ }, "id" | "createdAt" | "updatedAt" | "plannedDeliveryDate" | "deliveryId" | "receivedQuantity"> & {
130
+ plannedDeliveryDate: z.ZodString;
131
+ }, "strip", z.ZodTypeAny, {
132
+ description: string;
133
+ plannedDeliveryDate: string;
134
+ entityType: EnumEntityDeliveryItem;
135
+ orderedQuantity: number;
136
+ totalAmount: number;
137
+ equipmentId?: number | null | undefined;
138
+ materialId?: number | null | undefined;
139
+ instrumentId?: number | null | undefined;
140
+ inventaryId?: number | null | undefined;
141
+ unitMeasurementId?: number | null | undefined;
142
+ }, {
143
+ plannedDeliveryDate: string;
144
+ entityType: EnumEntityDeliveryItem;
145
+ orderedQuantity: number;
146
+ description?: string | undefined;
147
+ equipmentId?: number | null | undefined;
148
+ materialId?: number | null | undefined;
149
+ instrumentId?: number | null | undefined;
150
+ inventaryId?: number | null | undefined;
151
+ unitMeasurementId?: number | null | undefined;
152
+ totalAmount?: number | undefined;
153
+ }>, {
154
+ description: string;
155
+ plannedDeliveryDate: string;
156
+ entityType: EnumEntityDeliveryItem;
157
+ orderedQuantity: number;
158
+ totalAmount: number;
159
+ equipmentId?: number | null | undefined;
160
+ materialId?: number | null | undefined;
161
+ instrumentId?: number | null | undefined;
162
+ inventaryId?: number | null | undefined;
163
+ unitMeasurementId?: number | null | undefined;
164
+ }, {
165
+ plannedDeliveryDate: string;
166
+ entityType: EnumEntityDeliveryItem;
167
+ orderedQuantity: number;
168
+ description?: string | undefined;
169
+ equipmentId?: number | null | undefined;
170
+ materialId?: number | null | undefined;
171
+ instrumentId?: number | null | undefined;
172
+ inventaryId?: number | null | undefined;
173
+ unitMeasurementId?: number | null | undefined;
174
+ totalAmount?: number | undefined;
175
+ }>;
176
+ export declare const CreateDeliveriesByPositionsDtoZod: z.ZodObject<{
177
+ companyId: z.ZodNumber;
178
+ numberCheck: z.ZodString;
179
+ nds: z.ZodNumber;
180
+ count: z.ZodNumber;
181
+ positions: z.ZodArray<z.ZodEffects<z.ZodObject<Omit<{
182
+ id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
183
+ deliveryId: z.ZodNumber;
184
+ entityType: z.ZodNativeEnum<typeof EnumEntityDeliveryItem>;
185
+ materialId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
186
+ equipmentId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
187
+ instrumentId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
188
+ inventaryId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
189
+ unitMeasurementId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
190
+ orderedQuantity: z.ZodNumber;
191
+ receivedQuantity: z.ZodDefault<z.ZodNumber>;
192
+ plannedDeliveryDate: z.ZodDate;
193
+ totalAmount: z.ZodDefault<z.ZodNumber>;
194
+ description: z.ZodDefault<z.ZodString>;
195
+ createdAt: z.ZodOptional<z.ZodString>;
196
+ updatedAt: z.ZodOptional<z.ZodString>;
197
+ }, "id" | "createdAt" | "updatedAt" | "plannedDeliveryDate" | "deliveryId" | "receivedQuantity"> & {
198
+ plannedDeliveryDate: z.ZodString;
199
+ }, "strip", z.ZodTypeAny, {
200
+ description: string;
201
+ plannedDeliveryDate: string;
202
+ entityType: EnumEntityDeliveryItem;
203
+ orderedQuantity: number;
204
+ totalAmount: number;
205
+ equipmentId?: number | null | undefined;
206
+ materialId?: number | null | undefined;
207
+ instrumentId?: number | null | undefined;
208
+ inventaryId?: number | null | undefined;
209
+ unitMeasurementId?: number | null | undefined;
210
+ }, {
211
+ plannedDeliveryDate: string;
212
+ entityType: EnumEntityDeliveryItem;
213
+ orderedQuantity: number;
214
+ description?: string | undefined;
215
+ equipmentId?: number | null | undefined;
216
+ materialId?: number | null | undefined;
217
+ instrumentId?: number | null | undefined;
218
+ inventaryId?: number | null | undefined;
219
+ unitMeasurementId?: number | null | undefined;
220
+ totalAmount?: number | undefined;
221
+ }>, {
222
+ description: string;
223
+ plannedDeliveryDate: string;
224
+ entityType: EnumEntityDeliveryItem;
225
+ orderedQuantity: number;
226
+ totalAmount: number;
227
+ equipmentId?: number | null | undefined;
228
+ materialId?: number | null | undefined;
229
+ instrumentId?: number | null | undefined;
230
+ inventaryId?: number | null | undefined;
231
+ unitMeasurementId?: number | null | undefined;
232
+ }, {
233
+ plannedDeliveryDate: string;
234
+ entityType: EnumEntityDeliveryItem;
235
+ orderedQuantity: number;
236
+ description?: string | undefined;
237
+ equipmentId?: number | null | undefined;
238
+ materialId?: number | null | undefined;
239
+ instrumentId?: number | null | undefined;
240
+ inventaryId?: number | null | undefined;
241
+ unitMeasurementId?: number | null | undefined;
242
+ totalAmount?: number | undefined;
243
+ }>, "many">;
244
+ documentsIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
245
+ dateShipments: z.ZodString;
246
+ description: z.ZodString;
247
+ }, "strip", z.ZodTypeAny, {
248
+ description: string;
249
+ count: number;
250
+ nds: number;
251
+ companyId: number;
252
+ numberCheck: string;
253
+ dateShipments: string;
254
+ positions: {
255
+ description: string;
256
+ plannedDeliveryDate: string;
257
+ entityType: EnumEntityDeliveryItem;
258
+ orderedQuantity: number;
259
+ totalAmount: number;
260
+ equipmentId?: number | null | undefined;
261
+ materialId?: number | null | undefined;
262
+ instrumentId?: number | null | undefined;
263
+ inventaryId?: number | null | undefined;
264
+ unitMeasurementId?: number | null | undefined;
265
+ }[];
266
+ documentsIds?: number[] | null | undefined;
267
+ }, {
268
+ description: string;
269
+ count: number;
270
+ nds: number;
271
+ companyId: number;
272
+ numberCheck: string;
273
+ dateShipments: string;
274
+ positions: {
275
+ plannedDeliveryDate: string;
276
+ entityType: EnumEntityDeliveryItem;
277
+ orderedQuantity: number;
278
+ description?: string | undefined;
279
+ equipmentId?: number | null | undefined;
280
+ materialId?: number | null | undefined;
281
+ instrumentId?: number | null | undefined;
282
+ inventaryId?: number | null | undefined;
283
+ unitMeasurementId?: number | null | undefined;
284
+ totalAmount?: number | undefined;
285
+ }[];
286
+ documentsIds?: number[] | null | undefined;
287
+ }>;
288
+ export type CreateDeliveryPositionDtoZodType = z.infer<typeof CreateDeliveryPositionDtoZod>;
289
+ export type CreateDeliveriesByPositionsDtoZodType = z.infer<typeof CreateDeliveriesByPositionsDtoZod>;
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateDeliveriesDtoZod = exports.DeliveryPositionListItemSchema = void 0;
3
+ exports.CreateDeliveriesByPositionsDtoZod = exports.CreateDeliveryPositionDtoZod = exports.CreateDeliveriesDtoZod = exports.DeliveryPositionListItemSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const utils_1 = require("../../utils");
6
+ const deliveries_position_schema_1 = require("../schemas/deliveries-position.schema");
6
7
  exports.DeliveryPositionListItemSchema = zod_1.z.object({
7
8
  entityId: zod_1.z.number(),
8
9
  type: zod_1.z.nativeEnum(utils_1.EnumEntityDeliveryItem),
9
10
  ezId: zod_1.z.number(),
11
+ plannedDeliveryDate: zod_1.z.string().datetime({ offset: true }).optional(),
10
12
  shipped: zod_1.z.number().optional().default(0),
11
13
  quantity: zod_1.z.number(),
12
14
  sum: zod_1.z.number(),
@@ -23,3 +25,70 @@ exports.CreateDeliveriesDtoZod = zod_1.z.object({
23
25
  dateShipments: zod_1.z.string(),
24
26
  description: zod_1.z.string()
25
27
  });
28
+ exports.CreateDeliveryPositionDtoZod = deliveries_position_schema_1.DeliveryPositionSchema.omit({
29
+ id: true,
30
+ deliveryId: true,
31
+ receivedQuantity: true,
32
+ plannedDeliveryDate: true,
33
+ createdAt: true,
34
+ updatedAt: true
35
+ })
36
+ .extend({
37
+ plannedDeliveryDate: zod_1.z.string()
38
+ })
39
+ .superRefine((position, ctx) => {
40
+ const entityIds = [
41
+ position.materialId,
42
+ position.equipmentId,
43
+ position.instrumentId,
44
+ position.inventaryId
45
+ ].filter(value => Number(value) > 0);
46
+ if (entityIds.length !== 1) {
47
+ ctx.addIssue({
48
+ code: zod_1.z.ZodIssueCode.custom,
49
+ message: 'Для позиции заказа должна быть указана ровно одна сущность'
50
+ });
51
+ }
52
+ if (position.entityType === utils_1.EnumEntityDeliveryItem.material &&
53
+ !position.materialId) {
54
+ ctx.addIssue({
55
+ code: zod_1.z.ZodIssueCode.custom,
56
+ path: ['materialId'],
57
+ message: 'Для материала должен быть указан materialId'
58
+ });
59
+ }
60
+ if (position.entityType === utils_1.EnumEntityDeliveryItem.equipment &&
61
+ !position.equipmentId) {
62
+ ctx.addIssue({
63
+ code: zod_1.z.ZodIssueCode.custom,
64
+ path: ['equipmentId'],
65
+ message: 'Для оборудования должен быть указан equipmentId'
66
+ });
67
+ }
68
+ if (position.entityType === utils_1.EnumEntityDeliveryItem.instrument &&
69
+ !position.instrumentId) {
70
+ ctx.addIssue({
71
+ code: zod_1.z.ZodIssueCode.custom,
72
+ path: ['instrumentId'],
73
+ message: 'Для инструмента должен быть указан instrumentId'
74
+ });
75
+ }
76
+ if (position.entityType === utils_1.EnumEntityDeliveryItem.inventary &&
77
+ !position.inventaryId) {
78
+ ctx.addIssue({
79
+ code: zod_1.z.ZodIssueCode.custom,
80
+ path: ['inventaryId'],
81
+ message: 'Для инвентаря должен быть указан inventaryId'
82
+ });
83
+ }
84
+ });
85
+ exports.CreateDeliveriesByPositionsDtoZod = zod_1.z.object({
86
+ companyId: zod_1.z.number(),
87
+ numberCheck: zod_1.z.string(),
88
+ nds: zod_1.z.number(),
89
+ count: zod_1.z.number(),
90
+ positions: exports.CreateDeliveryPositionDtoZod.array(),
91
+ documentsIds: zod_1.z.array(zod_1.z.number().int()).nullish(),
92
+ dateShipments: zod_1.z.string(),
93
+ description: zod_1.z.string()
94
+ });
@@ -1,32 +1,52 @@
1
1
  import { z } from 'zod';
2
+ import { EnumEntityDeliveryItem } from '../../utils';
2
3
  export declare const DeliveryPositionSchema: z.ZodObject<{
3
- id: z.ZodNumber;
4
- art: z.ZodString;
5
- name: z.ZodString;
6
- type: z.ZodString;
7
- ez: z.ZodNumber;
8
- kol: z.ZodNumber;
9
- coming: z.ZodNumber;
10
- sum: z.ZodNumber;
11
- description: z.ZodString;
4
+ id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
5
+ deliveryId: z.ZodNumber;
6
+ entityType: z.ZodNativeEnum<typeof EnumEntityDeliveryItem>;
7
+ materialId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
8
+ equipmentId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
9
+ instrumentId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
10
+ inventaryId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
11
+ unitMeasurementId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
12
+ orderedQuantity: z.ZodNumber;
13
+ receivedQuantity: z.ZodDefault<z.ZodNumber>;
14
+ plannedDeliveryDate: z.ZodDate;
15
+ totalAmount: z.ZodDefault<z.ZodNumber>;
16
+ description: z.ZodDefault<z.ZodString>;
17
+ createdAt: z.ZodOptional<z.ZodString>;
18
+ updatedAt: z.ZodOptional<z.ZodString>;
12
19
  }, "strip", z.ZodTypeAny, {
13
- type: string;
14
20
  description: string;
15
- id: number;
16
- name: string;
17
- kol: number;
18
- sum: number;
19
- coming: number;
20
- art: string;
21
- ez: number;
21
+ plannedDeliveryDate: Date;
22
+ entityType: EnumEntityDeliveryItem;
23
+ deliveryId: number;
24
+ orderedQuantity: number;
25
+ receivedQuantity: number;
26
+ totalAmount: number;
27
+ id?: number | null | undefined;
28
+ createdAt?: string | undefined;
29
+ equipmentId?: number | null | undefined;
30
+ materialId?: number | null | undefined;
31
+ updatedAt?: string | undefined;
32
+ instrumentId?: number | null | undefined;
33
+ inventaryId?: number | null | undefined;
34
+ unitMeasurementId?: number | null | undefined;
22
35
  }, {
23
- type: string;
24
- description: string;
25
- id: number;
26
- name: string;
27
- kol: number;
28
- sum: number;
29
- coming: number;
30
- art: string;
31
- ez: number;
36
+ plannedDeliveryDate: Date;
37
+ entityType: EnumEntityDeliveryItem;
38
+ deliveryId: number;
39
+ orderedQuantity: number;
40
+ description?: string | undefined;
41
+ id?: number | null | undefined;
42
+ createdAt?: string | undefined;
43
+ equipmentId?: number | null | undefined;
44
+ materialId?: number | null | undefined;
45
+ updatedAt?: string | undefined;
46
+ instrumentId?: number | null | undefined;
47
+ inventaryId?: number | null | undefined;
48
+ unitMeasurementId?: number | null | undefined;
49
+ receivedQuantity?: number | undefined;
50
+ totalAmount?: number | undefined;
32
51
  }>;
52
+ export type ModelDeliveryPosition = z.infer<typeof DeliveryPositionSchema>;
@@ -2,14 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DeliveryPositionSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const utils_1 = require("../../utils");
5
6
  exports.DeliveryPositionSchema = zod_1.z.object({
6
- id: zod_1.z.number(),
7
- art: zod_1.z.string(),
8
- name: zod_1.z.string(),
9
- type: zod_1.z.string(),
10
- ez: zod_1.z.number(),
11
- kol: zod_1.z.number(),
12
- coming: zod_1.z.number(),
13
- sum: zod_1.z.number(),
14
- description: zod_1.z.string()
7
+ id: zod_1.z.number().nullish(),
8
+ deliveryId: zod_1.z.number().int().positive(),
9
+ entityType: zod_1.z.nativeEnum(utils_1.EnumEntityDeliveryItem),
10
+ materialId: zod_1.z.number().int().positive().nullish(),
11
+ equipmentId: zod_1.z.number().int().positive().nullish(),
12
+ instrumentId: zod_1.z.number().int().positive().nullish(),
13
+ inventaryId: zod_1.z.number().int().positive().nullish(),
14
+ unitMeasurementId: zod_1.z.number().int().positive().nullish(),
15
+ orderedQuantity: zod_1.z.number(),
16
+ receivedQuantity: zod_1.z.number().default(0),
17
+ plannedDeliveryDate: zod_1.z.date(),
18
+ totalAmount: zod_1.z.number().default(0),
19
+ description: zod_1.z.string().default(''),
20
+ createdAt: zod_1.z.string().optional(),
21
+ updatedAt: zod_1.z.string().optional()
15
22
  });
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { DELIVERY_POSITION_LIST, EnumStatusDelivery } from '../../utils';
3
- import { ModelProviders } from '../../provider';
2
+ import { DELIVERY_POSITION_LIST, EnumStatusDelivery, EnumStatusOrder } from '../../utils';
4
3
  import { ModelDocuments } from '../../document';
5
4
  import { ModelMaterial } from '../../material';
6
5
  import { ModelNameInstrument } from '../../instrument';
@@ -18,7 +17,6 @@ export declare const DeliveriesSchema: z.ZodObject<{
18
17
  delivery_position_list: z.ZodOptional<z.ZodType<DELIVERY_POSITION_LIST, z.ZodTypeDef, DELIVERY_POSITION_LIST>>;
19
18
  description: z.ZodOptional<z.ZodString>;
20
19
  ban: z.ZodDefault<z.ZodBoolean>;
21
- provider_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
22
20
  company_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
23
21
  createdAt: z.ZodOptional<z.ZodString>;
24
22
  updatedAt: z.ZodOptional<z.ZodString>;
@@ -31,7 +29,6 @@ export declare const DeliveriesSchema: z.ZodObject<{
31
29
  number_order?: string | undefined;
32
30
  number_check?: string | undefined;
33
31
  createdAt?: string | undefined;
34
- provider_id?: number | null | undefined;
35
32
  count?: number | undefined;
36
33
  date_shipments?: Date | undefined;
37
34
  delivery_position_list?: DELIVERY_POSITION_LIST | undefined;
@@ -45,7 +42,6 @@ export declare const DeliveriesSchema: z.ZodObject<{
45
42
  number_order?: string | undefined;
46
43
  number_check?: string | undefined;
47
44
  createdAt?: string | undefined;
48
- provider_id?: number | null | undefined;
49
45
  count?: number | undefined;
50
46
  date_shipments?: Date | undefined;
51
47
  nds?: number | undefined;
@@ -54,7 +50,6 @@ export declare const DeliveriesSchema: z.ZodObject<{
54
50
  updatedAt?: string | undefined;
55
51
  }>;
56
52
  export type ModelDeliveries = z.infer<typeof DeliveriesSchema> & {
57
- provider?: ModelProviders;
58
53
  documents?: ModelDocuments[];
59
54
  materials?: ModelMaterial[];
60
55
  tools?: ModelNameInstrument[];
@@ -62,3 +57,7 @@ export type ModelDeliveries = z.infer<typeof DeliveriesSchema> & {
62
57
  inventary?: ModelInventary[];
63
58
  company?: ModelCompany;
64
59
  };
60
+ export interface IModelDeliveriesExtended extends ModelDeliveries {
61
+ status_computed: EnumStatusOrder | null;
62
+ positions_count?: number;
63
+ }
@@ -14,7 +14,6 @@ exports.DeliveriesSchema = zod_1.z.object({
14
14
  delivery_position_list: zod_1.z.custom().optional(),
15
15
  description: zod_1.z.string().optional(),
16
16
  ban: zod_1.z.boolean().default(false),
17
- provider_id: zod_1.z.number().nullish(),
18
17
  company_id: zod_1.z.number().nullish(),
19
18
  createdAt: zod_1.z.string().optional(),
20
19
  updatedAt: zod_1.z.string().optional()
@@ -304,7 +304,6 @@ export declare const EquipmentSchema: z.ZodObject<{
304
304
  delivery_position_list: z.ZodOptional<z.ZodType<import("../..").DELIVERY_POSITION_LIST, z.ZodTypeDef, import("../..").DELIVERY_POSITION_LIST>>;
305
305
  description: z.ZodOptional<z.ZodString>;
306
306
  ban: z.ZodDefault<z.ZodBoolean>;
307
- provider_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
308
307
  company_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
309
308
  createdAt: z.ZodOptional<z.ZodString>;
310
309
  updatedAt: z.ZodOptional<z.ZodString>;
@@ -317,7 +316,6 @@ export declare const EquipmentSchema: z.ZodObject<{
317
316
  number_order?: string | undefined;
318
317
  number_check?: string | undefined;
319
318
  createdAt?: string | undefined;
320
- provider_id?: number | null | undefined;
321
319
  count?: number | undefined;
322
320
  date_shipments?: Date | undefined;
323
321
  delivery_position_list?: import("../..").DELIVERY_POSITION_LIST | undefined;
@@ -331,7 +329,6 @@ export declare const EquipmentSchema: z.ZodObject<{
331
329
  number_order?: string | undefined;
332
330
  number_check?: string | undefined;
333
331
  createdAt?: string | undefined;
334
- provider_id?: number | null | undefined;
335
332
  count?: number | undefined;
336
333
  date_shipments?: Date | undefined;
337
334
  nds?: number | undefined;
@@ -523,7 +520,6 @@ export declare const EquipmentSchema: z.ZodObject<{
523
520
  number_order?: string | undefined;
524
521
  number_check?: string | undefined;
525
522
  createdAt?: string | undefined;
526
- provider_id?: number | null | undefined;
527
523
  count?: number | undefined;
528
524
  date_shipments?: Date | undefined;
529
525
  delivery_position_list?: import("../..").DELIVERY_POSITION_LIST | undefined;
@@ -665,7 +661,6 @@ export declare const EquipmentSchema: z.ZodObject<{
665
661
  number_order?: string | undefined;
666
662
  number_check?: string | undefined;
667
663
  createdAt?: string | undefined;
668
- provider_id?: number | null | undefined;
669
664
  count?: number | undefined;
670
665
  date_shipments?: Date | undefined;
671
666
  nds?: number | undefined;
@@ -33,7 +33,6 @@ export declare const ExpenditureConsumptionSchema: z.ZodObject<{
33
33
  }>, "many">;
34
34
  }, "strip", z.ZodTypeAny, {
35
35
  id: number;
36
- basis: string;
37
36
  positions: {
38
37
  type: import("../../waybill").PositionItemType;
39
38
  id: number;
@@ -42,13 +41,13 @@ export declare const ExpenditureConsumptionSchema: z.ZodObject<{
42
41
  quanity: number;
43
42
  designation?: string | undefined;
44
43
  }[];
44
+ basis: string;
45
45
  createdAt?: string | undefined;
46
46
  waybill_id?: number | null | undefined;
47
47
  updatedAt?: string | undefined;
48
48
  sh_complit_id?: number | null | undefined;
49
49
  }, {
50
50
  id: number;
51
- basis: string;
52
51
  positions: {
53
52
  type: import("../../waybill").PositionItemType;
54
53
  id: number;
@@ -57,6 +56,7 @@ export declare const ExpenditureConsumptionSchema: z.ZodObject<{
57
56
  quanity: number;
58
57
  designation?: string | undefined;
59
58
  }[];
59
+ basis: string;
60
60
  createdAt?: string | undefined;
61
61
  waybill_id?: number | null | undefined;
62
62
  updatedAt?: string | undefined;
@@ -1,5 +1,19 @@
1
1
  import { z } from 'zod';
2
2
  import { statusWorkingsDeficit } from '../../utils';
3
+ export declare enum MaterialDeficitSortField {
4
+ plannedDeliveryDate = "plannedDeliveryDate"
5
+ }
6
+ export declare const MaterialDeficitSortRuleSchema: z.ZodObject<{
7
+ sortField: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof MaterialDeficitSortField>>>;
8
+ sortDesc: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ sortDesc: boolean;
11
+ sortField?: MaterialDeficitSortField | null | undefined;
12
+ }, {
13
+ sortField?: MaterialDeficitSortField | null | undefined;
14
+ sortDesc?: boolean | undefined;
15
+ }>;
16
+ export type MaterialDeficitSortRule = z.infer<typeof MaterialDeficitSortRuleSchema>;
3
17
  export declare const GetMaterialDeficitDtoZod: z.ZodObject<{
4
18
  materialIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
5
19
  typeMaterialIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
@@ -9,19 +23,19 @@ export declare const GetMaterialDeficitDtoZod: z.ZodObject<{
9
23
  shipmentIds: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>>;
10
24
  page: z.ZodNumber;
11
25
  sort: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
12
- sortField: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof import("../../utils").ProductionPlanSortField>>>;
26
+ sortField: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof MaterialDeficitSortField>>>;
13
27
  sortDesc: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
14
28
  }, "strip", z.ZodTypeAny, {
15
29
  sortDesc: boolean;
16
- sortField?: import("../../utils").ProductionPlanSortField | null | undefined;
30
+ sortField?: MaterialDeficitSortField | null | undefined;
17
31
  }, {
18
- sortField?: import("../../utils").ProductionPlanSortField | null | undefined;
32
+ sortField?: MaterialDeficitSortField | null | undefined;
19
33
  sortDesc?: boolean | undefined;
20
34
  }>, "many">>>;
21
35
  }, "strip", z.ZodTypeAny, {
22
36
  sort: {
23
37
  sortDesc: boolean;
24
- sortField?: import("../../utils").ProductionPlanSortField | null | undefined;
38
+ sortField?: MaterialDeficitSortField | null | undefined;
25
39
  }[];
26
40
  page: number;
27
41
  searchString: string;
@@ -33,7 +47,7 @@ export declare const GetMaterialDeficitDtoZod: z.ZodObject<{
33
47
  }, {
34
48
  page: number;
35
49
  sort?: {
36
- sortField?: import("../../utils").ProductionPlanSortField | null | undefined;
50
+ sortField?: MaterialDeficitSortField | null | undefined;
37
51
  sortDesc?: boolean | undefined;
38
52
  }[] | undefined;
39
53
  searchString?: string | undefined;
@@ -1,8 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetMaterialDeficitDtoZod = void 0;
3
+ exports.GetMaterialDeficitDtoZod = exports.MaterialDeficitSortRuleSchema = exports.MaterialDeficitSortField = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const utils_1 = require("../../utils");
6
+ var MaterialDeficitSortField;
7
+ (function (MaterialDeficitSortField) {
8
+ MaterialDeficitSortField["plannedDeliveryDate"] = "plannedDeliveryDate";
9
+ })(MaterialDeficitSortField || (exports.MaterialDeficitSortField = MaterialDeficitSortField = {}));
10
+ exports.MaterialDeficitSortRuleSchema = zod_1.z.object({
11
+ sortField: zod_1.z.nativeEnum(MaterialDeficitSortField).nullable().optional(),
12
+ sortDesc: zod_1.z.boolean().optional().default(false)
13
+ });
6
14
  exports.GetMaterialDeficitDtoZod = zod_1.z.object({
7
15
  materialIds: zod_1.z.array(zod_1.z.number()).optional().default([]),
8
16
  typeMaterialIds: zod_1.z.array(zod_1.z.number()).optional().default([]),
@@ -14,5 +22,5 @@ exports.GetMaterialDeficitDtoZod = zod_1.z.object({
14
22
  searchString: zod_1.z.string().optional().default(''),
15
23
  shipmentIds: zod_1.z.number().int().array().optional().nullable().default(null),
16
24
  page: zod_1.z.number().int(),
17
- sort: zod_1.z.array(utils_1.ProductionPlanSortRuleSchema).optional().default([])
25
+ sort: zod_1.z.array(exports.MaterialDeficitSortRuleSchema).optional().default([])
18
26
  });