@pksep/zod-shared 0.0.561 → 0.0.562

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.
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExcelExportResultSchema = exports.ExcelExportJobDataSchema = exports.ExcelExportStatusSchema = exports.ExcelExportCreatedSchema = exports.CreateExcelExportDtoZod = exports.CreateExcelExportRequestSchema = exports.CreateAssemblyStockOrderExcelExportDtoZod = exports.CreateOperationPathExcelExportDtoZod = exports.CreateAssemblyOperationExcelExportDtoZod = exports.CreateMetalloworkingExcelExportDtoZod = exports.CreateAssemblyExcelExportDtoZod = exports.AssemblyStockOrderExcelExportColumnSchema = exports.OperationPathExcelExportColumnSchema = exports.AssemblyOperationExcelExportColumnSchema = exports.MetalloworkingExcelExportColumnSchema = exports.AssemblyExcelExportColumnSchema = exports.AssemblyStockOrderExcelExportColumnDefinitions = exports.OperationPathExcelExportColumnDefinitions = exports.AssemblyOperationExcelExportColumnDefinitions = exports.MetalloworkingExcelExportColumnDefinitions = exports.AssemblyExcelExportColumnDefinitions = exports.ExcelExportColumnDefinitionSchema = exports.ExcelExportStatus = exports.OperationPathExcelExportSourceType = exports.ExcelExportReportType = void 0;
3
+ exports.ExcelExportResultSchema = exports.ExcelExportJobDataSchema = exports.ExcelExportStatusSchema = exports.ExcelExportCreatedSchema = exports.CreateExcelExportDtoZod = exports.CreateExcelExportRequestSchema = exports.CreateMaterialDeficitExcelExportDtoZod = exports.CreateDetalDeficitExcelExportDtoZod = exports.CreateCbedDeficitExcelExportDtoZod = exports.CreateProductDeficitExcelExportDtoZod = exports.CreateAssemblyStockOrderExcelExportDtoZod = exports.CreateOperationPathExcelExportDtoZod = exports.CreateAssemblyOperationExcelExportDtoZod = exports.CreateMetalloworkingExcelExportDtoZod = exports.CreateAssemblyExcelExportDtoZod = exports.MaterialDeficitExcelExportColumnSchema = exports.DetalDeficitExcelExportColumnSchema = exports.CbedDeficitExcelExportColumnSchema = exports.ProductDeficitExcelExportColumnSchema = exports.AssemblyStockOrderExcelExportColumnSchema = exports.OperationPathExcelExportColumnSchema = exports.AssemblyOperationExcelExportColumnSchema = exports.MetalloworkingExcelExportColumnSchema = exports.AssemblyExcelExportColumnSchema = exports.MaterialDeficitExcelExportColumnDefinitions = exports.DetalDeficitExcelExportColumnDefinitions = exports.CbedDeficitExcelExportColumnDefinitions = exports.ProductDeficitExcelExportColumnDefinitions = exports.AssemblyStockOrderExcelExportColumnDefinitions = exports.OperationPathExcelExportColumnDefinitions = exports.AssemblyOperationExcelExportColumnDefinitions = exports.MetalloworkingExcelExportColumnDefinitions = exports.AssemblyExcelExportColumnDefinitions = exports.ExcelExportColumnDefinitionSchema = exports.ExcelExportStatus = exports.OperationPathExcelExportSourceType = exports.ExcelExportReportType = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const assemble_1 = require("../assemble");
6
+ const cbed_1 = require("../cbed");
7
+ const detal_1 = require("../detal");
8
+ const material_1 = require("../material");
6
9
  const metaloworking_1 = require("../metaloworking");
10
+ const product_1 = require("../product");
7
11
  var ExcelExportReportType;
8
12
  (function (ExcelExportReportType) {
9
13
  ExcelExportReportType["assemblyList"] = "assembly.list";
@@ -11,6 +15,10 @@ var ExcelExportReportType;
11
15
  ExcelExportReportType["operationPath"] = "production.operation-path";
12
16
  ExcelExportReportType["assemblyStockOrderList"] = "assembly.stock-order-list";
13
17
  ExcelExportReportType["metalloworkingList"] = "metalloworking.list";
18
+ ExcelExportReportType["productDeficitList"] = "warehouse.product-deficit-list";
19
+ ExcelExportReportType["cbedDeficitList"] = "warehouse.cbed-deficit-list";
20
+ ExcelExportReportType["detalDeficitList"] = "warehouse.detal-deficit-list";
21
+ ExcelExportReportType["materialDeficitList"] = "warehouse.material-deficit-list";
14
22
  })(ExcelExportReportType || (exports.ExcelExportReportType = ExcelExportReportType = {}));
15
23
  var OperationPathExcelExportSourceType;
16
24
  (function (OperationPathExcelExportSourceType) {
@@ -154,12 +162,134 @@ exports.AssemblyStockOrderExcelExportColumnDefinitions = {
154
162
  deficit: { header: 'Дефицит', width: 16 },
155
163
  countOfSclad: { header: 'Кол-во', width: 14 }
156
164
  };
165
+ exports.ProductDeficitExcelExportColumnDefinitions = {
166
+ number: { header: '№', width: 8 },
167
+ designation: { header: 'Обозначение', width: 24 },
168
+ article: { header: 'Артикул', width: 20 },
169
+ name: { header: 'Наименование', width: 40 },
170
+ warehouseReadinessDate: {
171
+ header: 'Дата плановой готовности склада',
172
+ width: 28
173
+ },
174
+ shipmentDate: { header: 'Дата плановой отгрузки', width: 23 },
175
+ deficit: { header: 'Общий дефицит', width: 18 },
176
+ orderDemand: { header: 'Потребность по заказам покупателя', width: 30 },
177
+ remaining: { header: 'Кол-во', width: 14 },
178
+ status: { header: 'Статус', width: 18 },
179
+ minRemaining: { header: 'Мин. остаток', width: 16 },
180
+ recommendedRemaining: { header: 'Рек. остаток', width: 16 },
181
+ timeNorm: {
182
+ header: 'Норма времени на одну единицу, ч/мин',
183
+ width: 29
184
+ },
185
+ ownQuantity: {
186
+ header: 'Кол-во (по ум.=рекомендуемому кол-ву)',
187
+ width: 31
188
+ },
189
+ ordered: { header: 'Заказано на складе', width: 20 },
190
+ realRemaining: {
191
+ header: 'Реальный остаток с учетом планируемых отгрузок и планируемого производства',
192
+ width: 35
193
+ }
194
+ };
195
+ exports.CbedDeficitExcelExportColumnDefinitions = {
196
+ number: { header: '№', width: 8 },
197
+ designation: { header: 'Обозначение', width: 24 },
198
+ name: { header: 'Наименование', width: 40 },
199
+ warehouseReadinessDate: {
200
+ header: 'Дата плановой готовности склада',
201
+ width: 28
202
+ },
203
+ deficit: { header: 'Общий дефицит', width: 18 },
204
+ orderDemand: { header: 'Потребность по заказам', width: 24 },
205
+ remaining: { header: 'Кол-во', width: 14 },
206
+ status: { header: 'Статус', width: 18 },
207
+ minRemaining: { header: 'Мин. остаток', width: 16 },
208
+ recommendedRemaining: { header: 'Рек. остаток', width: 16 },
209
+ timeNorm: {
210
+ header: 'Норма времени на одну единицу, ч/мин',
211
+ width: 29
212
+ },
213
+ ownQuantity: {
214
+ header: 'Кол-во (по ум.=рекомендуемому кол-ву)',
215
+ width: 31
216
+ },
217
+ ordered: { header: 'Заказано на складе', width: 20 },
218
+ realRemaining: {
219
+ header: 'Реальный остаток с учетом планируемых отгрузок и планируемого производства',
220
+ width: 35
221
+ }
222
+ };
223
+ exports.DetalDeficitExcelExportColumnDefinitions = {
224
+ number: { header: '№', width: 8 },
225
+ designation: { header: 'Обозначение', width: 24 },
226
+ name: { header: 'Наименование', width: 40 },
227
+ warehouseReadinessDate: {
228
+ header: 'Дата плановой готовности склада',
229
+ width: 28
230
+ },
231
+ deficit: { header: 'Общий дефицит', width: 18 },
232
+ orderDemand: { header: 'Потребность по заказам склада', width: 28 },
233
+ remaining: { header: 'Кол-во', width: 14 },
234
+ status: { header: 'Статус', width: 18 },
235
+ minRemaining: { header: 'Мин. остаток', width: 16 },
236
+ recommendedRemaining: { header: 'Рек. остаток', width: 16 },
237
+ cnc: { header: 'ЧПУ', width: 12 },
238
+ timeNorm: {
239
+ header: 'Норма времени на одну единицу, ч/мин',
240
+ width: 29
241
+ },
242
+ ownQuantity: {
243
+ header: 'Кол-во (по ум.=рекомендуемому кол-ву)',
244
+ width: 31
245
+ },
246
+ ordered: { header: 'Заказано на складе', width: 20 },
247
+ deficitWithProduction: {
248
+ header: 'Дефицит с учетом производства',
249
+ width: 27
250
+ },
251
+ realRemaining: {
252
+ header: 'Реальный остаток с учетом планируемых отгрузок и планируемого производства',
253
+ width: 35
254
+ }
255
+ };
256
+ exports.MaterialDeficitExcelExportColumnDefinitions = {
257
+ number: { header: '№', width: 8 },
258
+ name: { header: 'Наименование', width: 40 },
259
+ plannedDeliveryDate: { header: 'Планируемая дата прихода', width: 24 },
260
+ shipmentDate: { header: 'Дата плановой отгрузки', width: 23 },
261
+ inKit: { header: 'В наборах', width: 14 },
262
+ measurement: { header: 'ЕИ', width: 12 },
263
+ deficit: { header: 'Общий дефицит', width: 18 },
264
+ orderDemand: { header: 'Потребность по ЗС', width: 21 },
265
+ remaining: { header: 'Остаток', width: 15 },
266
+ status: { header: 'Статус', width: 18 },
267
+ minRemaining: { header: 'Мин. остаток', width: 16 },
268
+ recommendedRemaining: { header: 'Рек. остаток', width: 16 },
269
+ ownQuantity: {
270
+ header: 'Кол-во (по ум.=рекомендуемому кол-ву)',
271
+ width: 31
272
+ },
273
+ ordered: { header: 'Заказано', width: 16 },
274
+ deficitWithIncoming: {
275
+ header: 'Дефицит с учетом прихода',
276
+ width: 25
277
+ },
278
+ realRemaining: {
279
+ header: 'Реальный остаток с учетом планируемых отгрузок и планируемого производства',
280
+ width: 35
281
+ }
282
+ };
157
283
  const getColumnDefinitionKeys = (definitions) => Object.keys(definitions);
158
284
  exports.AssemblyExcelExportColumnSchema = zod_1.z.enum(getColumnDefinitionKeys(exports.AssemblyExcelExportColumnDefinitions));
159
285
  exports.MetalloworkingExcelExportColumnSchema = zod_1.z.enum(getColumnDefinitionKeys(exports.MetalloworkingExcelExportColumnDefinitions));
160
286
  exports.AssemblyOperationExcelExportColumnSchema = zod_1.z.enum(getColumnDefinitionKeys(exports.AssemblyOperationExcelExportColumnDefinitions));
161
287
  exports.OperationPathExcelExportColumnSchema = zod_1.z.enum(getColumnDefinitionKeys(exports.OperationPathExcelExportColumnDefinitions));
162
288
  exports.AssemblyStockOrderExcelExportColumnSchema = zod_1.z.enum(getColumnDefinitionKeys(exports.AssemblyStockOrderExcelExportColumnDefinitions));
289
+ exports.ProductDeficitExcelExportColumnSchema = zod_1.z.enum(getColumnDefinitionKeys(exports.ProductDeficitExcelExportColumnDefinitions));
290
+ exports.CbedDeficitExcelExportColumnSchema = zod_1.z.enum(getColumnDefinitionKeys(exports.CbedDeficitExcelExportColumnDefinitions));
291
+ exports.DetalDeficitExcelExportColumnSchema = zod_1.z.enum(getColumnDefinitionKeys(exports.DetalDeficitExcelExportColumnDefinitions));
292
+ exports.MaterialDeficitExcelExportColumnSchema = zod_1.z.enum(getColumnDefinitionKeys(exports.MaterialDeficitExcelExportColumnDefinitions));
163
293
  const createUniqueColumnsSchema = (columnSchema) => zod_1.z
164
294
  .array(columnSchema)
165
295
  .min(1)
@@ -194,12 +324,36 @@ exports.CreateAssemblyStockOrderExcelExportDtoZod = zod_1.z.object({
194
324
  columns: createUniqueColumnsSchema(exports.AssemblyStockOrderExcelExportColumnSchema),
195
325
  filters: assemble_1.GetAssembleScladPaginationDtoZod.omit({ page: true })
196
326
  });
327
+ exports.CreateProductDeficitExcelExportDtoZod = zod_1.z.object({
328
+ reportType: zod_1.z.literal(ExcelExportReportType.productDeficitList),
329
+ columns: createUniqueColumnsSchema(exports.ProductDeficitExcelExportColumnSchema),
330
+ filters: product_1.GetDeficitProductSchema.omit({ page: true })
331
+ });
332
+ exports.CreateCbedDeficitExcelExportDtoZod = zod_1.z.object({
333
+ reportType: zod_1.z.literal(ExcelExportReportType.cbedDeficitList),
334
+ columns: createUniqueColumnsSchema(exports.CbedDeficitExcelExportColumnSchema),
335
+ filters: cbed_1.GetDeficitDtoZod.omit({ page: true })
336
+ });
337
+ exports.CreateDetalDeficitExcelExportDtoZod = zod_1.z.object({
338
+ reportType: zod_1.z.literal(ExcelExportReportType.detalDeficitList),
339
+ columns: createUniqueColumnsSchema(exports.DetalDeficitExcelExportColumnSchema),
340
+ filters: detal_1.GetDetalDeficitDtoZod.omit({ page: true })
341
+ });
342
+ exports.CreateMaterialDeficitExcelExportDtoZod = zod_1.z.object({
343
+ reportType: zod_1.z.literal(ExcelExportReportType.materialDeficitList),
344
+ columns: createUniqueColumnsSchema(exports.MaterialDeficitExcelExportColumnSchema),
345
+ filters: material_1.GetMaterialDeficitDtoZod.omit({ page: true })
346
+ });
197
347
  exports.CreateExcelExportRequestSchema = zod_1.z.discriminatedUnion('reportType', [
198
348
  exports.CreateAssemblyExcelExportDtoZod,
199
349
  exports.CreateAssemblyOperationExcelExportDtoZod,
200
350
  exports.CreateOperationPathExcelExportDtoZod,
201
351
  exports.CreateAssemblyStockOrderExcelExportDtoZod,
202
- exports.CreateMetalloworkingExcelExportDtoZod
352
+ exports.CreateMetalloworkingExcelExportDtoZod,
353
+ exports.CreateProductDeficitExcelExportDtoZod,
354
+ exports.CreateCbedDeficitExcelExportDtoZod,
355
+ exports.CreateDetalDeficitExcelExportDtoZod,
356
+ exports.CreateMaterialDeficitExcelExportDtoZod
203
357
  ]);
204
358
  // createZodDto requires an object schema as its class base. The refinement
205
359
  // delegates validation to the strict discriminated report contract.
package/package.json CHANGED
@@ -1,38 +1,38 @@
1
- {
2
- "name": "@pksep/zod-shared",
3
- "version": "0.0.561",
4
- "description": "Zod package for erp project. Contains dto, interfaces, schems, types, enum",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "files": [
8
- "dist"
9
- ],
10
- "scripts": {
11
- "build": "tsc -b --force",
12
- "publish:lib": "changelogen --publish --patch --output CHANGELOG.md --from=HEAD~1 --no-provenance --no-git-checks",
13
- "publish:canary": "changelogen --output CHANGELOG.md --from=HEAD~1 --no-git-checks && npm publish --tag canary --legacy-peer-deps --no-provenance",
14
- "lint": "eslint \"**/*.ts\" --fix",
15
- "prettier": "prettier --write .",
16
- "prettier:check": "prettier --check ./**/*.ts",
17
- "prepublishOnly": "bun run update-version && bun run build",
18
- "update-version": "node bin/update-version.mjs",
19
- "version": "git add -A src"
20
- },
21
- "dependencies": {
22
- "lodash": "^4.17.21",
23
- "@types/lodash": "^4.17.7",
24
- "lz-string": "^1.5.0",
25
- "zod": "^3.23.8"
26
- },
27
- "repository": {
28
- "type": "git",
29
- "url": "https://github.com/NPO-Automotive/sep_erp_server.git",
30
- "directory": "packages/zod-shared"
31
- },
32
- "publishConfig": {
33
- "access": "public"
34
- },
35
- "devDependencies": {
36
- "changelogen": "^0.6.1"
37
- }
38
- }
1
+ {
2
+ "name": "@pksep/zod-shared",
3
+ "version": "0.0.562",
4
+ "description": "Zod package for erp project. Contains dto, interfaces, schems, types, enum",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "build": "tsc -b --force",
12
+ "publish:lib": "changelogen --publish --patch --output CHANGELOG.md --from=HEAD~1 --no-provenance --no-git-checks",
13
+ "publish:canary": "changelogen --output CHANGELOG.md --from=HEAD~1 --no-git-checks && npm publish --tag canary --legacy-peer-deps --no-provenance",
14
+ "lint": "eslint \"**/*.ts\" --fix",
15
+ "prettier": "prettier --write .",
16
+ "prettier:check": "prettier --check ./**/*.ts",
17
+ "prepublishOnly": "bun run update-version && bun run build",
18
+ "update-version": "node bin/update-version.mjs",
19
+ "version": "git add -A src"
20
+ },
21
+ "dependencies": {
22
+ "lodash": "^4.17.21",
23
+ "@types/lodash": "^4.17.7",
24
+ "lz-string": "^1.5.0",
25
+ "zod": "^3.23.8"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/NPO-Automotive/sep_erp_server.git",
30
+ "directory": "packages/zod-shared"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "devDependencies": {
36
+ "changelogen": "^0.6.1"
37
+ }
38
+ }