@pksep/zod-shared 0.0.491 → 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/company/dto/companies-pagination.dto.d.ts +4 -4
- package/dist/company/dto/create-company.dto.d.ts +2 -2
- package/dist/company/dto/update-company.dto.d.ts +2 -2
- 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/material/dto/set-actual-shipment.dto.d.ts +18 -0
- package/dist/material/dto/set-actual-shipment.dto.js +10 -0
- package/dist/operations/schemas/operation.schema.js +4 -4
- package/dist/production-tasks/dto/create-operation-pos.dto.d.ts +13 -41
- package/dist/production-tasks/dto/create-operation-pos.dto.js +1 -2
- package/dist/production-tasks/dto/create-production-task.dto.d.ts +21 -28
- package/dist/production-tasks/dto/create-production-task.dto.js +3 -8
- package/dist/production-tasks/enums/production-tasks.d.ts +3 -3
- package/dist/production-tasks/enums/production-tasks.js +3 -3
- package/dist/production-tasks/index.d.ts +1 -1
- package/dist/production-tasks/index.js +1 -1
- package/dist/production-tasks/interfaces/production-tasks.d.ts +25 -16
- package/dist/production-tasks/methods/methods.d.ts +6 -2
- package/dist/production-tasks/methods/methods.js +42 -4
- package/dist/production-tasks/schemas/operation-positions.schema.d.ts +48 -0
- package/dist/production-tasks/schemas/operation-positions.schema.js +17 -0
- package/dist/production-tasks/schemas/production-operation-pos.schema.d.ts +13 -84
- package/dist/production-tasks/schemas/production-operation-pos.schema.js +8 -15
- 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/dist/utils/methods.d.ts +0 -2
- package/dist/utils/methods.js +0 -2
- package/package.json +1 -1
- package/dist/utils/methods/snake-conversion.d.ts +0 -19
- package/dist/utils/methods/snake-conversion.js +0 -51
|
@@ -12,13 +12,13 @@ export declare const companiesPaginationDtoZod: z.ZodObject<{
|
|
|
12
12
|
instrumentIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
|
|
13
13
|
inventaryIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
|
|
14
14
|
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
equipmentIds: number[];
|
|
16
15
|
materialIds: number[];
|
|
16
|
+
equipmentIds: number[];
|
|
17
17
|
instrumentIds: number[];
|
|
18
18
|
inventaryIds: number[];
|
|
19
19
|
}, {
|
|
20
|
-
equipmentIds?: number[] | undefined;
|
|
21
20
|
materialIds?: number[] | undefined;
|
|
21
|
+
equipmentIds?: number[] | undefined;
|
|
22
22
|
instrumentIds?: number[] | undefined;
|
|
23
23
|
inventaryIds?: number[] | undefined;
|
|
24
24
|
}>>;
|
|
@@ -30,8 +30,8 @@ export declare const companiesPaginationDtoZod: z.ZodObject<{
|
|
|
30
30
|
isBan: boolean;
|
|
31
31
|
filterByTypes: import("../enums/enums").DtoEnumCompanyType[];
|
|
32
32
|
filterByEntities?: {
|
|
33
|
-
equipmentIds: number[];
|
|
34
33
|
materialIds: number[];
|
|
34
|
+
equipmentIds: number[];
|
|
35
35
|
instrumentIds: number[];
|
|
36
36
|
inventaryIds: number[];
|
|
37
37
|
} | undefined;
|
|
@@ -43,8 +43,8 @@ export declare const companiesPaginationDtoZod: z.ZodObject<{
|
|
|
43
43
|
isBan?: boolean | undefined;
|
|
44
44
|
filterByTypes?: import("../enums/enums").DtoEnumCompanyType[] | undefined;
|
|
45
45
|
filterByEntities?: {
|
|
46
|
-
equipmentIds?: number[] | undefined;
|
|
47
46
|
materialIds?: number[] | undefined;
|
|
47
|
+
equipmentIds?: number[] | undefined;
|
|
48
48
|
instrumentIds?: number[] | undefined;
|
|
49
49
|
inventaryIds?: number[] | undefined;
|
|
50
50
|
} | undefined;
|
|
@@ -41,8 +41,8 @@ export declare const сreateCompanyDtoZod: z.ZodObject<{
|
|
|
41
41
|
value?: string | undefined;
|
|
42
42
|
};
|
|
43
43
|
}[] | undefined;
|
|
44
|
-
equipmentIds?: number[] | undefined;
|
|
45
44
|
materialIds?: number[] | undefined;
|
|
45
|
+
equipmentIds?: number[] | undefined;
|
|
46
46
|
instrumentIds?: number[] | undefined;
|
|
47
47
|
inventaryIds?: number[] | undefined;
|
|
48
48
|
contactIds?: number[] | undefined;
|
|
@@ -62,8 +62,8 @@ export declare const сreateCompanyDtoZod: z.ZodObject<{
|
|
|
62
62
|
value?: string | undefined;
|
|
63
63
|
};
|
|
64
64
|
}[] | undefined;
|
|
65
|
-
equipmentIds?: number[] | undefined;
|
|
66
65
|
materialIds?: number[] | undefined;
|
|
66
|
+
equipmentIds?: number[] | undefined;
|
|
67
67
|
instrumentIds?: number[] | undefined;
|
|
68
68
|
inventaryIds?: number[] | undefined;
|
|
69
69
|
contactIds?: number[] | undefined;
|
|
@@ -43,8 +43,8 @@ export declare const updateCompanyDtoZod: z.ZodObject<{
|
|
|
43
43
|
value?: string | undefined;
|
|
44
44
|
};
|
|
45
45
|
}[] | undefined;
|
|
46
|
-
equipmentIds?: number[] | undefined;
|
|
47
46
|
materialIds?: number[] | undefined;
|
|
47
|
+
equipmentIds?: number[] | undefined;
|
|
48
48
|
instrumentIds?: number[] | undefined;
|
|
49
49
|
inventaryIds?: number[] | undefined;
|
|
50
50
|
contactIds?: number[] | undefined;
|
|
@@ -65,8 +65,8 @@ export declare const updateCompanyDtoZod: z.ZodObject<{
|
|
|
65
65
|
value?: string | undefined;
|
|
66
66
|
};
|
|
67
67
|
}[] | undefined;
|
|
68
|
-
equipmentIds?: number[] | undefined;
|
|
69
68
|
materialIds?: number[] | undefined;
|
|
69
|
+
equipmentIds?: number[] | undefined;
|
|
70
70
|
instrumentIds?: number[] | undefined;
|
|
71
71
|
inventaryIds?: number[] | undefined;
|
|
72
72
|
contactIds?: number[] | undefined;
|
|
@@ -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
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SetActualShipmentMaterialDtoZod: z.ZodObject<{
|
|
3
|
+
materialIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
|
|
4
|
+
recursiveSpecificationObject: z.ZodDefault<z.ZodOptional<z.ZodAny>>;
|
|
5
|
+
shipmentToIgnore: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
6
|
+
transaction: z.ZodDefault<z.ZodOptional<z.ZodAny>>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
materialIds: number[];
|
|
9
|
+
recursiveSpecificationObject?: any;
|
|
10
|
+
shipmentToIgnore?: number | null | undefined;
|
|
11
|
+
transaction?: any;
|
|
12
|
+
}, {
|
|
13
|
+
materialIds?: number[] | undefined;
|
|
14
|
+
recursiveSpecificationObject?: any;
|
|
15
|
+
shipmentToIgnore?: number | null | undefined;
|
|
16
|
+
transaction?: any;
|
|
17
|
+
}>;
|
|
18
|
+
export type SetActualShipmentMaterialDtoType = z.infer<typeof SetActualShipmentMaterialDtoZod>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetActualShipmentMaterialDtoZod = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.SetActualShipmentMaterialDtoZod = zod_1.z.object({
|
|
6
|
+
materialIds: zod_1.z.array(zod_1.z.number()).optional().default([]),
|
|
7
|
+
recursiveSpecificationObject: zod_1.z.any().optional().default(undefined),
|
|
8
|
+
shipmentToIgnore: zod_1.z.number().optional().nullable(),
|
|
9
|
+
transaction: zod_1.z.any().optional().default({})
|
|
10
|
+
});
|
|
@@ -5,13 +5,13 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const marks_1 = require("../../marks");
|
|
6
6
|
exports.OperationSchema = zod_1.z.object({
|
|
7
7
|
id: zod_1.z.number().int().optional(),
|
|
8
|
-
idx: zod_1.z.number().int().
|
|
8
|
+
idx: zod_1.z.number().int().default(0),
|
|
9
9
|
name: zod_1.z.number().int(),
|
|
10
10
|
full_name: zod_1.z.string(),
|
|
11
11
|
ban: zod_1.z.boolean().default(false),
|
|
12
|
-
preTime: zod_1.z.number().
|
|
13
|
-
helperTime: zod_1.z.number().
|
|
14
|
-
mainTime: zod_1.z.number().
|
|
12
|
+
preTime: zod_1.z.number().default(0),
|
|
13
|
+
helperTime: zod_1.z.number().default(0),
|
|
14
|
+
mainTime: zod_1.z.number().default(0),
|
|
15
15
|
generalCountTime: zod_1.z.string().default(''),
|
|
16
16
|
description: zod_1.z.string().default(''),
|
|
17
17
|
instrumentList: zod_1.z.string().default(''),
|
|
@@ -9,34 +9,18 @@ export declare const CreateProductionOperationPosZod: z.ZodObject<{
|
|
|
9
9
|
idx: z.ZodNumber;
|
|
10
10
|
quantity: z.ZodNumber;
|
|
11
11
|
operation_positions: z.ZodArray<z.ZodObject<{
|
|
12
|
-
id: z.ZodNumber;
|
|
13
|
-
employeePositions: z.ZodArray<z.ZodType<import("..").IEmployeePosition, z.ZodTypeDef, import("..").IEmployeePosition>, "many">;
|
|
14
|
-
equipmentPositions: z.ZodArray<z.ZodType<import("..").IEquipmentPosition, z.ZodTypeDef, import("..").IEquipmentPosition>, "many">;
|
|
15
|
-
tOperationId: z.ZodNumber;
|
|
16
|
-
}, "strip", z.ZodTypeAny, {
|
|
17
|
-
id: number;
|
|
18
|
-
tOperationId: number;
|
|
19
|
-
employeePositions: import("..").IEmployeePosition[];
|
|
20
|
-
equipmentPositions: import("..").IEquipmentPosition[];
|
|
21
|
-
}, {
|
|
22
|
-
id: number;
|
|
23
|
-
tOperationId: number;
|
|
24
|
-
employeePositions: import("..").IEmployeePosition[];
|
|
25
|
-
equipmentPositions: import("..").IEquipmentPosition[];
|
|
26
|
-
}>, "many">;
|
|
27
|
-
user_filter: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
28
|
-
userId: z.ZodNumber;
|
|
29
12
|
operationId: z.ZodNumber;
|
|
30
|
-
|
|
13
|
+
employeeId: z.ZodNumber;
|
|
14
|
+
equipmentId: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
31
15
|
}, "strip", z.ZodTypeAny, {
|
|
32
|
-
userId: number;
|
|
33
16
|
operationId: number;
|
|
34
|
-
|
|
17
|
+
equipmentId: number | null;
|
|
18
|
+
employeeId: number;
|
|
35
19
|
}, {
|
|
36
|
-
userId: number;
|
|
37
20
|
operationId: number;
|
|
38
|
-
|
|
39
|
-
|
|
21
|
+
employeeId: number;
|
|
22
|
+
equipmentId?: number | null | undefined;
|
|
23
|
+
}>, "many">;
|
|
40
24
|
responsible_user_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
41
25
|
}, "strip", z.ZodTypeAny, {
|
|
42
26
|
type: StockOrderType;
|
|
@@ -44,39 +28,27 @@ export declare const CreateProductionOperationPosZod: z.ZodObject<{
|
|
|
44
28
|
quantity: number;
|
|
45
29
|
idx: number;
|
|
46
30
|
operation_positions: {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
equipmentPositions: import("..").IEquipmentPosition[];
|
|
31
|
+
operationId: number;
|
|
32
|
+
equipmentId: number | null;
|
|
33
|
+
employeeId: number;
|
|
51
34
|
}[];
|
|
52
35
|
id?: number | null | undefined;
|
|
53
36
|
responsible_user_id?: number | null | undefined;
|
|
54
37
|
ass_id?: number | null | undefined;
|
|
55
38
|
metall_id?: number | null | undefined;
|
|
56
|
-
user_filter?: {
|
|
57
|
-
userId: number;
|
|
58
|
-
operationId: number;
|
|
59
|
-
idx: number;
|
|
60
|
-
}[] | undefined;
|
|
61
39
|
}, {
|
|
62
40
|
type: StockOrderType;
|
|
63
41
|
production_task_id: number;
|
|
64
42
|
quantity: number;
|
|
65
43
|
idx: number;
|
|
66
44
|
operation_positions: {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
equipmentPositions: import("..").IEquipmentPosition[];
|
|
45
|
+
operationId: number;
|
|
46
|
+
employeeId: number;
|
|
47
|
+
equipmentId?: number | null | undefined;
|
|
71
48
|
}[];
|
|
72
49
|
id?: number | null | undefined;
|
|
73
50
|
responsible_user_id?: number | null | undefined;
|
|
74
51
|
ass_id?: number | null | undefined;
|
|
75
52
|
metall_id?: number | null | undefined;
|
|
76
|
-
user_filter?: {
|
|
77
|
-
userId: number;
|
|
78
|
-
operationId: number;
|
|
79
|
-
idx: number;
|
|
80
|
-
}[] | undefined;
|
|
81
53
|
}>;
|
|
82
54
|
export type CreateProductionOperationPosZodType = z.infer<typeof CreateProductionOperationPosZod>;
|
|
@@ -12,7 +12,6 @@ exports.CreateProductionOperationPosZod = zod_1.z.object({
|
|
|
12
12
|
metall_id: zod_1.z.number().nullish(),
|
|
13
13
|
idx: zod_1.z.number(),
|
|
14
14
|
quantity: zod_1.z.number(),
|
|
15
|
-
operation_positions: zod_1.z.array(production_operation_pos_schema_1.
|
|
16
|
-
user_filter: zod_1.z.array(production_operation_pos_schema_1.UserProdactionTaskFilterSchema).optional(),
|
|
15
|
+
operation_positions: zod_1.z.array(production_operation_pos_schema_1.createOperationPositionSchema),
|
|
17
16
|
responsible_user_id: zod_1.z.number().nullish().optional()
|
|
18
17
|
});
|
|
@@ -10,40 +10,35 @@ export declare const CreateProductionTaskDtoZod: z.ZodObject<{
|
|
|
10
10
|
idx: z.ZodNumber;
|
|
11
11
|
quantity: z.ZodNumber;
|
|
12
12
|
operationPositions: z.ZodArray<z.ZodObject<{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
tOperationId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
13
|
+
operationId: z.ZodNumber;
|
|
14
|
+
employeeId: z.ZodNumber;
|
|
15
|
+
equipmentId: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
17
16
|
}, "strip", z.ZodTypeAny, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
tOperationId?: number | null | undefined;
|
|
17
|
+
operationId: number;
|
|
18
|
+
equipmentId: number | null;
|
|
19
|
+
employeeId: number;
|
|
22
20
|
}, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
equipmentIds?: number[] | null | undefined;
|
|
21
|
+
operationId: number;
|
|
22
|
+
employeeId: number;
|
|
23
|
+
equipmentId?: number | null | undefined;
|
|
27
24
|
}>, "many">;
|
|
28
25
|
}, "strip", z.ZodTypeAny, {
|
|
29
26
|
id: number;
|
|
30
27
|
quantity: number;
|
|
31
28
|
idx: number;
|
|
32
29
|
operationPositions: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
tOperationId?: number | null | undefined;
|
|
30
|
+
operationId: number;
|
|
31
|
+
equipmentId: number | null;
|
|
32
|
+
employeeId: number;
|
|
37
33
|
}[];
|
|
38
34
|
}, {
|
|
39
35
|
id: number;
|
|
40
36
|
quantity: number;
|
|
41
37
|
idx: number;
|
|
42
38
|
operationPositions: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
equipmentIds?: number[] | null | undefined;
|
|
39
|
+
operationId: number;
|
|
40
|
+
employeeId: number;
|
|
41
|
+
equipmentId?: number | null | undefined;
|
|
47
42
|
}[];
|
|
48
43
|
}>, "many">;
|
|
49
44
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -56,10 +51,9 @@ export declare const CreateProductionTaskDtoZod: z.ZodObject<{
|
|
|
56
51
|
quantity: number;
|
|
57
52
|
idx: number;
|
|
58
53
|
operationPositions: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
tOperationId?: number | null | undefined;
|
|
54
|
+
operationId: number;
|
|
55
|
+
equipmentId: number | null;
|
|
56
|
+
employeeId: number;
|
|
63
57
|
}[];
|
|
64
58
|
}[];
|
|
65
59
|
description?: string | null | undefined;
|
|
@@ -72,10 +66,9 @@ export declare const CreateProductionTaskDtoZod: z.ZodObject<{
|
|
|
72
66
|
quantity: number;
|
|
73
67
|
idx: number;
|
|
74
68
|
operationPositions: {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
equipmentIds?: number[] | null | undefined;
|
|
69
|
+
operationId: number;
|
|
70
|
+
employeeId: number;
|
|
71
|
+
equipmentId?: number | null | undefined;
|
|
79
72
|
}[];
|
|
80
73
|
}[];
|
|
81
74
|
description?: string | null | undefined;
|
|
@@ -2,22 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreateProductionTaskDtoZod = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
id: zod_1.z.number().nullable().optional(),
|
|
7
|
-
employeeIds: zod_1.z.array(zod_1.z.number()).nullable().default([]),
|
|
8
|
-
equipmentIds: zod_1.z.array(zod_1.z.number()).nullable().default([]),
|
|
9
|
-
tOperationId: zod_1.z.number().nullable().optional()
|
|
10
|
-
});
|
|
5
|
+
const production_operation_pos_schema_1 = require("../schemas/production-operation-pos.schema");
|
|
11
6
|
const CreateProductionOperationPosSchema = zod_1.z.object({
|
|
12
7
|
id: zod_1.z.number(),
|
|
13
8
|
idx: zod_1.z.number(),
|
|
14
9
|
quantity: zod_1.z.number(),
|
|
15
|
-
operationPositions: zod_1.z.array(
|
|
10
|
+
operationPositions: zod_1.z.array(production_operation_pos_schema_1.createOperationPositionSchema)
|
|
16
11
|
});
|
|
17
12
|
exports.CreateProductionTaskDtoZod = zod_1.z.object({
|
|
18
13
|
dueDate: zod_1.z.string(),
|
|
19
14
|
typeWork: zod_1.z.custom(),
|
|
20
15
|
details_filters: zod_1.z.custom(),
|
|
21
16
|
productionOperationPos: zod_1.z.array(CreateProductionOperationPosSchema),
|
|
22
|
-
description: zod_1.z.string().
|
|
17
|
+
description: zod_1.z.string().nullish()
|
|
23
18
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare enum StatusProductionTaskEnum {
|
|
2
|
-
active = "
|
|
3
|
-
inactive = "
|
|
4
|
-
archive = "
|
|
2
|
+
active = "active",
|
|
3
|
+
inactive = "inactive",
|
|
4
|
+
archive = "archive"
|
|
5
5
|
}
|
|
6
6
|
export declare enum OrderTypeEnum {
|
|
7
7
|
sclad = "sclad",
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OrderTypeEnum = exports.StatusProductionTaskEnum = void 0;
|
|
4
4
|
var StatusProductionTaskEnum;
|
|
5
5
|
(function (StatusProductionTaskEnum) {
|
|
6
|
-
StatusProductionTaskEnum["active"] = "
|
|
7
|
-
StatusProductionTaskEnum["inactive"] = "
|
|
8
|
-
StatusProductionTaskEnum["archive"] = "
|
|
6
|
+
StatusProductionTaskEnum["active"] = "active";
|
|
7
|
+
StatusProductionTaskEnum["inactive"] = "inactive";
|
|
8
|
+
StatusProductionTaskEnum["archive"] = "archive";
|
|
9
9
|
})(StatusProductionTaskEnum || (exports.StatusProductionTaskEnum = StatusProductionTaskEnum = {}));
|
|
10
10
|
var OrderTypeEnum;
|
|
11
11
|
(function (OrderTypeEnum) {
|
|
@@ -16,7 +16,6 @@ export * from './dto/get-taks-by-toperation.dto';
|
|
|
16
16
|
export * from './dto/get-toperations.dto';
|
|
17
17
|
export * from './dto/online-board-working.dto';
|
|
18
18
|
export * from './dto/plan-production-task.dto';
|
|
19
|
-
export * from './dto/update-marks.dto';
|
|
20
19
|
export * from './dto/update-status.dto';
|
|
21
20
|
export * from './dto/update.dto';
|
|
22
21
|
export * from './dto/change-due-date.dto';
|
|
@@ -30,3 +29,4 @@ export * from './schemas/production-operation-pos.schema';
|
|
|
30
29
|
export * from './dto/create-operation-pos.dto';
|
|
31
30
|
export * from './methods/methods';
|
|
32
31
|
export * from './default-data/default-data';
|
|
32
|
+
export * from './schemas/operation-positions.schema';
|
|
@@ -32,7 +32,6 @@ __exportStar(require("./dto/get-taks-by-toperation.dto"), exports);
|
|
|
32
32
|
__exportStar(require("./dto/get-toperations.dto"), exports);
|
|
33
33
|
__exportStar(require("./dto/online-board-working.dto"), exports);
|
|
34
34
|
__exportStar(require("./dto/plan-production-task.dto"), exports);
|
|
35
|
-
__exportStar(require("./dto/update-marks.dto"), exports);
|
|
36
35
|
__exportStar(require("./dto/update-status.dto"), exports);
|
|
37
36
|
__exportStar(require("./dto/update.dto"), exports);
|
|
38
37
|
__exportStar(require("./dto/change-due-date.dto"), exports);
|
|
@@ -46,3 +45,4 @@ __exportStar(require("./schemas/production-operation-pos.schema"), exports);
|
|
|
46
45
|
__exportStar(require("./dto/create-operation-pos.dto"), exports);
|
|
47
46
|
__exportStar(require("./methods/methods"), exports);
|
|
48
47
|
__exportStar(require("./default-data/default-data"), exports);
|
|
48
|
+
__exportStar(require("./schemas/operation-positions.schema"), exports);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { ModelTechProcess } from '../../tech-process';
|
|
3
2
|
import { ModelUser } from '../../user';
|
|
4
3
|
import { IzdType, ProductionTimeType } from '../../utils';
|
|
@@ -6,13 +5,8 @@ import { ModelProductionTaskAssembly } from '../schemas/production-taks-assembly
|
|
|
6
5
|
import { ModelProductionTaskMetalloworking } from '../schemas/production-taks-metalloworkig.schema';
|
|
7
6
|
import { ModelProductionTask } from '../schemas/production-task.schema';
|
|
8
7
|
import { IFiltersByByOrder } from './online-board';
|
|
9
|
-
import { OperationPositionSchema } from '../schemas/production-operation-pos.schema';
|
|
10
8
|
import { ModelShipments } from '../../shipments';
|
|
11
|
-
|
|
12
|
-
userId: number;
|
|
13
|
-
operationId: number;
|
|
14
|
-
idx: number;
|
|
15
|
-
}
|
|
9
|
+
import { ModelOperationPosition } from '../schemas/operation-positions.schema';
|
|
16
10
|
export interface IMarkExecute {
|
|
17
11
|
quantity: number;
|
|
18
12
|
executionTime: number;
|
|
@@ -26,7 +20,6 @@ export interface IEmployeePosition {
|
|
|
26
20
|
export interface IEquipmentPosition {
|
|
27
21
|
equipmentId: number;
|
|
28
22
|
}
|
|
29
|
-
export type operationPositionType = z.infer<typeof OperationPositionSchema>;
|
|
30
23
|
export interface IDescriptionFilters {
|
|
31
24
|
byOrder: IFiltersByByOrder;
|
|
32
25
|
onlyDeficit: boolean;
|
|
@@ -38,7 +31,7 @@ export interface IDescriptionFilters {
|
|
|
38
31
|
export interface IProductionOperation {
|
|
39
32
|
entity: any;
|
|
40
33
|
id: number;
|
|
41
|
-
|
|
34
|
+
operationPosition?: ModelOperationPosition[];
|
|
42
35
|
ProductionTaskAssembly?: ModelProductionTaskAssembly;
|
|
43
36
|
ProductionTaskMetalloworking?: ModelProductionTaskMetalloworking;
|
|
44
37
|
kolvo_shipments: number;
|
|
@@ -46,9 +39,7 @@ export interface IProductionOperation {
|
|
|
46
39
|
collected?: number;
|
|
47
40
|
type_izd?: IzdType;
|
|
48
41
|
relativeType: IzdType;
|
|
49
|
-
startTime: Date | null;
|
|
50
42
|
responsibleUser: number | null;
|
|
51
|
-
globalIndex: number;
|
|
52
43
|
needsByProductinTask: number;
|
|
53
44
|
}
|
|
54
45
|
export interface ICreateProductionOperationPos {
|
|
@@ -57,12 +48,14 @@ export interface ICreateProductionOperationPos {
|
|
|
57
48
|
quantity: number;
|
|
58
49
|
operationPositions: IOperationPosition[];
|
|
59
50
|
}
|
|
60
|
-
interface IOperationPosition {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
equipmentIds: number[];
|
|
51
|
+
export interface IOperationPosition {
|
|
52
|
+
operationId: number;
|
|
53
|
+
employeeId: number;
|
|
54
|
+
equipmentId: number;
|
|
65
55
|
}
|
|
56
|
+
export type createOperationPosType = IOperationPosition & {
|
|
57
|
+
productionOperationPosId: number;
|
|
58
|
+
};
|
|
66
59
|
export interface IPrepareProductionOperation extends ModelProductionTask {
|
|
67
60
|
productionOperations: IProductionOperation[];
|
|
68
61
|
operationExecutionTime?: number;
|
|
@@ -92,6 +85,22 @@ export interface IGetDeficitsDetalByProductionTask {
|
|
|
92
85
|
deficitByDetal: number;
|
|
93
86
|
relativesIds: IRelativeIds;
|
|
94
87
|
}
|
|
88
|
+
export interface IActualOperationPos {
|
|
89
|
+
userId: number;
|
|
90
|
+
indexStartFrom?: number | null;
|
|
91
|
+
transaction?: any;
|
|
92
|
+
startTime?: Date;
|
|
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
|
+
}
|
|
95
104
|
export interface IRelativeIds {
|
|
96
105
|
productIds: number[];
|
|
97
106
|
cbedIds: number[];
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { ModelOperationPosition } from '../schemas/operation-positions.schema';
|
|
1
2
|
import { ModelProductionOperationPos } from '../schemas/production-operation-pos.schema';
|
|
2
|
-
export declare const findMinGlobalIndex: (operationPosItems:
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const findMinGlobalIndex: (operationPosItems: ModelOperationPosition[]) => number;
|
|
4
|
+
export declare const findOperationPosWithMinStartTime: (operationPositions: ModelOperationPosition[]) => ModelOperationPosition | null;
|
|
5
|
+
export declare const findMinStartTime: (allOperationPositions: ModelOperationPosition[]) => Date;
|
|
6
|
+
export declare const getActualProductionOperationPos: (operationPosItems: ModelOperationPosition[]) => ModelOperationPosition | null;
|
|
7
|
+
export declare const minStartTimeFromProductionPos: (productionOperationPositions: ModelProductionOperationPos[]) => Date | null;
|
|
@@ -1,19 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getActualProductionOperationPos = exports.findMinGlobalIndex = void 0;
|
|
3
|
+
exports.minStartTimeFromProductionPos = exports.getActualProductionOperationPos = exports.findMinStartTime = exports.findOperationPosWithMinStartTime = exports.findMinGlobalIndex = void 0;
|
|
4
4
|
const findMinGlobalIndex = (operationPosItems) => {
|
|
5
5
|
if (!(operationPosItems === null || operationPosItems === void 0 ? void 0 : operationPosItems.length))
|
|
6
6
|
return 0;
|
|
7
|
-
const startIndex = operationPosItems[0].
|
|
7
|
+
const startIndex = operationPosItems[0].idx;
|
|
8
8
|
return operationPosItems.reduce((min, item) => {
|
|
9
|
-
return item.
|
|
9
|
+
return item.idx < min ? item.idx : min;
|
|
10
10
|
}, startIndex);
|
|
11
11
|
};
|
|
12
12
|
exports.findMinGlobalIndex = findMinGlobalIndex;
|
|
13
|
+
const findOperationPosWithMinStartTime = (operationPositions) => (operationPositions === null || operationPositions === void 0 ? void 0 : operationPositions.length)
|
|
14
|
+
? operationPositions.reduce((prev, currentOperationPos) => {
|
|
15
|
+
const prevStartTime = new Date(prev.start_time).getTime();
|
|
16
|
+
const currentStartTime = new Date(currentOperationPos.start_time).getTime();
|
|
17
|
+
if (prevStartTime > currentStartTime)
|
|
18
|
+
return currentOperationPos;
|
|
19
|
+
else if (prevStartTime === currentStartTime &&
|
|
20
|
+
prev.idx > currentOperationPos.idx)
|
|
21
|
+
return currentOperationPos;
|
|
22
|
+
else
|
|
23
|
+
return prev;
|
|
24
|
+
}, operationPositions[0])
|
|
25
|
+
: null;
|
|
26
|
+
exports.findOperationPosWithMinStartTime = findOperationPosWithMinStartTime;
|
|
27
|
+
const findMinStartTime = (allOperationPositions) => (allOperationPositions === null || allOperationPositions === void 0 ? void 0 : allOperationPositions.length)
|
|
28
|
+
? allOperationPositions.reduce((minDate, operationPosition) => {
|
|
29
|
+
return new Date(operationPosition.start_time).getTime() <
|
|
30
|
+
new Date(minDate).getTime() && operationPosition.start_time
|
|
31
|
+
? operationPosition.start_time
|
|
32
|
+
: minDate;
|
|
33
|
+
}, new Date(new Date().setFullYear(new Date().getFullYear() + 1000)))
|
|
34
|
+
: new Date();
|
|
35
|
+
exports.findMinStartTime = findMinStartTime;
|
|
13
36
|
const getActualProductionOperationPos = (operationPosItems) => {
|
|
14
37
|
if (!(operationPosItems === null || operationPosItems === void 0 ? void 0 : operationPosItems.length))
|
|
15
38
|
return null;
|
|
16
39
|
const minIndex = (0, exports.findMinGlobalIndex)(operationPosItems);
|
|
17
|
-
return (operationPosItems.find(operationPos => operationPos.
|
|
40
|
+
return (operationPosItems.find(operationPos => operationPos.idx === minIndex) ||
|
|
41
|
+
null);
|
|
18
42
|
};
|
|
19
43
|
exports.getActualProductionOperationPos = getActualProductionOperationPos;
|
|
44
|
+
const minStartTimeFromProductionPos = (productionOperationPositions) => {
|
|
45
|
+
var _a;
|
|
46
|
+
if (!(productionOperationPositions === null || productionOperationPositions === void 0 ? void 0 : productionOperationPositions.length))
|
|
47
|
+
return null;
|
|
48
|
+
let allOperationPositions = [];
|
|
49
|
+
for (const productionOperationPos of productionOperationPositions) {
|
|
50
|
+
allOperationPositions = ((_a = productionOperationPos.operation_positions) === null || _a === void 0 ? void 0 : _a.length)
|
|
51
|
+
? allOperationPositions.concat(productionOperationPos.operation_positions)
|
|
52
|
+
: allOperationPositions;
|
|
53
|
+
}
|
|
54
|
+
const minStartTime = (0, exports.findMinStartTime)(allOperationPositions);
|
|
55
|
+
return minStartTime || null;
|
|
56
|
+
};
|
|
57
|
+
exports.minStartTimeFromProductionPos = minStartTimeFromProductionPos;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ModelUser } from '../../user';
|
|
3
|
+
import { ModelProductionOperationPos } from './production-operation-pos.schema';
|
|
4
|
+
import { ModelEquipment } from '../../equipment';
|
|
5
|
+
import { ModelOperation } from '../../operations';
|
|
6
|
+
export declare const OperationPositionSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodNumber;
|
|
8
|
+
start_time: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
9
|
+
idx: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
10
|
+
ban: z.ZodDefault<z.ZodBoolean>;
|
|
11
|
+
user_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
12
|
+
create_time_minutes: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
equipment_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
14
|
+
production_operation_pos_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
15
|
+
operation_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
16
|
+
createdAt: z.ZodDate;
|
|
17
|
+
updatedAt: z.ZodDate;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
ban: boolean;
|
|
20
|
+
id: number;
|
|
21
|
+
createdAt: Date;
|
|
22
|
+
updatedAt: Date;
|
|
23
|
+
create_time_minutes: number;
|
|
24
|
+
user_id?: number | null | undefined;
|
|
25
|
+
equipment_id?: number | null | undefined;
|
|
26
|
+
operation_id?: number | null | undefined;
|
|
27
|
+
idx?: number | undefined;
|
|
28
|
+
start_time?: Date | null | undefined;
|
|
29
|
+
production_operation_pos_id?: number | null | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
id: number;
|
|
32
|
+
createdAt: Date;
|
|
33
|
+
updatedAt: Date;
|
|
34
|
+
ban?: boolean | undefined;
|
|
35
|
+
user_id?: number | null | undefined;
|
|
36
|
+
equipment_id?: number | null | undefined;
|
|
37
|
+
operation_id?: number | null | undefined;
|
|
38
|
+
idx?: number | undefined;
|
|
39
|
+
start_time?: Date | null | undefined;
|
|
40
|
+
create_time_minutes?: number | undefined;
|
|
41
|
+
production_operation_pos_id?: number | null | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
export type ModelOperationPosition = z.infer<typeof OperationPositionSchema> & {
|
|
44
|
+
responsibleUser?: ModelUser;
|
|
45
|
+
prodctionOperationPos?: ModelProductionOperationPos;
|
|
46
|
+
equipment?: ModelEquipment;
|
|
47
|
+
operation?: ModelOperation;
|
|
48
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationPositionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.OperationPositionSchema = zod_1.z.object({
|
|
6
|
+
id: zod_1.z.number().int(),
|
|
7
|
+
start_time: zod_1.z.date().nullish(),
|
|
8
|
+
idx: zod_1.z.number().int().default(0).optional(),
|
|
9
|
+
ban: zod_1.z.boolean().default(false),
|
|
10
|
+
user_id: zod_1.z.number().int().nullish(),
|
|
11
|
+
create_time_minutes: zod_1.z.number().default(0),
|
|
12
|
+
equipment_id: zod_1.z.number().int().nullish(),
|
|
13
|
+
production_operation_pos_id: zod_1.z.number().nullish(),
|
|
14
|
+
operation_id: zod_1.z.number().int().nullish(),
|
|
15
|
+
createdAt: zod_1.z.date(),
|
|
16
|
+
updatedAt: zod_1.z.date()
|
|
17
|
+
});
|
|
@@ -1,38 +1,23 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ModelAssemble } from '../../assemble';
|
|
3
3
|
import { ModelMetaloworking } from '../../metaloworking';
|
|
4
|
-
import { IEmployeePosition, IEquipmentPosition } from '../interfaces/production-tasks';
|
|
5
4
|
import { ModelProductionTask } from './production-task.schema';
|
|
6
5
|
import { ModelUser } from '../../user';
|
|
7
6
|
import { StockOrderType } from '../../utils';
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import { ModelOperationPosition } from './operation-positions.schema';
|
|
8
|
+
import { StatusProductionTaskEnum } from '../enums/production-tasks';
|
|
9
|
+
export declare const createOperationPositionSchema: z.ZodObject<{
|
|
10
10
|
operationId: z.ZodNumber;
|
|
11
|
-
|
|
11
|
+
employeeId: z.ZodNumber;
|
|
12
|
+
equipmentId: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
12
13
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
userId: number;
|
|
14
14
|
operationId: number;
|
|
15
|
-
|
|
15
|
+
equipmentId: number | null;
|
|
16
|
+
employeeId: number;
|
|
16
17
|
}, {
|
|
17
|
-
userId: number;
|
|
18
18
|
operationId: number;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export declare const OperationPositionSchema: z.ZodObject<{
|
|
22
|
-
id: z.ZodNumber;
|
|
23
|
-
employeePositions: z.ZodArray<z.ZodType<IEmployeePosition, z.ZodTypeDef, IEmployeePosition>, "many">;
|
|
24
|
-
equipmentPositions: z.ZodArray<z.ZodType<IEquipmentPosition, z.ZodTypeDef, IEquipmentPosition>, "many">;
|
|
25
|
-
tOperationId: z.ZodNumber;
|
|
26
|
-
}, "strip", z.ZodTypeAny, {
|
|
27
|
-
id: number;
|
|
28
|
-
tOperationId: number;
|
|
29
|
-
employeePositions: IEmployeePosition[];
|
|
30
|
-
equipmentPositions: IEquipmentPosition[];
|
|
31
|
-
}, {
|
|
32
|
-
id: number;
|
|
33
|
-
tOperationId: number;
|
|
34
|
-
employeePositions: IEmployeePosition[];
|
|
35
|
-
equipmentPositions: IEquipmentPosition[];
|
|
19
|
+
employeeId: number;
|
|
20
|
+
equipmentId?: number | null | undefined;
|
|
36
21
|
}>;
|
|
37
22
|
export declare const ProductionOperationPosSchema: z.ZodObject<{
|
|
38
23
|
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -41,61 +26,20 @@ export declare const ProductionOperationPosSchema: z.ZodObject<{
|
|
|
41
26
|
ass_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
42
27
|
metall_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
43
28
|
idx: z.ZodNumber;
|
|
29
|
+
status: z.ZodDefault<z.ZodNativeEnum<typeof StatusProductionTaskEnum>>;
|
|
44
30
|
quantity_max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
45
|
-
start_time: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
46
|
-
user_filter: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
47
|
-
userId: z.ZodNumber;
|
|
48
|
-
operationId: z.ZodNumber;
|
|
49
|
-
idx: z.ZodNumber;
|
|
50
|
-
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
userId: number;
|
|
52
|
-
operationId: number;
|
|
53
|
-
idx: number;
|
|
54
|
-
}, {
|
|
55
|
-
userId: number;
|
|
56
|
-
operationId: number;
|
|
57
|
-
idx: number;
|
|
58
|
-
}>, "many">>;
|
|
59
31
|
responsible_user_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
60
32
|
quantity: z.ZodNumber;
|
|
61
|
-
global_index: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
62
|
-
create_time_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
63
33
|
ban: z.ZodDefault<z.ZodBoolean>;
|
|
64
|
-
operation_positions: z.ZodArray<z.ZodObject<{
|
|
65
|
-
id: z.ZodNumber;
|
|
66
|
-
employeePositions: z.ZodArray<z.ZodType<IEmployeePosition, z.ZodTypeDef, IEmployeePosition>, "many">;
|
|
67
|
-
equipmentPositions: z.ZodArray<z.ZodType<IEquipmentPosition, z.ZodTypeDef, IEquipmentPosition>, "many">;
|
|
68
|
-
tOperationId: z.ZodNumber;
|
|
69
|
-
}, "strip", z.ZodTypeAny, {
|
|
70
|
-
id: number;
|
|
71
|
-
tOperationId: number;
|
|
72
|
-
employeePositions: IEmployeePosition[];
|
|
73
|
-
equipmentPositions: IEquipmentPosition[];
|
|
74
|
-
}, {
|
|
75
|
-
id: number;
|
|
76
|
-
tOperationId: number;
|
|
77
|
-
employeePositions: IEmployeePosition[];
|
|
78
|
-
equipmentPositions: IEquipmentPosition[];
|
|
79
|
-
}>, "many">;
|
|
80
34
|
createdAt: z.ZodOptional<z.ZodDate>;
|
|
81
35
|
updatedAt: z.ZodOptional<z.ZodDate>;
|
|
82
36
|
}, "strip", z.ZodTypeAny, {
|
|
83
37
|
type: StockOrderType;
|
|
38
|
+
status: StatusProductionTaskEnum;
|
|
84
39
|
ban: boolean;
|
|
85
40
|
production_task_id: number;
|
|
86
41
|
quantity: number;
|
|
87
42
|
idx: number;
|
|
88
|
-
user_filter: {
|
|
89
|
-
userId: number;
|
|
90
|
-
operationId: number;
|
|
91
|
-
idx: number;
|
|
92
|
-
}[];
|
|
93
|
-
operation_positions: {
|
|
94
|
-
id: number;
|
|
95
|
-
tOperationId: number;
|
|
96
|
-
employeePositions: IEmployeePosition[];
|
|
97
|
-
equipmentPositions: IEquipmentPosition[];
|
|
98
|
-
}[];
|
|
99
43
|
id?: number | null | undefined;
|
|
100
44
|
responsible_user_id?: number | null | undefined;
|
|
101
45
|
createdAt?: Date | undefined;
|
|
@@ -103,20 +47,12 @@ export declare const ProductionOperationPosSchema: z.ZodObject<{
|
|
|
103
47
|
ass_id?: number | null | undefined;
|
|
104
48
|
metall_id?: number | null | undefined;
|
|
105
49
|
quantity_max?: number | null | undefined;
|
|
106
|
-
start_time?: Date | null | undefined;
|
|
107
|
-
global_index?: number | null | undefined;
|
|
108
|
-
create_time_minutes?: number | null | undefined;
|
|
109
50
|
}, {
|
|
110
51
|
type: StockOrderType;
|
|
111
52
|
production_task_id: number;
|
|
112
53
|
quantity: number;
|
|
113
54
|
idx: number;
|
|
114
|
-
|
|
115
|
-
id: number;
|
|
116
|
-
tOperationId: number;
|
|
117
|
-
employeePositions: IEmployeePosition[];
|
|
118
|
-
equipmentPositions: IEquipmentPosition[];
|
|
119
|
-
}[];
|
|
55
|
+
status?: StatusProductionTaskEnum | undefined;
|
|
120
56
|
ban?: boolean | undefined;
|
|
121
57
|
id?: number | null | undefined;
|
|
122
58
|
responsible_user_id?: number | null | undefined;
|
|
@@ -125,18 +61,11 @@ export declare const ProductionOperationPosSchema: z.ZodObject<{
|
|
|
125
61
|
ass_id?: number | null | undefined;
|
|
126
62
|
metall_id?: number | null | undefined;
|
|
127
63
|
quantity_max?: number | null | undefined;
|
|
128
|
-
start_time?: Date | null | undefined;
|
|
129
|
-
user_filter?: {
|
|
130
|
-
userId: number;
|
|
131
|
-
operationId: number;
|
|
132
|
-
idx: number;
|
|
133
|
-
}[] | undefined;
|
|
134
|
-
global_index?: number | null | undefined;
|
|
135
|
-
create_time_minutes?: number | null | undefined;
|
|
136
64
|
}>;
|
|
137
65
|
export type ModelProductionOperationPos = z.infer<typeof ProductionOperationPosSchema> & {
|
|
138
66
|
production_task?: ModelProductionTask;
|
|
139
67
|
assemble?: ModelAssemble;
|
|
68
|
+
operation_positions?: ModelOperationPosition[];
|
|
140
69
|
metaloworking?: ModelMetaloworking;
|
|
141
70
|
responsible_user?: ModelUser;
|
|
142
71
|
};
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductionOperationPosSchema = exports.
|
|
3
|
+
exports.ProductionOperationPosSchema = exports.createOperationPositionSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const production_tasks_1 = require("../enums/production-tasks");
|
|
7
|
+
exports.createOperationPositionSchema = zod_1.z.object({
|
|
8
8
|
operationId: zod_1.z.number(),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.OperationPositionSchema = zod_1.z.object({
|
|
12
|
-
id: zod_1.z.number(),
|
|
13
|
-
employeePositions: zod_1.z.array(zod_1.z.custom()),
|
|
14
|
-
equipmentPositions: zod_1.z.array(zod_1.z.custom()),
|
|
15
|
-
tOperationId: zod_1.z.number()
|
|
9
|
+
employeeId: zod_1.z.number(),
|
|
10
|
+
equipmentId: zod_1.z.number().nullish().default(null)
|
|
16
11
|
});
|
|
17
12
|
exports.ProductionOperationPosSchema = zod_1.z.object({
|
|
18
13
|
id: zod_1.z.number().nullish(),
|
|
@@ -21,15 +16,13 @@ exports.ProductionOperationPosSchema = zod_1.z.object({
|
|
|
21
16
|
ass_id: zod_1.z.number().nullish(),
|
|
22
17
|
metall_id: zod_1.z.number().nullish(),
|
|
23
18
|
idx: zod_1.z.number(),
|
|
19
|
+
status: zod_1.z
|
|
20
|
+
.nativeEnum(production_tasks_1.StatusProductionTaskEnum)
|
|
21
|
+
.default(production_tasks_1.StatusProductionTaskEnum.active),
|
|
24
22
|
quantity_max: zod_1.z.number().nullish(),
|
|
25
|
-
start_time: zod_1.z.date().nullish(),
|
|
26
|
-
user_filter: zod_1.z.array(exports.UserProdactionTaskFilterSchema).default([]),
|
|
27
23
|
responsible_user_id: zod_1.z.number().nullish(),
|
|
28
24
|
quantity: zod_1.z.number(),
|
|
29
|
-
global_index: zod_1.z.number().nullish(),
|
|
30
|
-
create_time_minutes: zod_1.z.number().nullish(),
|
|
31
25
|
ban: zod_1.z.boolean().default(false),
|
|
32
|
-
operation_positions: zod_1.z.array(exports.OperationPositionSchema),
|
|
33
26
|
createdAt: zod_1.z.date().optional(),
|
|
34
27
|
updatedAt: zod_1.z.date().optional()
|
|
35
28
|
});
|
|
@@ -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
|
});
|
package/dist/utils/methods.d.ts
CHANGED
|
@@ -87,8 +87,6 @@ export declare function lessPlusNum(num: number): number;
|
|
|
87
87
|
/**
|
|
88
88
|
* Рекурсивно клонирует объект или массив
|
|
89
89
|
* @param object
|
|
90
|
-
* @deprecated use lodash method _.deepClone or
|
|
91
|
-
* Object.assign({}, entity), or operation extension { ...entity }
|
|
92
90
|
* @returns
|
|
93
91
|
*/
|
|
94
92
|
export declare function copyObject(object: any | any[]): any | any[];
|
package/dist/utils/methods.js
CHANGED
|
@@ -241,8 +241,6 @@ function lessPlusNum(num) {
|
|
|
241
241
|
/**
|
|
242
242
|
* Рекурсивно клонирует объект или массив
|
|
243
243
|
* @param object
|
|
244
|
-
* @deprecated use lodash method _.deepClone or
|
|
245
|
-
* Object.assign({}, entity), or operation extension { ...entity }
|
|
246
244
|
* @returns
|
|
247
245
|
*/
|
|
248
246
|
function copyObject(object) {
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
type CamelToSnake<T> = T extends Array<infer U> ? Array<CamelToSnake<U>> : T extends Record<string, any> ? {
|
|
2
|
-
[K in keyof T as K extends string ? K extends `${infer A}${infer B}` ? `${A extends Uppercase<A> ? A : Lowercase<A>}${B extends Uppercase<B> ? `_${Lowercase<B>}` : B extends string ? B : ''}` : K : never]: CamelToSnake<T[K]>;
|
|
3
|
-
} : T;
|
|
4
|
-
type SnakeToCamel<T> = T extends Array<infer U> ? Array<SnakeToCamel<U>> : T extends Record<string, any> ? {
|
|
5
|
-
[K in keyof T as K extends string ? K extends `${string}_${string}` ? K extends `${infer A}_${infer B}` ? `${A}${Capitalize<SnakeToCamel<B>>}` : K : K : never]: SnakeToCamel<T[K]>;
|
|
6
|
-
} : T;
|
|
7
|
-
/**
|
|
8
|
-
* Converts object keys from camelCase to snake_case
|
|
9
|
-
* @param obj The object to convert
|
|
10
|
-
* @returns A new object with snake_case keys
|
|
11
|
-
*/
|
|
12
|
-
export declare function camelToSnake<T>(obj: T): CamelToSnake<T>;
|
|
13
|
-
/**
|
|
14
|
-
* Converts object keys from snake_case to camelCase
|
|
15
|
-
* @param obj The object to convert
|
|
16
|
-
* @returns A new object with camelCase keys
|
|
17
|
-
*/
|
|
18
|
-
export declare function snakeToCamel<T>(obj: T): SnakeToCamel<T>;
|
|
19
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.camelToSnake = camelToSnake;
|
|
4
|
-
exports.snakeToCamel = snakeToCamel;
|
|
5
|
-
/**
|
|
6
|
-
* Converts object keys from camelCase to snake_case
|
|
7
|
-
* @param obj The object to convert
|
|
8
|
-
* @returns A new object with snake_case keys
|
|
9
|
-
*/
|
|
10
|
-
function camelToSnake(obj) {
|
|
11
|
-
if (obj === null ||
|
|
12
|
-
obj === undefined ||
|
|
13
|
-
typeof obj !== 'object' ||
|
|
14
|
-
obj instanceof Date ||
|
|
15
|
-
obj instanceof RegExp) {
|
|
16
|
-
return obj;
|
|
17
|
-
}
|
|
18
|
-
if (Array.isArray(obj)) {
|
|
19
|
-
return obj.map(item => camelToSnake(item));
|
|
20
|
-
}
|
|
21
|
-
const result = {};
|
|
22
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
23
|
-
// Convert camelCase key to snake_case
|
|
24
|
-
const snakeKey = key.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase();
|
|
25
|
-
result[snakeKey] = camelToSnake(value);
|
|
26
|
-
}
|
|
27
|
-
return result;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Converts object keys from snake_case to camelCase
|
|
31
|
-
* @param obj The object to convert
|
|
32
|
-
* @returns A new object with camelCase keys
|
|
33
|
-
*/
|
|
34
|
-
function snakeToCamel(obj) {
|
|
35
|
-
if (obj === null ||
|
|
36
|
-
obj === undefined ||
|
|
37
|
-
typeof obj !== 'object' ||
|
|
38
|
-
obj instanceof Date ||
|
|
39
|
-
obj instanceof RegExp) {
|
|
40
|
-
return obj;
|
|
41
|
-
}
|
|
42
|
-
if (Array.isArray(obj)) {
|
|
43
|
-
return obj.map(item => snakeToCamel(item));
|
|
44
|
-
}
|
|
45
|
-
const result = {};
|
|
46
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
47
|
-
const camelKey = key.replace(/_([a-z])/g, (match, letter) => letter.toUpperCase());
|
|
48
|
-
result[camelKey] = snakeToCamel(value);
|
|
49
|
-
}
|
|
50
|
-
return result;
|
|
51
|
-
}
|