@floristcloud/api-lib 1.0.69 → 1.0.71

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.
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExecuteConsignmentProductUpdateContractCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const OptionUpdateSchema = zod_1.z.object({
6
+ title: zod_1.z.string().nullable().optional(),
7
+ optionMultiplicity: zod_1.z.number().nullable().optional(),
8
+ optionPrice: zod_1.z.number().nullable().optional(),
9
+ });
10
+ const ConsignmentProductPositionUpdateSchema = zod_1.z.object({
11
+ name: zod_1.z.string().nullable().optional(),
12
+ multiplicity: zod_1.z.number().nullable().optional(),
13
+ quantity: zod_1.z.number().nullable().optional(),
14
+ balance: zod_1.z.number().nullable().optional(),
15
+ price: zod_1.z.number().nullable().optional(),
16
+ costPrice: zod_1.z.number().nullable().optional(),
17
+ invoicePrice: zod_1.z.number().nullable().optional(),
18
+ invoiceNumber: zod_1.z.string().nullable().optional(),
19
+ multiplicityDescription: zod_1.z.string().nullable().optional(),
20
+ vat: zod_1.z.number().nullable().optional(),
21
+ article: zod_1.z.string().nullable().optional(),
22
+ color: zod_1.z.string().nullable().optional(),
23
+ vbn: zod_1.z.string().nullable().optional(),
24
+ barcode: zod_1.z.string().nullable().optional(),
25
+ size: zod_1.z.string().nullable().optional(),
26
+ size2: zod_1.z.string().nullable().optional(),
27
+ size3: zod_1.z.string().nullable().optional(),
28
+ country: zod_1.z.string().nullable().optional(),
29
+ description: zod_1.z.string().nullable().optional(),
30
+ quality: zod_1.z.string().nullable().optional(),
31
+ grower: zod_1.z.string().nullable().optional(),
32
+ option1: OptionUpdateSchema.optional(),
33
+ option2: OptionUpdateSchema.optional(),
34
+ });
35
+ const UpdateBatchRequestSchema = zod_1.z.object({
36
+ updates: zod_1.z.record(zod_1.z.string(), ConsignmentProductPositionUpdateSchema),
37
+ });
38
+ const UpdateBatchResponseSchema = zod_1.z.object({
39
+ data: zod_1.z.object({
40
+ success: zod_1.z.boolean(),
41
+ successCount: zod_1.z.number(),
42
+ failedCount: zod_1.z.number(),
43
+ errors: zod_1.z.array(zod_1.z.object({
44
+ uuid: zod_1.z.string(),
45
+ error: zod_1.z.string(),
46
+ })),
47
+ }),
48
+ });
49
+ var ExecuteConsignmentProductUpdateContractCommand;
50
+ (function (ExecuteConsignmentProductUpdateContractCommand) {
51
+ ExecuteConsignmentProductUpdateContractCommand.RequestSchema = UpdateBatchRequestSchema;
52
+ ExecuteConsignmentProductUpdateContractCommand.ResponseSchema = UpdateBatchResponseSchema;
53
+ })(ExecuteConsignmentProductUpdateContractCommand || (exports.ExecuteConsignmentProductUpdateContractCommand = ExecuteConsignmentProductUpdateContractCommand = {}));
@@ -27,3 +27,4 @@ __exportStar(require("./upsert-access-clients-consignment.command"), exports);
27
27
  __exportStar(require("./get-client-uuids-consignment.query"), exports);
28
28
  __exportStar(require("./get-access-clients-consignment.query"), exports);
29
29
  __exportStar(require("./get-consignment-filters-values.query"), exports);
30
+ __exportStar(require("./execute-consignment-product-update.command"), exports);
@@ -4,7 +4,7 @@ exports.GenerateAndSendPasswordByAdminContractCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const notification_channel_enum_1 = require("../../enum/notification-channel.enum");
6
6
  const GenerateAndSendPasswordByAdminRequestSchema = zod_1.z.object({
7
- channel: zod_1.z.enum([notification_channel_enum_1.NotificationChannelEnum.EMAIL, notification_channel_enum_1.NotificationChannelEnum.WHATSAPP]),
7
+ channel: zod_1.z.enum([notification_channel_enum_1.NotificationChannelEnum.EMAIL, notification_channel_enum_1.NotificationChannelEnum.TELEGRAM_BOT]),
8
8
  });
