@floristcloud/api-lib 1.2.68 → 1.2.70
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/build/commands/wrire-off-archive/get-write-off-archive-files-by-uuids.command.js +17 -0
- package/build/commands/wrire-off-archive/get-write-off-archive-files.command.js +2 -12
- package/build/commands/wrire-off-archive/index.js +1 -0
- package/build/commands/write-off/export-selected-write-offs.command.js +17 -0
- package/build/commands/write-off/get-write-off-list.query.js +15 -1
- package/build/commands/write-off/index.js +1 -0
- package/build/schemas/index.js +2 -0
- package/build/schemas/write-off/write-off-archive-file.schema.js +14 -0
- package/build/schemas/write-off/write-off-export.schema.js +7 -0
- package/commands/wrire-off-archive/get-write-off-archive-files-by-uuids.command.ts +19 -0
- package/commands/wrire-off-archive/get-write-off-archive-files.command.ts +2 -13
- package/commands/wrire-off-archive/index.ts +1 -0
- package/commands/write-off/export-selected-write-offs.command.ts +19 -0
- package/commands/write-off/get-write-off-list.query.ts +29 -12
- package/commands/write-off/index.ts +1 -0
- package/package.json +1 -1
- package/schemas/index.ts +2 -0
- package/schemas/write-off/write-off-archive-file.schema.ts +13 -0
- package/schemas/write-off/write-off-export.schema.ts +5 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetWriteOffArchiveFilesByUuidsContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
|
+
const GetWriteOffArchiveFilesByUuidsRequestSchema = zod_1.z.object({
|
|
7
|
+
writeOffUUIDs: zod_1.z.array(zod_1.z.string().uuid()).min(1).max(500),
|
|
8
|
+
});
|
|
9
|
+
const GetWriteOffArchiveFilesByUuidsResponseSchema = zod_1.z.object({
|
|
10
|
+
message: zod_1.z.string().optional(),
|
|
11
|
+
data: schemas_1.WriteOffArchiveFilesSchema.nullable(),
|
|
12
|
+
});
|
|
13
|
+
var GetWriteOffArchiveFilesByUuidsContractCommand;
|
|
14
|
+
(function (GetWriteOffArchiveFilesByUuidsContractCommand) {
|
|
15
|
+
GetWriteOffArchiveFilesByUuidsContractCommand.RequestSchema = GetWriteOffArchiveFilesByUuidsRequestSchema;
|
|
16
|
+
GetWriteOffArchiveFilesByUuidsContractCommand.ResponseSchema = GetWriteOffArchiveFilesByUuidsResponseSchema;
|
|
17
|
+
})(GetWriteOffArchiveFilesByUuidsContractCommand || (exports.GetWriteOffArchiveFilesByUuidsContractCommand = GetWriteOffArchiveFilesByUuidsContractCommand = {}));
|
|
@@ -2,20 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetWriteOffArchiveFilesContractQuery = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
file_key: zod_1.z.string(),
|
|
7
|
-
grower: zod_1.z.string(),
|
|
8
|
-
name: zod_1.z.string(),
|
|
9
|
-
size: zod_1.z.string(),
|
|
10
|
-
categoryName: zod_1.z.string(),
|
|
11
|
-
});
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
12
6
|
const GetWriteOffArchiveFilesResponseSchema = zod_1.z.object({
|
|
13
7
|
message: zod_1.z.string().optional(),
|
|
14
|
-
data:
|
|
15
|
-
.object({
|
|
16
|
-
files: zod_1.z.array(ArchiveFileItemSchema),
|
|
17
|
-
})
|
|
18
|
-
.nullable(),
|
|
8
|
+
data: schemas_1.WriteOffArchiveFilesSchema.nullable(),
|
|
19
9
|
});
|
|
20
10
|
var GetWriteOffArchiveFilesContractQuery;
|
|
21
11
|
(function (GetWriteOffArchiveFilesContractQuery) {
|
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./create-wrire-off-archive.command"), exports);
|
|
18
18
|
__exportStar(require("./info-wrire-off-archive.command"), exports);
|
|
19
19
|
__exportStar(require("./get-write-off-archive-files.command"), exports);
|
|
20
|
+
__exportStar(require("./get-write-off-archive-files-by-uuids.command"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExportSelectedWriteOffsContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
|
+
const ExportSelectedWriteOffsRequestSchema = zod_1.z.object({
|
|
7
|
+
writeOffUUIDs: zod_1.z.array(zod_1.z.string().uuid()).min(1).max(500),
|
|
8
|
+
});
|
|
9
|
+
const ExportSelectedWriteOffsResponseSchema = zod_1.z.object({
|
|
10
|
+
message: zod_1.z.string().optional(),
|
|
11
|
+
data: schemas_1.WriteOffExportSchema,
|
|
12
|
+
});
|
|
13
|
+
var ExportSelectedWriteOffsContractCommand;
|
|
14
|
+
(function (ExportSelectedWriteOffsContractCommand) {
|
|
15
|
+
ExportSelectedWriteOffsContractCommand.RequestSchema = ExportSelectedWriteOffsRequestSchema;
|
|
16
|
+
ExportSelectedWriteOffsContractCommand.ResponseSchema = ExportSelectedWriteOffsResponseSchema;
|
|
17
|
+
})(ExportSelectedWriteOffsContractCommand || (exports.ExportSelectedWriteOffsContractCommand = ExportSelectedWriteOffsContractCommand = {}));
|
|
@@ -4,7 +4,9 @@ exports.GetWriteOffListContractQuery = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const schemas_1 = require("../../schemas");
|
|
6
6
|
const enum_1 = require("../../enum");
|
|
7
|
-
const
|
|
7
|
+
const date_helper_1 = require("../../helpers/date.helper");
|
|
8
|
+
const GetWriteOffListRequestSchema = zod_1.z
|
|
9
|
+
.object({
|
|
8
10
|
productUUID: zod_1.z.string().optional(),
|
|
9
11
|
categoryUUID: zod_1.z.string().optional(),
|
|
10
12
|
consignmentUUID: zod_1.z.string().optional(),
|
|
@@ -13,8 +15,20 @@ const GetWriteOffListRequestSchema = zod_1.z.object({
|
|
|
13
15
|
searchQuery: zod_1.z.string().optional(),
|
|
14
16
|
responsibleUserUUID: zod_1.z.string().optional(),
|
|
15
17
|
status: zod_1.z.nativeEnum(enum_1.WriteOffStatusEnum).optional(),
|
|
18
|
+
startDate: zod_1.z.coerce.date().optional(),
|
|
19
|
+
endDate: zod_1.z.coerce.date().optional(),
|
|
16
20
|
page: zod_1.z.coerce.number().optional().default(1),
|
|
17
21
|
count: zod_1.z.coerce.number().optional().default(10),
|
|
22
|
+
})
|
|
23
|
+
.refine(value => {
|
|
24
|
+
const { startDate, endDate } = value;
|
|
25
|
+
if (startDate && endDate) {
|
|
26
|
+
return (0, date_helper_1.dateRangeCheck)(startDate, endDate);
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
}, {
|
|
30
|
+
message: 'End date must be greater than start date',
|
|
31
|
+
path: ['endDate', 'startDate'],
|
|
18
32
|
});
|
|
19
33
|
const GetWriteOffListResponseSchema = zod_1.z.object({
|
|
20
34
|
message: zod_1.z.string().optional(),
|
|
@@ -27,3 +27,4 @@ __exportStar(require("./webshop"), exports);
|
|
|
27
27
|
__exportStar(require("./create-write-off-from-pending.command"), exports);
|
|
28
28
|
__exportStar(require("./update-write-off-price.command"), exports);
|
|
29
29
|
__exportStar(require("./get-write-off.query"), exports);
|
|
30
|
+
__exportStar(require("./export-selected-write-offs.command"), exports);
|
package/build/schemas/index.js
CHANGED
|
@@ -21,6 +21,8 @@ __exportStar(require("./product/product.schema"), exports);
|
|
|
21
21
|
__exportStar(require("./product/product-list.schema"), exports);
|
|
22
22
|
__exportStar(require("./write-off/write-off.schema"), exports);
|
|
23
23
|
__exportStar(require("./write-off/write-off-list.schema"), exports);
|
|
24
|
+
__exportStar(require("./write-off/write-off-archive-file.schema"), exports);
|
|
25
|
+
__exportStar(require("./write-off/write-off-export.schema"), exports);
|
|
24
26
|
__exportStar(require("./order/order.schema"), exports);
|
|
25
27
|
__exportStar(require("./order-delivery/order-delivery.schema"), exports);
|
|
26
28
|
__exportStar(require("./order-product/order-product.schema"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WriteOffArchiveFilesSchema = exports.WriteOffArchiveFileSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.WriteOffArchiveFileSchema = zod_1.z.object({
|
|
6
|
+
file_key: zod_1.z.string(),
|
|
7
|
+
grower: zod_1.z.string(),
|
|
8
|
+
name: zod_1.z.string(),
|
|
9
|
+
size: zod_1.z.string(),
|
|
10
|
+
categoryName: zod_1.z.string(),
|
|
11
|
+
});
|
|
12
|
+
exports.WriteOffArchiveFilesSchema = zod_1.z.object({
|
|
13
|
+
files: zod_1.z.array(exports.WriteOffArchiveFileSchema),
|
|
14
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { WriteOffArchiveFilesSchema } from '../../schemas';
|
|
3
|
+
|
|
4
|
+
const GetWriteOffArchiveFilesByUuidsRequestSchema = z.object({
|
|
5
|
+
writeOffUUIDs: z.array(z.string().uuid()).min(1).max(500),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const GetWriteOffArchiveFilesByUuidsResponseSchema = z.object({
|
|
9
|
+
message: z.string().optional(),
|
|
10
|
+
data: WriteOffArchiveFilesSchema.nullable(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export namespace GetWriteOffArchiveFilesByUuidsContractCommand {
|
|
14
|
+
export const RequestSchema = GetWriteOffArchiveFilesByUuidsRequestSchema;
|
|
15
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = GetWriteOffArchiveFilesByUuidsResponseSchema;
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
const ArchiveFileItemSchema = z.object({
|
|
4
|
-
file_key: z.string(),
|
|
5
|
-
grower: z.string(),
|
|
6
|
-
name: z.string(),
|
|
7
|
-
size: z.string(),
|
|
8
|
-
categoryName: z.string(),
|
|
9
|
-
});
|
|
2
|
+
import { WriteOffArchiveFilesSchema } from '../../schemas';
|
|
10
3
|
|
|
11
4
|
const GetWriteOffArchiveFilesResponseSchema = z.object({
|
|
12
5
|
message: z.string().optional(),
|
|
13
|
-
data:
|
|
14
|
-
.object({
|
|
15
|
-
files: z.array(ArchiveFileItemSchema),
|
|
16
|
-
})
|
|
17
|
-
.nullable(),
|
|
6
|
+
data: WriteOffArchiveFilesSchema.nullable(),
|
|
18
7
|
});
|
|
19
8
|
|
|
20
9
|
export namespace GetWriteOffArchiveFilesContractQuery {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { WriteOffExportSchema } from '../../schemas';
|
|
3
|
+
|
|
4
|
+
const ExportSelectedWriteOffsRequestSchema = z.object({
|
|
5
|
+
writeOffUUIDs: z.array(z.string().uuid()).min(1).max(500),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const ExportSelectedWriteOffsResponseSchema = z.object({
|
|
9
|
+
message: z.string().optional(),
|
|
10
|
+
data: WriteOffExportSchema,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export namespace ExportSelectedWriteOffsContractCommand {
|
|
14
|
+
export const RequestSchema = ExportSelectedWriteOffsRequestSchema;
|
|
15
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = ExportSelectedWriteOffsResponseSchema;
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { WriteOffListSchema } from '../../schemas';
|
|
3
3
|
import { WriteOffStatusEnum } from '../../enum';
|
|
4
|
+
import { dateRangeCheck } from '../../helpers/date.helper';
|
|
4
5
|
|
|
5
|
-
const GetWriteOffListRequestSchema = z
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
const GetWriteOffListRequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
productUUID: z.string().optional(),
|
|
9
|
+
categoryUUID: z.string().optional(),
|
|
10
|
+
consignmentUUID: z.string().optional(),
|
|
11
|
+
orderUUID: z.string().optional(),
|
|
12
|
+
clientUUID: z.string().optional(),
|
|
13
|
+
searchQuery: z.string().optional(),
|
|
14
|
+
responsibleUserUUID: z.string().optional(),
|
|
15
|
+
status: z.nativeEnum(WriteOffStatusEnum).optional(),
|
|
16
|
+
startDate: z.coerce.date().optional(),
|
|
17
|
+
endDate: z.coerce.date().optional(),
|
|
18
|
+
page: z.coerce.number().optional().default(1),
|
|
19
|
+
count: z.coerce.number().optional().default(10),
|
|
20
|
+
})
|
|
21
|
+
.refine(
|
|
22
|
+
value => {
|
|
23
|
+
const { startDate, endDate } = value;
|
|
24
|
+
if (startDate && endDate) {
|
|
25
|
+
return dateRangeCheck(startDate, endDate);
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
message: 'End date must be greater than start date',
|
|
31
|
+
path: ['endDate', 'startDate'],
|
|
32
|
+
},
|
|
33
|
+
);
|
|
17
34
|
|
|
18
35
|
const GetWriteOffListResponseSchema = z.object({
|
|
19
36
|
message: z.string().optional(),
|
package/package.json
CHANGED
package/schemas/index.ts
CHANGED
|
@@ -5,6 +5,8 @@ export * from './product/product.schema';
|
|
|
5
5
|
export * from './product/product-list.schema';
|
|
6
6
|
export * from './write-off/write-off.schema';
|
|
7
7
|
export * from './write-off/write-off-list.schema';
|
|
8
|
+
export * from './write-off/write-off-archive-file.schema';
|
|
9
|
+
export * from './write-off/write-off-export.schema';
|
|
8
10
|
export * from './order/order.schema';
|
|
9
11
|
export * from './order-delivery/order-delivery.schema';
|
|
10
12
|
export * from './order-product/order-product.schema';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const WriteOffArchiveFileSchema = z.object({
|
|
4
|
+
file_key: z.string(),
|
|
5
|
+
grower: z.string(),
|
|
6
|
+
name: z.string(),
|
|
7
|
+
size: z.string(),
|
|
8
|
+
categoryName: z.string(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const WriteOffArchiveFilesSchema = z.object({
|
|
12
|
+
files: z.array(WriteOffArchiveFileSchema),
|
|
13
|
+
});
|