@floristcloud/api-lib 1.2.159 → 1.2.160
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/product/export-stock-products.query.js +11 -0
- package/build/commands/product/get-product-list.query.js +4 -25
- package/build/commands/product/index.js +1 -0
- package/build/constant/error.js +5 -0
- package/build/schemas/index.js +4 -0
- package/build/schemas/product/export-stock-products-request.schema.js +14 -0
- package/build/schemas/product/export-stock-products-response.schema.js +7 -0
- package/build/schemas/product/get-product-list-request.schema.js +21 -0
- package/build/schemas/product/get-product-list-response.schema.js +9 -0
- package/commands/product/export-stock-products.query.ts +13 -0
- package/commands/product/get-product-list.query.ts +3 -25
- package/commands/product/index.ts +1 -0
- package/constant/error.ts +5 -0
- package/package.json +1 -1
- package/schemas/index.ts +4 -0
- package/schemas/product/export-stock-products-request.schema.ts +12 -0
- package/schemas/product/export-stock-products-response.schema.ts +5 -0
- package/schemas/product/get-product-list-request.schema.ts +19 -0
- package/schemas/product/get-product-list-response.schema.ts +7 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExportStockProductsContractQuery = void 0;
|
|
4
|
+
const export_stock_products_request_schema_1 = require("../../schemas/product/export-stock-products-request.schema");
|
|
5
|
+
const export_stock_products_response_schema_1 = require("../../schemas/product/export-stock-products-response.schema");
|
|
6
|
+
var ExportStockProductsContractQuery;
|
|
7
|
+
(function (ExportStockProductsContractQuery) {
|
|
8
|
+
ExportStockProductsContractQuery.MAX_PRODUCTS = 10000;
|
|
9
|
+
ExportStockProductsContractQuery.RequestSchema = export_stock_products_request_schema_1.ExportStockProductsRequestSchema;
|
|
10
|
+
ExportStockProductsContractQuery.ResponseSchema = export_stock_products_response_schema_1.ExportStockProductsResponseSchema;
|
|
11
|
+
})(ExportStockProductsContractQuery || (exports.ExportStockProductsContractQuery = ExportStockProductsContractQuery = {}));
|
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetProductListContractQuery = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const schemas_1 = require("../../schemas");
|
|
7
|
-
const GetProductListRequestSchema = zod_1.z.object({
|
|
8
|
-
page: zod_1.z.coerce.number().optional().default(1),
|
|
9
|
-
count: zod_1.z.coerce.number().optional().default(10),
|
|
10
|
-
stock: zod_1.z.coerce.boolean().optional(),
|
|
11
|
-
consignmentUUID: zod_1.z.string().optional(),
|
|
12
|
-
searchQuery: zod_1.z.string().optional(),
|
|
13
|
-
onlyAvailable: zod_1.z.coerce.boolean().optional(),
|
|
14
|
-
categoryUUID: zod_1.z.string().optional(),
|
|
15
|
-
typeUUID: zod_1.z.string().optional(),
|
|
16
|
-
grower: zod_1.z.string().optional(),
|
|
17
|
-
country: zod_1.z.string().optional(),
|
|
18
|
-
color: zod_1.z.string().optional(),
|
|
19
|
-
size: zod_1.z.string().optional(),
|
|
20
|
-
deliveryDates: zod_1.z.array(zod_1.z.coerce.date()).optional(),
|
|
21
|
-
marks: zod_1.z.enum(enum_1.ProductMarkEnum).array().optional(),
|
|
22
|
-
});
|
|
23
|
-
const GetProductListResponseSchema = zod_1.z.object({
|
|
24
|
-
message: zod_1.z.string().optional(),
|
|
25
|
-
data: schemas_1.ProductListSchema,
|
|
26
|
-
});
|
|
4
|
+
const get_product_list_request_schema_1 = require("../../schemas/product/get-product-list-request.schema");
|
|
5
|
+
const get_product_list_response_schema_1 = require("../../schemas/product/get-product-list-response.schema");
|
|
27
6
|
var GetProductListContractQuery;
|
|
28
7
|
(function (GetProductListContractQuery) {
|
|
29
|
-
GetProductListContractQuery.RequestSchema = GetProductListRequestSchema;
|
|
30
|
-
GetProductListContractQuery.ResponseSchema = GetProductListResponseSchema;
|
|
8
|
+
GetProductListContractQuery.RequestSchema = get_product_list_request_schema_1.GetProductListRequestSchema;
|
|
9
|
+
GetProductListContractQuery.ResponseSchema = get_product_list_response_schema_1.GetProductListResponseSchema;
|
|
31
10
|
})(GetProductListContractQuery || (exports.GetProductListContractQuery = GetProductListContractQuery = {}));
|
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./get-product.query"), exports);
|
|
18
18
|
__exportStar(require("./get-product-list.query"), exports);
|
|
19
|
+
__exportStar(require("./export-stock-products.query"), exports);
|
|
19
20
|
__exportStar(require("./create-product.command"), exports);
|
|
20
21
|
__exportStar(require("./update-product.command"), exports);
|
|
21
22
|
__exportStar(require("./delete-product.command"), exports);
|
package/build/constant/error.js
CHANGED
|
@@ -236,6 +236,11 @@ exports.ERRORS = {
|
|
|
236
236
|
PRODUCT_MULTIPLICITY_OPTION_USED_IN_ORDER: { code: 'P018', message: 'Product multiplicity option used in order', httpCode: 400 },
|
|
237
237
|
PRODUCT_MULTIPLICITY_OPTION_NOT_DELETED: { code: 'P019', message: 'Failed to delete product multiplicity option', httpCode: 500 },
|
|
238
238
|
PRODUCT_IMAGE_MATCHING_FAILED: { code: 'P020', message: 'Failed to match images for products', httpCode: 500 },
|
|
239
|
+
PRODUCT_STOCK_EXPORT_LIMIT_EXCEEDED: {
|
|
240
|
+
code: 'P021',
|
|
241
|
+
message: 'Too many products to export. Narrow the filters and try again',
|
|
242
|
+
httpCode: 400,
|
|
243
|
+
},
|
|
239
244
|
// PRODUCT CONFIGURATION
|
|
240
245
|
PRODUCT_CONFIGURATION_NOT_CREATED: { code: 'PCFG001', message: 'Failed to create product configuration', httpCode: 500 },
|
|
241
246
|
PRODUCT_CONFIGURATION_NOT_DELETED: { code: 'PCFG002', message: 'Failed to delete product configuration', httpCode: 500 },
|
package/build/schemas/index.js
CHANGED
|
@@ -28,6 +28,10 @@ __exportStar(require("./client/client.schema"), exports);
|
|
|
28
28
|
__exportStar(require("./user/user.schema"), exports);
|
|
29
29
|
__exportStar(require("./product/product.schema"), exports);
|
|
30
30
|
__exportStar(require("./product/product-list.schema"), exports);
|
|
31
|
+
__exportStar(require("./product/get-product-list-request.schema"), exports);
|
|
32
|
+
__exportStar(require("./product/get-product-list-response.schema"), exports);
|
|
33
|
+
__exportStar(require("./product/export-stock-products-request.schema"), exports);
|
|
34
|
+
__exportStar(require("./product/export-stock-products-response.schema"), exports);
|
|
31
35
|
__exportStar(require("./write-off/write-off.schema"), exports);
|
|
32
36
|
__exportStar(require("./write-off/write-off-list.schema"), exports);
|
|
33
37
|
__exportStar(require("./write-off/write-off-archive-file.schema"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExportStockProductsRequestSchema = void 0;
|
|
4
|
+
const get_product_list_request_schema_1 = require("./get-product-list-request.schema");
|
|
5
|
+
exports.ExportStockProductsRequestSchema = get_product_list_request_schema_1.GetProductListRequestSchema.pick({
|
|
6
|
+
searchQuery: true,
|
|
7
|
+
categoryUUID: true,
|
|
8
|
+
typeUUID: true,
|
|
9
|
+
grower: true,
|
|
10
|
+
country: true,
|
|
11
|
+
color: true,
|
|
12
|
+
size: true,
|
|
13
|
+
marks: true,
|
|
14
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExportStockProductsResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ExportStockProductsResponseSchema = zod_1.z.object({
|
|
6
|
+
data: zod_1.z.object({ fileUrl: zod_1.z.string() }),
|
|
7
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetProductListRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
6
|
+
exports.GetProductListRequestSchema = zod_1.z.object({
|
|
7
|
+
page: zod_1.z.coerce.number().optional().default(1),
|
|
8
|
+
count: zod_1.z.coerce.number().optional().default(10),
|
|
9
|
+
stock: zod_1.z.coerce.boolean().optional(),
|
|
10
|
+
consignmentUUID: zod_1.z.string().optional(),
|
|
11
|
+
searchQuery: zod_1.z.string().optional(),
|
|
12
|
+
onlyAvailable: zod_1.z.coerce.boolean().optional(),
|
|
13
|
+
categoryUUID: zod_1.z.string().optional(),
|
|
14
|
+
typeUUID: zod_1.z.string().optional(),
|
|
15
|
+
grower: zod_1.z.string().optional(),
|
|
16
|
+
country: zod_1.z.string().optional(),
|
|
17
|
+
color: zod_1.z.string().optional(),
|
|
18
|
+
size: zod_1.z.string().optional(),
|
|
19
|
+
deliveryDates: zod_1.z.array(zod_1.z.coerce.date()).optional(),
|
|
20
|
+
marks: zod_1.z.enum(enum_1.ProductMarkEnum).array().optional(),
|
|
21
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetProductListResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const product_list_schema_1 = require("./product-list.schema");
|
|
6
|
+
exports.GetProductListResponseSchema = zod_1.z.object({
|
|
7
|
+
message: zod_1.z.string().optional(),
|
|
8
|
+
data: product_list_schema_1.ProductListSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { ExportStockProductsRequestSchema } from '../../schemas/product/export-stock-products-request.schema';
|
|
3
|
+
import { ExportStockProductsResponseSchema } from '../../schemas/product/export-stock-products-response.schema';
|
|
4
|
+
|
|
5
|
+
export namespace ExportStockProductsContractQuery {
|
|
6
|
+
export const MAX_PRODUCTS = 10_000;
|
|
7
|
+
|
|
8
|
+
export const RequestSchema = ExportStockProductsRequestSchema;
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = ExportStockProductsResponseSchema;
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
|
@@ -1,28 +1,6 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const GetProductListRequestSchema = z.object({
|
|
6
|
-
page: z.coerce.number().optional().default(1),
|
|
7
|
-
count: z.coerce.number().optional().default(10),
|
|
8
|
-
stock: z.coerce.boolean().optional(),
|
|
9
|
-
consignmentUUID: z.string().optional(),
|
|
10
|
-
searchQuery: z.string().optional(),
|
|
11
|
-
onlyAvailable: z.coerce.boolean().optional(),
|
|
12
|
-
categoryUUID: z.string().optional(),
|
|
13
|
-
typeUUID: z.string().optional(),
|
|
14
|
-
grower: z.string().optional(),
|
|
15
|
-
country: z.string().optional(),
|
|
16
|
-
color: z.string().optional(),
|
|
17
|
-
size: z.string().optional(),
|
|
18
|
-
deliveryDates: z.array(z.coerce.date()).optional(),
|
|
19
|
-
marks: z.enum(ProductMarkEnum).array().optional(),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const GetProductListResponseSchema = z.object({
|
|
23
|
-
message: z.string().optional(),
|
|
24
|
-
data: ProductListSchema,
|
|
25
|
-
});
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { GetProductListRequestSchema } from '../../schemas/product/get-product-list-request.schema';
|
|
3
|
+
import { GetProductListResponseSchema } from '../../schemas/product/get-product-list-response.schema';
|
|
26
4
|
|
|
27
5
|
export namespace GetProductListContractQuery {
|
|
28
6
|
export const RequestSchema = GetProductListRequestSchema;
|
package/constant/error.ts
CHANGED
|
@@ -243,6 +243,11 @@ export const ERRORS = {
|
|
|
243
243
|
PRODUCT_MULTIPLICITY_OPTION_USED_IN_ORDER: { code: 'P018', message: 'Product multiplicity option used in order', httpCode: 400 },
|
|
244
244
|
PRODUCT_MULTIPLICITY_OPTION_NOT_DELETED: { code: 'P019', message: 'Failed to delete product multiplicity option', httpCode: 500 },
|
|
245
245
|
PRODUCT_IMAGE_MATCHING_FAILED: { code: 'P020', message: 'Failed to match images for products', httpCode: 500 },
|
|
246
|
+
PRODUCT_STOCK_EXPORT_LIMIT_EXCEEDED: {
|
|
247
|
+
code: 'P021',
|
|
248
|
+
message: 'Too many products to export. Narrow the filters and try again',
|
|
249
|
+
httpCode: 400,
|
|
250
|
+
},
|
|
246
251
|
|
|
247
252
|
// PRODUCT CONFIGURATION
|
|
248
253
|
PRODUCT_CONFIGURATION_NOT_CREATED: { code: 'PCFG001', message: 'Failed to create product configuration', httpCode: 500 },
|
package/package.json
CHANGED
package/schemas/index.ts
CHANGED
|
@@ -12,6 +12,10 @@ export * from './client/client.schema';
|
|
|
12
12
|
export * from './user/user.schema';
|
|
13
13
|
export * from './product/product.schema';
|
|
14
14
|
export * from './product/product-list.schema';
|
|
15
|
+
export * from './product/get-product-list-request.schema';
|
|
16
|
+
export * from './product/get-product-list-response.schema';
|
|
17
|
+
export * from './product/export-stock-products-request.schema';
|
|
18
|
+
export * from './product/export-stock-products-response.schema';
|
|
15
19
|
export * from './write-off/write-off.schema';
|
|
16
20
|
export * from './write-off/write-off-list.schema';
|
|
17
21
|
export * from './write-off/write-off-archive-file.schema';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GetProductListRequestSchema } from './get-product-list-request.schema';
|
|
2
|
+
|
|
3
|
+
export const ExportStockProductsRequestSchema = GetProductListRequestSchema.pick({
|
|
4
|
+
searchQuery: true,
|
|
5
|
+
categoryUUID: true,
|
|
6
|
+
typeUUID: true,
|
|
7
|
+
grower: true,
|
|
8
|
+
country: true,
|
|
9
|
+
color: true,
|
|
10
|
+
size: true,
|
|
11
|
+
marks: true,
|
|
12
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ProductMarkEnum } from '../../enum';
|
|
3
|
+
|
|
4
|
+
export const GetProductListRequestSchema = z.object({
|
|
5
|
+
page: z.coerce.number().optional().default(1),
|
|
6
|
+
count: z.coerce.number().optional().default(10),
|
|
7
|
+
stock: z.coerce.boolean().optional(),
|
|
8
|
+
consignmentUUID: z.string().optional(),
|
|
9
|
+
searchQuery: z.string().optional(),
|
|
10
|
+
onlyAvailable: z.coerce.boolean().optional(),
|
|
11
|
+
categoryUUID: z.string().optional(),
|
|
12
|
+
typeUUID: z.string().optional(),
|
|
13
|
+
grower: z.string().optional(),
|
|
14
|
+
country: z.string().optional(),
|
|
15
|
+
color: z.string().optional(),
|
|
16
|
+
size: z.string().optional(),
|
|
17
|
+
deliveryDates: z.array(z.coerce.date()).optional(),
|
|
18
|
+
marks: z.enum(ProductMarkEnum).array().optional(),
|
|
19
|
+
});
|