9
9
  const GenerateAndSendPasswordByAdminResponseSchema = zod_1.z.object({
10
10
  message: zod_1.z.string().optional(),
@@ -225,6 +225,14 @@ exports.ERRORS = {
225
225
  CONSIGNMENT_DISTRIBUTION_CHECKING_FAILED: { code: 'CON013', message: 'Failed to checking consignment distribution', httpCode: 500 },
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
+ 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
+ CONSIGNMENT_PRODUCT_UPDATE_INVALID_CONFIG: { code: 'CON018', message: 'Invalid config format', httpCode: 400 },
231
+ CONSIGNMENT_PRODUCT_UPDATE_NO_DATA_ROWS: { code: 'CON019', message: 'File has no data rows', httpCode: 400 },
232
+ CONSIGNMENT_PRODUCT_UPDATE_TOO_MANY_ROWS: { code: 'CON020', message: 'Too many rows', httpCode: 400 },
233
+ CONSIGNMENT_PRODUCT_UPDATE_DUPLICATE_MATCH: { code: 'CON021', message: 'Multiple matches for row, first used', httpCode: 200 },
234
+ CONSIGNMENT_PRODUCT_UPDATE_ANALYSIS_FAILED: { code: 'CON022', message: 'Update analysis failed', httpCode: 500 },
235
+ CONSIGNMENT_PRODUCT_UPDATE_BATCH_TOO_LARGE: { code: 'CON023', message: 'Batch size too large', httpCode: 400 },
228
236
  // CONSIGNMENT-IMPORT-SCHEME
229
237
  CONSIGNMENT_IMPORT_SCHEME_NOT_CREATED: { code: 'CS001', message: 'Failed to create consignment import scheme', httpCode: 500 },
230
238
  CONSIGNMENT_IMPORT_SCHEME_FETCH_FAILED: { code: 'CS002', message: 'Error when retrieving a consignment import scheme', httpCode: 500 },
@@ -503,6 +511,7 @@ exports.ERRORS = {
503
511
  WHATSAPP_PHONE_NOT_FOUND: { code: 'W004', message: 'Phone number not found or invalid', httpCode: 400 },
504
512
  WHATSAPP_STATUS_CHECK_FAILED: { code: 'W005', message: 'Failed to check WhatsApp message status', httpCode: 500 },
505
513
  WHATSAPP_MESSAGE_NOT_FOUND: { code: 'W006', message: 'Message not found in notification', httpCode: 400 },
514
+ WHATSAPP_CHANNEL_NOT_IN_USE: { code: 'W007', message: 'WhatsApp channel is not in use', httpCode: 410 },
506
515
  //MAX MESSENGER
507
516
  MAX_MESSENGER_TEXT_NOT_SENT: { code: 'MX001', message: 'Failed to send text message via Max Messenger', httpCode: 500 },
508
517
  MAX_MESSENGER_FILE_NOT_SENT: { code: 'MX002', message: 'Failed to send file message via Max Messenger', httpCode: 500 },
@@ -31,4 +31,7 @@ var ConsignmentImportSchemaRelationEntityPropertyEnum;
31
31
  ConsignmentImportSchemaRelationEntityPropertyEnum["PACKAGE_MARKING"] = "PACKAGE_MARKING";
32
32
  ConsignmentImportSchemaRelationEntityPropertyEnum["PACKAGE_QUANTITY"] = "PACKAGE_QUANTITY";
33
33
  ConsignmentImportSchemaRelationEntityPropertyEnum["INVOICE_NUMBER"] = "INVOICE_NUMBER";
34
+ ConsignmentImportSchemaRelationEntityPropertyEnum["OPTION1_TITLE"] = "OPTION1_TITLE";
35
+ ConsignmentImportSchemaRelationEntityPropertyEnum["OPTION1_MULTIPLICITY"] = "OPTION1_MULTIPLICITY";
36
+ ConsignmentImportSchemaRelationEntityPropertyEnum["OPTION1_PRICE"] = "OPTION1_PRICE";
34
37
  })(ConsignmentImportSchemaRelationEntityPropertyEnum || (exports.ConsignmentImportSchemaRelationEntityPropertyEnum = ConsignmentImportSchemaRelationEntityPropertyEnum = {}));
@@ -0,0 +1,59 @@
1
+ import { z } from 'zod';
2
+
3
+ const OptionUpdateSchema = z.object({
4
+ title: z.string().nullable().optional(),
5
+ optionMultiplicity: z.number().nullable().optional(),
6
+ optionPrice: z.number().nullable().optional(),
7
+ });
8
+
9
+ const ConsignmentProductPositionUpdateSchema = z.object({
10
+ name: z.string().nullable().optional(),
11
+ multiplicity: z.number().nullable().optional(),
12
+ quantity: z.number().nullable().optional(),
13
+ balance: z.number().nullable().optional(),
14
+ price: z.number().nullable().optional(),
15
+ costPrice: z.number().nullable().optional(),
16
+ invoicePrice: z.number().nullable().optional(),
17
+ invoiceNumber: z.string().nullable().optional(),
18
+ multiplicityDescription: z.string().nullable().optional(),
19
+ vat: z.number().nullable().optional(),
20
+ article: z.string().nullable().optional(),
21
+ color: z.string().nullable().optional(),
22
+ vbn: z.string().nullable().optional(),
23
+ barcode: z.string().nullable().optional(),
24
+ size: z.string().nullable().optional(),
25
+ size2: z.string().nullable().optional(),
26
+ size3: z.string().nullable().optional(),
27
+ country: z.string().nullable().optional(),
28
+ description: z.string().nullable().optional(),
29
+ quality: z.string().nullable().optional(),
30
+ grower: z.string().nullable().optional(),
31
+ option1: OptionUpdateSchema.optional(),
32
+ option2: OptionUpdateSchema.optional(),
33
+ });
34
+
35
+ const UpdateBatchRequestSchema = z.object({
36
+ updates: z.record(z.string(), ConsignmentProductPositionUpdateSchema),
37
+ });
38
+
39
+ const UpdateBatchResponseSchema = z.object({
40
+ data: z.object({
41
+ success: z.boolean(),
42
+ successCount: z.number(),
43
+ failedCount: z.number(),
44
+ errors: z.array(
45
+ z.object({
46
+ uuid: z.string(),
47
+ error: z.string(),
48
+ }),
49
+ ),
50
+ }),
51
+ });
52
+
53
+ export namespace ExecuteConsignmentProductUpdateContractCommand {
54
+ export const RequestSchema = UpdateBatchRequestSchema;
55
+ export type Request = z.infer<typeof RequestSchema>;
56
+
57
+ export const ResponseSchema = UpdateBatchResponseSchema;
58
+ export type Response = z.infer<typeof ResponseSchema>;
59
+ }
@@ -11,3 +11,4 @@ export * from './upsert-access-clients-consignment.command';
11
11
  export * from './get-client-uuids-consignment.query';
12
12
  export * from './get-access-clients-consignment.query';
13
13
  export * from './get-consignment-filters-values.query';
14
+ export * from './execute-consignment-product-update.command';
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { NotificationChannelEnum } from '../../enum/notification-channel.enum';
3
3
 
4
4
  const GenerateAndSendPasswordByAdminRequestSchema = z.object({
5
- channel: z.enum([NotificationChannelEnum.EMAIL, NotificationChannelEnum.WHATSAPP]),
5
+ channel: z.enum([NotificationChannelEnum.EMAIL, NotificationChannelEnum.TELEGRAM_BOT]),
6
6
  });
7
7
 
8
8
  const GenerateAndSendPasswordByAdminResponseSchema = z.object({
package/constant/error.ts CHANGED
@@ -234,6 +234,14 @@ export const ERRORS = {
234
234
  CONSIGNMENT_DISTRIBUTION_CHECKING_FAILED: { code: 'CON013', message: 'Failed to checking consignment distribution', httpCode: 500 },
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
+ 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
+ CONSIGNMENT_PRODUCT_UPDATE_INVALID_CONFIG: { code: 'CON018', message: 'Invalid config format', httpCode: 400 },
240
+ CONSIGNMENT_PRODUCT_UPDATE_NO_DATA_ROWS: { code: 'CON019', message: 'File has no data rows', httpCode: 400 },
241
+ CONSIGNMENT_PRODUCT_UPDATE_TOO_MANY_ROWS: { code: 'CON020', message: 'Too many rows', httpCode: 400 },
242
+ CONSIGNMENT_PRODUCT_UPDATE_DUPLICATE_MATCH: { code: 'CON021', message: 'Multiple matches for row, first used', httpCode: 200 },
243
+ CONSIGNMENT_PRODUCT_UPDATE_ANALYSIS_FAILED: { code: 'CON022', message: 'Update analysis failed', httpCode: 500 },
244
+ CONSIGNMENT_PRODUCT_UPDATE_BATCH_TOO_LARGE: { code: 'CON023', message: 'Batch size too large', httpCode: 400 },
237
245
 
238
246
  // CONSIGNMENT-IMPORT-SCHEME
239
247
  CONSIGNMENT_IMPORT_SCHEME_NOT_CREATED: { code: 'CS001', message: 'Failed to create consignment import scheme', httpCode: 500 },
@@ -529,6 +537,7 @@ export const ERRORS = {
529
537
  WHATSAPP_PHONE_NOT_FOUND: { code: 'W004', message: 'Phone number not found or invalid', httpCode: 400 },
530
538
  WHATSAPP_STATUS_CHECK_FAILED: { code: 'W005', message: 'Failed to check WhatsApp message status', httpCode: 500 },
531
539
  WHATSAPP_MESSAGE_NOT_FOUND: { code: 'W006', message: 'Message not found in notification', httpCode: 400 },
540
+ WHATSAPP_CHANNEL_NOT_IN_USE: { code: 'W007', message: 'WhatsApp channel is not in use', httpCode: 410 },
532
541
 
533
542
  //MAX MESSENGER
534
543
  MAX_MESSENGER_TEXT_NOT_SENT: { code: 'MX001', message: 'Failed to send text message via Max Messenger', httpCode: 500 },
@@ -27,4 +27,7 @@ export enum ConsignmentImportSchemaRelationEntityPropertyEnum {
27
27
  PACKAGE_MARKING = 'PACKAGE_MARKING',
28
28
  PACKAGE_QUANTITY = 'PACKAGE_QUANTITY',
29
29
  INVOICE_NUMBER = 'INVOICE_NUMBER',
30
+ OPTION1_TITLE = 'OPTION1_TITLE',
31
+ OPTION1_MULTIPLICITY = 'OPTION1_MULTIPLICITY',
32
+ OPTION1_PRICE = 'OPTION1_PRICE',
30
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.0.69",
3
+ "version": "1.0.71",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {