@pksep/zod-shared 0.0.492 → 0.0.493
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/marks/dto/get-result-work.dto.d.ts +4 -18
- package/dist/marks/dto/get-result-work.dto.js +1 -4
- package/dist/material/dto/get-deficit.dto.d.ts +31 -0
- package/dist/material/dto/get-deficit.dto.js +18 -0
- package/dist/production-tasks/dto/update-marks.dto.d.ts +31 -3
- package/dist/production-tasks/dto/update-marks.dto.js +3 -2
- package/dist/production-tasks/interfaces/production-tasks.d.ts +10 -0
- package/dist/production-tasks/methods/methods.js +3 -1
- package/dist/role/default-value/index.js +18 -6
- package/dist/shipments/dto/shipments-paginate.dto.d.ts +3 -0
- package/dist/shipments/dto/shipments-paginate.dto.js +1 -0
- package/dist/user/dto/auth-user.dto.d.ts +3 -6
- package/dist/user/dto/auth-user.dto.js +1 -2
- package/package.json +1 -1
|
@@ -1,36 +1,22 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { DateRangeType } from '../../utils';
|
|
2
3
|
export declare const getResultWorkingPaginationSchemaDto: z.ZodObject<{
|
|
3
4
|
page: z.ZodNumber;
|
|
4
5
|
responsibleUserIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
5
6
|
selectTypeOperation: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6
7
|
searchString: z.ZodOptional<z.ZodString>;
|
|
7
|
-
dateRange: z.
|
|
8
|
-
start: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
-
end: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
start?: string | null | undefined;
|
|
12
|
-
end?: string | null | undefined;
|
|
13
|
-
}, {
|
|
14
|
-
start?: string | null | undefined;
|
|
15
|
-
end?: string | null | undefined;
|
|
16
|
-
}>;
|
|
8
|
+
dateRange: z.ZodOptional<z.ZodNullable<z.ZodType<DateRangeType, z.ZodTypeDef, DateRangeType>>>;
|
|
17
9
|
}, "strip", z.ZodTypeAny, {
|
|
18
10
|
page: number;
|
|
19
|
-
dateRange: {
|
|
20
|
-
start?: string | null | undefined;
|
|
21
|
-
end?: string | null | undefined;
|
|
22
|
-
};
|
|
23
11
|
responsibleUserIds?: number[] | undefined;
|
|
24
12
|
selectTypeOperation?: number | null | undefined;
|
|
25
13
|
searchString?: string | undefined;
|
|
14
|
+
dateRange?: DateRangeType | null | undefined;
|
|
26
15
|
}, {
|
|
27
16
|
page: number;
|
|
28
|
-
dateRange: {
|
|
29
|
-
start?: string | null | undefined;
|
|
30
|
-
end?: string | null | undefined;
|
|
31
|
-
};
|
|
32
17
|
responsibleUserIds?: number[] | undefined;
|
|
33
18
|
selectTypeOperation?: number | null | undefined;
|
|
34
19
|
searchString?: string | undefined;
|
|
20
|
+
dateRange?: DateRangeType | null | undefined;
|
|
35
21
|
}>;
|
|
36
22
|
export type GetResultWorkingPaginationDto = z.infer<typeof getResultWorkingPaginationSchemaDto>;
|
|
@@ -7,8 +7,5 @@ exports.getResultWorkingPaginationSchemaDto = zod_1.z.object({
|
|
|
7
7
|
responsibleUserIds: zod_1.z.array(zod_1.z.number()).optional(),
|
|
8
8
|
selectTypeOperation: zod_1.z.number().int().nullish(),
|
|
9
9
|
searchString: zod_1.z.string().optional(),
|
|
10
|
-
dateRange: zod_1.z.
|
|
11
|
-
start: zod_1.z.string().nullable().optional(),
|
|
12
|
-
end: zod_1.z.string().nullable().optional()
|
|
13
|
-
})
|
|
10
|
+
dateRange: zod_1.z.custom().nullish()
|
|
14
11
|
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { enumDeficit, statusWorkingsDeficit } from '../../utils';
|
|
3
|
+
export declare const GetMaterialDeficitDtoZod: z.ZodObject<{
|
|
4
|
+
materialIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
|
|
5
|
+
typeMaterialIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
|
|
6
|
+
subTypeMaterialIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
|
|
7
|
+
statusWorking: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof statusWorkingsDeficit>>>;
|
|
8
|
+
statusDeficit: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof enumDeficit>>>;
|
|
9
|
+
searchString: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
10
|
+
shipmentIds: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>>;
|
|
11
|
+
page: z.ZodNumber;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
page: number;
|
|
14
|
+
searchString: string;
|
|
15
|
+
materialIds: number[];
|
|
16
|
+
typeMaterialIds: number[];
|
|
17
|
+
subTypeMaterialIds: number[];
|
|
18
|
+
statusWorking: statusWorkingsDeficit;
|
|
19
|
+
statusDeficit: enumDeficit;
|
|
20
|
+
shipmentIds: number[] | null;
|
|
21
|
+
}, {
|
|
22
|
+
page: number;
|
|
23
|
+
searchString?: string | undefined;
|
|
24
|
+
materialIds?: number[] | undefined;
|
|
25
|
+
typeMaterialIds?: number[] | undefined;
|
|
26
|
+
subTypeMaterialIds?: number[] | undefined;
|
|
27
|
+
statusWorking?: statusWorkingsDeficit | undefined;
|
|
28
|
+
statusDeficit?: enumDeficit | undefined;
|
|
29
|
+
shipmentIds?: number[] | null | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
export type GetMaterialDeficitDtoType = z.infer<typeof GetMaterialDeficitDtoZod>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetMaterialDeficitDtoZod = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
exports.GetMaterialDeficitDtoZod = zod_1.z.object({
|
|
7
|
+
materialIds: zod_1.z.array(zod_1.z.number()).optional().default([]),
|
|
8
|
+
typeMaterialIds: zod_1.z.array(zod_1.z.number()).optional().default([]),
|
|
9
|
+
subTypeMaterialIds: zod_1.z.array(zod_1.z.number()).optional().default([]),
|
|
10
|
+
statusWorking: zod_1.z
|
|
11
|
+
.nativeEnum(utils_1.statusWorkingsDeficit)
|
|
12
|
+
.optional()
|
|
13
|
+
.default(utils_1.statusWorkingsDeficit.all),
|
|
14
|
+
statusDeficit: zod_1.z.nativeEnum(utils_1.enumDeficit).optional().default(utils_1.enumDeficit.all),
|
|
15
|
+
searchString: zod_1.z.string().optional().default(''),
|
|
16
|
+
shipmentIds: zod_1.z.number().int().array().optional().nullable().default(null),
|
|
17
|
+
page: zod_1.z.number().int()
|
|
18
|
+
});
|
|
@@ -1,9 +1,37 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const UpdateProductionTaskMarksDtoZod: z.ZodObject<{
|
|
3
|
-
|
|
3
|
+
operationPosition: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
4
|
+
id: z.ZodNumber;
|
|
5
|
+
employeePositions: z.ZodArray<z.ZodType<import("..").IEmployeePosition, z.ZodTypeDef, import("..").IEmployeePosition>, "many">;
|
|
6
|
+
equipmentPositions: z.ZodArray<z.ZodType<import("..").IEquipmentPosition, z.ZodTypeDef, import("..").IEquipmentPosition>, "many">;
|
|
7
|
+
tOperationId: z.ZodNumber;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
id: number;
|
|
10
|
+
tOperationId: number;
|
|
11
|
+
employeePositions: import("..").IEmployeePosition[];
|
|
12
|
+
equipmentPositions: import("..").IEquipmentPosition[];
|
|
13
|
+
}, {
|
|
14
|
+
id: number;
|
|
15
|
+
tOperationId: number;
|
|
16
|
+
employeePositions: import("..").IEmployeePosition[];
|
|
17
|
+
equipmentPositions: import("..").IEquipmentPosition[];
|
|
18
|
+
}>, "many">>>;
|
|
19
|
+
productionTaskId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
4
20
|
}, "strip", z.ZodTypeAny, {
|
|
5
|
-
|
|
21
|
+
operationPosition?: {
|
|
22
|
+
id: number;
|
|
23
|
+
tOperationId: number;
|
|
24
|
+
employeePositions: import("..").IEmployeePosition[];
|
|
25
|
+
equipmentPositions: import("..").IEquipmentPosition[];
|
|
26
|
+
}[] | null | undefined;
|
|
27
|
+
productionTaskId?: number | null | undefined;
|
|
6
28
|
}, {
|
|
7
|
-
|
|
29
|
+
operationPosition?: {
|
|
30
|
+
id: number;
|
|
31
|
+
tOperationId: number;
|
|
32
|
+
employeePositions: import("..").IEmployeePosition[];
|
|
33
|
+
equipmentPositions: import("..").IEquipmentPosition[];
|
|
34
|
+
}[] | null | undefined;
|
|
35
|
+
productionTaskId?: number | null | undefined;
|
|
8
36
|
}>;
|
|
9
37
|
export type UpdateProductionTaskMarksDtoZodType = z.infer<typeof UpdateProductionTaskMarksDtoZod>;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpdateProductionTaskMarksDtoZod = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const production_operation_pos_schema_1 = require("../schemas/production-operation-pos.schema");
|
|
5
6
|
exports.UpdateProductionTaskMarksDtoZod = zod_1.z.object({
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
operationPosition: zod_1.z.array(production_operation_pos_schema_1.OperationPositionSchema).nullable().optional(),
|
|
8
|
+
productionTaskId: zod_1.z.number().int().nullable().optional()
|
|
8
9
|
});
|
|
@@ -91,6 +91,16 @@ export interface IActualOperationPos {
|
|
|
91
91
|
transaction?: any;
|
|
92
92
|
startTime?: Date;
|
|
93
93
|
}
|
|
94
|
+
export interface IOperationPositionToChangeTime {
|
|
95
|
+
id: number;
|
|
96
|
+
start_time: Date;
|
|
97
|
+
production_operation_pos_id: number;
|
|
98
|
+
quantity_max: number;
|
|
99
|
+
create_time_minutes: number;
|
|
100
|
+
preTime: number;
|
|
101
|
+
helperTime: number;
|
|
102
|
+
mainTime: number;
|
|
103
|
+
}
|
|
94
104
|
export interface IRelativeIds {
|
|
95
105
|
productIds: number[];
|
|
96
106
|
cbedIds: number[];
|
|
@@ -27,7 +27,7 @@ exports.findOperationPosWithMinStartTime = findOperationPosWithMinStartTime;
|
|
|
27
27
|
const findMinStartTime = (allOperationPositions) => (allOperationPositions === null || allOperationPositions === void 0 ? void 0 : allOperationPositions.length)
|
|
28
28
|
? allOperationPositions.reduce((minDate, operationPosition) => {
|
|
29
29
|
return new Date(operationPosition.start_time).getTime() <
|
|
30
|
-
new Date(minDate).getTime()
|
|
30
|
+
new Date(minDate).getTime() && operationPosition.start_time
|
|
31
31
|
? operationPosition.start_time
|
|
32
32
|
: minDate;
|
|
33
33
|
}, new Date(new Date().setFullYear(new Date().getFullYear() + 1000)))
|
|
@@ -43,6 +43,8 @@ const getActualProductionOperationPos = (operationPosItems) => {
|
|
|
43
43
|
exports.getActualProductionOperationPos = getActualProductionOperationPos;
|
|
44
44
|
const minStartTimeFromProductionPos = (productionOperationPositions) => {
|
|
45
45
|
var _a;
|
|
46
|
+
if (!(productionOperationPositions === null || productionOperationPositions === void 0 ? void 0 : productionOperationPositions.length))
|
|
47
|
+
return null;
|
|
46
48
|
let allOperationPositions = [];
|
|
47
49
|
for (const productionOperationPos of productionOperationPositions) {
|
|
48
50
|
allOperationPositions = ((_a = productionOperationPos.operation_positions) === null || _a === void 0 ? void 0 : _a.length)
|
|
@@ -8,6 +8,24 @@ exports.accessRoleDefaultValue = {
|
|
|
8
8
|
changeEverything: true,
|
|
9
9
|
title: 'Продукци'
|
|
10
10
|
},
|
|
11
|
+
marks: {
|
|
12
|
+
read: true,
|
|
13
|
+
changeYour: true,
|
|
14
|
+
changeEverything: true,
|
|
15
|
+
title: 'Отметки об выполнении'
|
|
16
|
+
},
|
|
17
|
+
actions: {
|
|
18
|
+
read: true,
|
|
19
|
+
changeYour: true,
|
|
20
|
+
changeEverything: true,
|
|
21
|
+
title: 'Действия'
|
|
22
|
+
},
|
|
23
|
+
production: {
|
|
24
|
+
read: true,
|
|
25
|
+
changeYour: true,
|
|
26
|
+
changeEverything: true,
|
|
27
|
+
title: 'Производство'
|
|
28
|
+
},
|
|
11
29
|
workResult: {
|
|
12
30
|
read: true,
|
|
13
31
|
changeYour: true,
|
|
@@ -407,11 +425,5 @@ exports.accessRoleDefaultValue = {
|
|
|
407
425
|
changeYour: true,
|
|
408
426
|
changeEverything: true,
|
|
409
427
|
title: 'Операции'
|
|
410
|
-
},
|
|
411
|
-
marks: {
|
|
412
|
-
read: true,
|
|
413
|
-
changeYour: true,
|
|
414
|
-
changeEverything: true,
|
|
415
|
-
title: 'Отметки об выполнении'
|
|
416
428
|
}
|
|
417
429
|
};
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { statusShipment } from '../../utils';
|
|
3
3
|
export declare const ShipmentsPaginateSchema: z.ZodObject<{
|
|
4
4
|
offset: z.ZodNumber;
|
|
5
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
5
6
|
status: z.ZodArray<z.ZodNativeEnum<typeof statusShipment>, "many">;
|
|
6
7
|
dateRange: z.ZodUnion<[z.ZodObject<{
|
|
7
8
|
start: z.ZodString;
|
|
@@ -24,6 +25,7 @@ export declare const ShipmentsPaginateSchema: z.ZodObject<{
|
|
|
24
25
|
} | null;
|
|
25
26
|
offset: number;
|
|
26
27
|
attributes?: string[] | undefined;
|
|
28
|
+
parentId?: number | null | undefined;
|
|
27
29
|
searchStr?: string | undefined;
|
|
28
30
|
companyId?: number | null | undefined;
|
|
29
31
|
}, {
|
|
@@ -34,6 +36,7 @@ export declare const ShipmentsPaginateSchema: z.ZodObject<{
|
|
|
34
36
|
} | null;
|
|
35
37
|
offset: number;
|
|
36
38
|
attributes?: string[] | undefined;
|
|
39
|
+
parentId?: number | null | undefined;
|
|
37
40
|
searchStr?: string | undefined;
|
|
38
41
|
companyId?: number | null | undefined;
|
|
39
42
|
}>;
|
|
@@ -5,6 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
exports.ShipmentsPaginateSchema = zod_1.z.object({
|
|
7
7
|
offset: zod_1.z.number().int().nonnegative(),
|
|
8
|
+
parentId: zod_1.z.number().nullish(),
|
|
8
9
|
status: zod_1.z.array(zod_1.z.nativeEnum(utils_1.statusShipment)),
|
|
9
10
|
dateRange: zod_1.z.union([
|
|
10
11
|
zod_1.z.object({
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const AuthUserDtoZod: z.ZodObject<{
|
|
3
|
-
tabel: z.
|
|
4
|
-
login: z.ZodString;
|
|
3
|
+
tabel: z.ZodString;
|
|
5
4
|
password: z.ZodString;
|
|
6
5
|
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
|
|
6
|
+
tabel: string;
|
|
8
7
|
password: string;
|
|
9
|
-
tabel?: string | undefined;
|
|
10
8
|
}, {
|
|
11
|
-
|
|
9
|
+
tabel: string;
|
|
12
10
|
password: string;
|
|
13
|
-
tabel?: string | undefined;
|
|
14
11
|
}>;
|
|
15
12
|
export type AuthUserDtoZodType = z.infer<typeof AuthUserDtoZod>;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AuthUserDtoZod = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.AuthUserDtoZod = zod_1.z.object({
|
|
6
|
-
tabel: zod_1.z.string()
|
|
7
|
-
login: zod_1.z.string(),
|
|
6
|
+
tabel: zod_1.z.string(),
|
|
8
7
|
password: zod_1.z.string()
|
|
9
8
|
});
|