@floristcloud/api-lib 1.2.10 → 1.2.12
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/pre-order-collection/get-access-clients-pre-order-collection.query.js +13 -0
- package/build/commands/pre-order-collection/index.js +2 -0
- package/build/commands/pre-order-collection/upsert-access-clients-pre-order-collection.command.js +23 -0
- package/build/constant/error-i18n-key.js +1 -0
- package/build/constant/error.js +8 -1
- package/build/enum/pre-order-collection-status.enum.js +1 -0
- package/build/schemas/pre-order-collection/pre-order-collection.schema.js +4 -1
- package/commands/pre-order-collection/get-access-clients-pre-order-collection.query.ts +12 -0
- package/commands/pre-order-collection/index.ts +2 -0
- package/commands/pre-order-collection/upsert-access-clients-pre-order-collection.command.ts +25 -0
- package/constant/error-i18n-key.ts +1 -0
- package/constant/error.ts +8 -1
- package/enum/pre-order-collection-status.enum.ts +1 -0
- package/package.json +1 -1
- package/schemas/pre-order-collection/pre-order-collection.schema.ts +4 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetAccessClientsPreOrderCollectionContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
|
+
const GetAccessClientsPreOrderCollectionResponseSchema = zod_1.z.object({
|
|
7
|
+
message: zod_1.z.string().optional(),
|
|
8
|
+
data: schemas_1.ClientSchema.array(),
|
|
9
|
+
});
|
|
10
|
+
var GetAccessClientsPreOrderCollectionContractQuery;
|
|
11
|
+
(function (GetAccessClientsPreOrderCollectionContractQuery) {
|
|
12
|
+
GetAccessClientsPreOrderCollectionContractQuery.ResponseSchema = GetAccessClientsPreOrderCollectionResponseSchema;
|
|
13
|
+
})(GetAccessClientsPreOrderCollectionContractQuery || (exports.GetAccessClientsPreOrderCollectionContractQuery = GetAccessClientsPreOrderCollectionContractQuery = {}));
|
|
@@ -22,3 +22,5 @@ __exportStar(require("./get-pre-order-collection-list.query"), exports);
|
|
|
22
22
|
__exportStar(require("./get-pre-order-collection-all.query"), exports);
|
|
23
23
|
__exportStar(require("./webshop/get-pre-order-collection-list-with-categories.query"), exports);
|
|
24
24
|
__exportStar(require("./match-images-for-collection.command"), exports);
|
|
25
|
+
__exportStar(require("./upsert-access-clients-pre-order-collection.command"), exports);
|
|
26
|
+
__exportStar(require("./get-access-clients-pre-order-collection.query"), exports);
|
package/build/commands/pre-order-collection/upsert-access-clients-pre-order-collection.command.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpsertAccessClientsPreOrderCollectionContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
6
|
+
const schemas_1 = require("../../schemas");
|
|
7
|
+
const UpsertAccessClientsPreOrderCollectionRequestSchema = zod_1.z.object({
|
|
8
|
+
clients: zod_1.z
|
|
9
|
+
.object({
|
|
10
|
+
clientUUID: zod_1.z.string(),
|
|
11
|
+
status: zod_1.z.nativeEnum(enum_1.ConsignmentAccessClientStatusEnum),
|
|
12
|
+
})
|
|
13
|
+
.array(),
|
|
14
|
+
});
|
|
15
|
+
const UpsertAccessClientsPreOrderCollectionResponseSchema = zod_1.z.object({
|
|
16
|
+
message: zod_1.z.string().optional(),
|
|
17
|
+
data: schemas_1.PreOrderCollectionWithClientsAccessSchema,
|
|
18
|
+
});
|
|
19
|
+
var UpsertAccessClientsPreOrderCollectionContractCommand;
|
|
20
|
+
(function (UpsertAccessClientsPreOrderCollectionContractCommand) {
|
|
21
|
+
UpsertAccessClientsPreOrderCollectionContractCommand.RequestSchema = UpsertAccessClientsPreOrderCollectionRequestSchema;
|
|
22
|
+
UpsertAccessClientsPreOrderCollectionContractCommand.ResponseSchema = UpsertAccessClientsPreOrderCollectionResponseSchema;
|
|
23
|
+
})(UpsertAccessClientsPreOrderCollectionContractCommand || (exports.UpsertAccessClientsPreOrderCollectionContractCommand = UpsertAccessClientsPreOrderCollectionContractCommand = {}));
|
|
@@ -18,4 +18,5 @@ exports.ErrorI18nKey = {
|
|
|
18
18
|
moveItemsBatchLimitExceeded: 'moveItems.batchLimitExceeded',
|
|
19
19
|
moveItemsItemsNotFound: 'moveItems.itemsNotFound',
|
|
20
20
|
moveItemsInPreOrdersWarning: 'moveItems.inPreOrdersWarning',
|
|
21
|
+
consignmentImportTooManyRows: 'consignmentImport.tooManyRows',
|
|
21
22
|
};
|
package/build/constant/error.js
CHANGED
|
@@ -226,13 +226,13 @@ exports.ERRORS = {
|
|
|
226
226
|
CONSIGNMENT_FILTERS_VALUES_FAILED: { code: 'CON014', message: 'Failed when retrieving consignment filters values', httpCode: 500 },
|
|
227
227
|
CONSIGNMENT_WRITE_OFF_NOT_EMPTY: { code: 'CON015', message: 'Consignment not deleted, write-off not empty', httpCode: 400 },
|
|
228
228
|
CONSIGNMENT_PRODUCT_UPDATE_FILE_REQUIRED: { code: 'CON016', message: 'File is required', httpCode: 400 },
|
|
229
|
-
CONSIGNMENT_PRODUCT_UPDATE_FILE_TOO_LARGE: { code: 'CON017', message: 'File size too large', httpCode: 400 },
|
|
230
229
|
CONSIGNMENT_PRODUCT_UPDATE_INVALID_CONFIG: { code: 'CON018', message: 'Invalid config format', httpCode: 400 },
|
|
231
230
|
CONSIGNMENT_PRODUCT_UPDATE_NO_DATA_ROWS: { code: 'CON019', message: 'File has no data rows', httpCode: 400 },
|
|
232
231
|
CONSIGNMENT_PRODUCT_UPDATE_TOO_MANY_ROWS: { code: 'CON020', message: 'Too many rows', httpCode: 400 },
|
|
233
232
|
CONSIGNMENT_PRODUCT_UPDATE_DUPLICATE_MATCH: { code: 'CON021', message: 'Multiple matches for row, first used', httpCode: 200 },
|
|
234
233
|
CONSIGNMENT_PRODUCT_UPDATE_ANALYSIS_FAILED: { code: 'CON022', message: 'Update analysis failed', httpCode: 500 },
|
|
235
234
|
CONSIGNMENT_PRODUCT_UPDATE_BATCH_TOO_LARGE: { code: 'CON023', message: 'Batch size too large', httpCode: 400 },
|
|
235
|
+
CONSIGNMENT_IMPORT_TOO_MANY_ROWS: { code: 'CON024', message: 'Too many rows for this import mode', httpCode: 400 },
|
|
236
236
|
// CONSIGNMENT-IMPORT-SCHEME
|
|
237
237
|
CONSIGNMENT_IMPORT_SCHEME_NOT_CREATED: { code: 'CS001', message: 'Failed to create consignment import scheme', httpCode: 500 },
|
|
238
238
|
CONSIGNMENT_IMPORT_SCHEME_FETCH_FAILED: { code: 'CS002', message: 'Error when retrieving a consignment import scheme', httpCode: 500 },
|
|
@@ -244,6 +244,11 @@ exports.ERRORS = {
|
|
|
244
244
|
CONSIGNMENT_IMPORT_SCHEME_NOT_FOUND: { code: 'CS004', message: 'Consignment import scheme not founded', httpCode: 404 },
|
|
245
245
|
CONSIGNMENT_IMPORT_SCHEME_NOT_DELETED: { code: 'CS005', message: 'Consignment import scheme not deleted', httpCode: 500 },
|
|
246
246
|
CONSIGNMENT_IMPORT_SCHEME_NOT_UPDATED: { code: 'CS006', message: 'Failed to update consignment import scheme', httpCode: 500 },
|
|
247
|
+
CONSIGNMENT_IMPORT_SCHEME_DEFAULT_CANNOT_BE_DELETED: {
|
|
248
|
+
code: 'CS007',
|
|
249
|
+
message: 'Default consignment import scheme cannot be deleted',
|
|
250
|
+
httpCode: 400,
|
|
251
|
+
},
|
|
247
252
|
// CONSIGNMENT-IMPORT-SCHEMA-RELATION
|
|
248
253
|
CONSIGNMENT_IMPORT_SCHEMA_RELATION_NOT_CREATED: {
|
|
249
254
|
code: 'CSR001',
|
|
@@ -520,6 +525,8 @@ exports.ERRORS = {
|
|
|
520
525
|
FILE_SIZE_LIMIT_EXCEEDED: { code: 'F004', message: 'File size limit exceeded', httpCode: 400 },
|
|
521
526
|
FILE_GET_INFO_FAILED: { code: 'F005', message: 'Failed to get file info', httpCode: 500 },
|
|
522
527
|
FILE_NOT_SUPPORTED: { code: 'F006', message: 'File not supported', httpCode: 400 },
|
|
528
|
+
FILE_TOO_LARGE: { code: 'F007', message: 'File size exceeds the allowed limit', httpCode: 413 },
|
|
529
|
+
FILE_UPLOAD_FAILED: { code: 'F008', message: 'File upload failed', httpCode: 400 },
|
|
523
530
|
FILE_S3_FORBIDDEN: { code: 'F007', message: 'File S3 forbidden', httpCode: 403 },
|
|
524
531
|
//WHATSAPP
|
|
525
532
|
WHATSAPP_TEXT_NOT_SENT: { code: 'W001', message: 'Failed to send text message', httpCode: 500 },
|
|
@@ -5,4 +5,5 @@ var PreOrderCollectionStatusEnum;
|
|
|
5
5
|
(function (PreOrderCollectionStatusEnum) {
|
|
6
6
|
PreOrderCollectionStatusEnum["ACTIVE"] = "ACTIVE";
|
|
7
7
|
PreOrderCollectionStatusEnum["AVAILABLE"] = "AVAILABLE";
|
|
8
|
+
PreOrderCollectionStatusEnum["LIMITED"] = "LIMITED";
|
|
8
9
|
})(PreOrderCollectionStatusEnum || (exports.PreOrderCollectionStatusEnum = PreOrderCollectionStatusEnum = {}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PreOrderCollectionWithCategoriesSchema = exports.PreOrderCollectionListSchema = exports.PreOrderCollectionWithStatisticSchema = exports.UpdatePreOrderCollectionSchema = exports.CreatePreOrderCollectionSchema = exports.PreOrderCollectionSchema = void 0;
|
|
3
|
+
exports.PreOrderCollectionWithCategoriesSchema = exports.PreOrderCollectionWithClientsAccessSchema = exports.PreOrderCollectionListSchema = exports.PreOrderCollectionWithStatisticSchema = exports.UpdatePreOrderCollectionSchema = exports.CreatePreOrderCollectionSchema = exports.PreOrderCollectionSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const enum_1 = require("../../enum");
|
|
6
6
|
exports.PreOrderCollectionSchema = zod_1.z.object({
|
|
@@ -43,6 +43,9 @@ exports.PreOrderCollectionListSchema = zod_1.z.object({
|
|
|
43
43
|
list: zod_1.z.array(exports.PreOrderCollectionWithStatisticSchema),
|
|
44
44
|
total: zod_1.z.number(),
|
|
45
45
|
});
|
|
46
|
+
exports.PreOrderCollectionWithClientsAccessSchema = exports.PreOrderCollectionSchema.extend({
|
|
47
|
+
clientsAccess: zod_1.z.array(zod_1.z.object({ uuid: zod_1.z.string(), name: zod_1.z.string() })),
|
|
48
|
+
});
|
|
46
49
|
exports.PreOrderCollectionWithCategoriesSchema = exports.PreOrderCollectionSchema.merge(zod_1.z.object({
|
|
47
50
|
categories: zod_1.z
|
|
48
51
|
.object({
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ClientSchema } from '../../schemas';
|
|
3
|
+
|
|
4
|
+
const GetAccessClientsPreOrderCollectionResponseSchema = z.object({
|
|
5
|
+
message: z.string().optional(),
|
|
6
|
+
data: ClientSchema.array(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export namespace GetAccessClientsPreOrderCollectionContractQuery {
|
|
10
|
+
export const ResponseSchema = GetAccessClientsPreOrderCollectionResponseSchema;
|
|
11
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
12
|
+
}
|
|
@@ -6,3 +6,5 @@ export * from './get-pre-order-collection-list.query';
|
|
|
6
6
|
export * from './get-pre-order-collection-all.query';
|
|
7
7
|
export * from './webshop/get-pre-order-collection-list-with-categories.query';
|
|
8
8
|
export * from './match-images-for-collection.command';
|
|
9
|
+
export * from './upsert-access-clients-pre-order-collection.command';
|
|
10
|
+
export * from './get-access-clients-pre-order-collection.query';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ConsignmentAccessClientStatusEnum } from '../../enum';
|
|
3
|
+
import { PreOrderCollectionWithClientsAccessSchema } from '../../schemas';
|
|
4
|
+
|
|
5
|
+
const UpsertAccessClientsPreOrderCollectionRequestSchema = z.object({
|
|
6
|
+
clients: z
|
|
7
|
+
.object({
|
|
8
|
+
clientUUID: z.string(),
|
|
9
|
+
status: z.nativeEnum(ConsignmentAccessClientStatusEnum),
|
|
10
|
+
})
|
|
11
|
+
.array(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const UpsertAccessClientsPreOrderCollectionResponseSchema = z.object({
|
|
15
|
+
message: z.string().optional(),
|
|
16
|
+
data: PreOrderCollectionWithClientsAccessSchema,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export namespace UpsertAccessClientsPreOrderCollectionContractCommand {
|
|
20
|
+
export const RequestSchema = UpsertAccessClientsPreOrderCollectionRequestSchema;
|
|
21
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
22
|
+
|
|
23
|
+
export const ResponseSchema = UpsertAccessClientsPreOrderCollectionResponseSchema;
|
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
+
}
|
|
@@ -15,6 +15,7 @@ export const ErrorI18nKey = {
|
|
|
15
15
|
moveItemsBatchLimitExceeded: 'moveItems.batchLimitExceeded',
|
|
16
16
|
moveItemsItemsNotFound: 'moveItems.itemsNotFound',
|
|
17
17
|
moveItemsInPreOrdersWarning: 'moveItems.inPreOrdersWarning',
|
|
18
|
+
consignmentImportTooManyRows: 'consignmentImport.tooManyRows',
|
|
18
19
|
} as const;
|
|
19
20
|
|
|
20
21
|
export type ErrorI18nKeyType = (typeof ErrorI18nKey)[keyof typeof ErrorI18nKey];
|
package/constant/error.ts
CHANGED
|
@@ -235,13 +235,13 @@ export const ERRORS = {
|
|
|
235
235
|
CONSIGNMENT_FILTERS_VALUES_FAILED: { code: 'CON014', message: 'Failed when retrieving consignment filters values', httpCode: 500 },
|
|
236
236
|
CONSIGNMENT_WRITE_OFF_NOT_EMPTY: { code: 'CON015', message: 'Consignment not deleted, write-off not empty', httpCode: 400 },
|
|
237
237
|
CONSIGNMENT_PRODUCT_UPDATE_FILE_REQUIRED: { code: 'CON016', message: 'File is required', httpCode: 400 },
|
|
238
|
-
CONSIGNMENT_PRODUCT_UPDATE_FILE_TOO_LARGE: { code: 'CON017', message: 'File size too large', httpCode: 400 },
|
|
239
238
|
CONSIGNMENT_PRODUCT_UPDATE_INVALID_CONFIG: { code: 'CON018', message: 'Invalid config format', httpCode: 400 },
|
|
240
239
|
CONSIGNMENT_PRODUCT_UPDATE_NO_DATA_ROWS: { code: 'CON019', message: 'File has no data rows', httpCode: 400 },
|
|
241
240
|
CONSIGNMENT_PRODUCT_UPDATE_TOO_MANY_ROWS: { code: 'CON020', message: 'Too many rows', httpCode: 400 },
|
|
242
241
|
CONSIGNMENT_PRODUCT_UPDATE_DUPLICATE_MATCH: { code: 'CON021', message: 'Multiple matches for row, first used', httpCode: 200 },
|
|
243
242
|
CONSIGNMENT_PRODUCT_UPDATE_ANALYSIS_FAILED: { code: 'CON022', message: 'Update analysis failed', httpCode: 500 },
|
|
244
243
|
CONSIGNMENT_PRODUCT_UPDATE_BATCH_TOO_LARGE: { code: 'CON023', message: 'Batch size too large', httpCode: 400 },
|
|
244
|
+
CONSIGNMENT_IMPORT_TOO_MANY_ROWS: { code: 'CON024', message: 'Too many rows for this import mode', httpCode: 400 },
|
|
245
245
|
|
|
246
246
|
// CONSIGNMENT-IMPORT-SCHEME
|
|
247
247
|
CONSIGNMENT_IMPORT_SCHEME_NOT_CREATED: { code: 'CS001', message: 'Failed to create consignment import scheme', httpCode: 500 },
|
|
@@ -254,6 +254,11 @@ export const ERRORS = {
|
|
|
254
254
|
CONSIGNMENT_IMPORT_SCHEME_NOT_FOUND: { code: 'CS004', message: 'Consignment import scheme not founded', httpCode: 404 },
|
|
255
255
|
CONSIGNMENT_IMPORT_SCHEME_NOT_DELETED: { code: 'CS005', message: 'Consignment import scheme not deleted', httpCode: 500 },
|
|
256
256
|
CONSIGNMENT_IMPORT_SCHEME_NOT_UPDATED: { code: 'CS006', message: 'Failed to update consignment import scheme', httpCode: 500 },
|
|
257
|
+
CONSIGNMENT_IMPORT_SCHEME_DEFAULT_CANNOT_BE_DELETED: {
|
|
258
|
+
code: 'CS007',
|
|
259
|
+
message: 'Default consignment import scheme cannot be deleted',
|
|
260
|
+
httpCode: 400,
|
|
261
|
+
},
|
|
257
262
|
|
|
258
263
|
// CONSIGNMENT-IMPORT-SCHEMA-RELATION
|
|
259
264
|
CONSIGNMENT_IMPORT_SCHEMA_RELATION_NOT_CREATED: {
|
|
@@ -545,6 +550,8 @@ export const ERRORS = {
|
|
|
545
550
|
FILE_SIZE_LIMIT_EXCEEDED: { code: 'F004', message: 'File size limit exceeded', httpCode: 400 },
|
|
546
551
|
FILE_GET_INFO_FAILED: { code: 'F005', message: 'Failed to get file info', httpCode: 500 },
|
|
547
552
|
FILE_NOT_SUPPORTED: { code: 'F006', message: 'File not supported', httpCode: 400 },
|
|
553
|
+
FILE_TOO_LARGE: { code: 'F007', message: 'File size exceeds the allowed limit', httpCode: 413 },
|
|
554
|
+
FILE_UPLOAD_FAILED: { code: 'F008', message: 'File upload failed', httpCode: 400 },
|
|
548
555
|
FILE_S3_FORBIDDEN: { code: 'F007', message: 'File S3 forbidden', httpCode: 403 },
|
|
549
556
|
|
|
550
557
|
//WHATSAPP
|
package/package.json
CHANGED
|
@@ -48,6 +48,10 @@ export const PreOrderCollectionListSchema = z.object({
|
|
|
48
48
|
total: z.number(),
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
+
export const PreOrderCollectionWithClientsAccessSchema = PreOrderCollectionSchema.extend({
|
|
52
|
+
clientsAccess: z.array(z.object({ uuid: z.string(), name: z.string() })),
|
|
53
|
+
});
|
|
54
|
+
|
|
51
55
|
export const PreOrderCollectionWithCategoriesSchema = PreOrderCollectionSchema.merge(
|
|
52
56
|
z.object({
|
|
53
57
|
categories: z
|