@floristcloud/api-lib 1.2.11 → 1.2.13
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/client/import-client.command.js +10 -5
- package/build/constant/error-i18n-key.js +4 -0
- package/build/constant/error.js +11 -1
- package/build/enum/client-import-entity-property.enum.js +28 -28
- package/build/enum/client-import-errors.enum.js +14 -0
- package/build/enum/index.js +1 -0
- package/commands/client/import-client.command.ts +14 -8
- package/constant/error-i18n-key.ts +4 -0
- package/constant/error.ts +11 -1
- package/enum/client-import-entity-property.enum.ts +28 -28
- package/enum/client-import-errors.enum.ts +10 -0
- package/enum/index.ts +1 -0
- package/package.json +1 -1
|
@@ -3,16 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ImportClientContractCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const schemas_1 = require("../../schemas");
|
|
6
|
+
const enum_1 = require("../../enum");
|
|
6
7
|
const ImportClientRequestSchema = zod_1.z.object({});
|
|
8
|
+
const ClientImportRowErrorSchema = zod_1.z.object({
|
|
9
|
+
row: zod_1.z.number(),
|
|
10
|
+
errors: zod_1.z.array(zod_1.z.object({
|
|
11
|
+
path: zod_1.z.nativeEnum(enum_1.ClientImportEntityPropertyEnum).optional(),
|
|
12
|
+
type: zod_1.z.nativeEnum(enum_1.ClientImportErrorsEnum),
|
|
13
|
+
})),
|
|
14
|
+
});
|
|
7
15
|
const ImportClientResponseSchema = zod_1.z.object({
|
|
8
16
|
message: zod_1.z.string().optional(),
|
|
9
17
|
data: zod_1.z.object({
|
|
10
|
-
success: zod_1.z.boolean(),
|
|
11
18
|
rows: zod_1.z.number(),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
errors: zod_1.z.array(schemas_1.DataNotExistsSchema),
|
|
15
|
-
})),
|
|
19
|
+
errors: zod_1.z.array(ClientImportRowErrorSchema),
|
|
20
|
+
globalErrors: zod_1.z.array(schemas_1.ErrorMessageSchema).optional(),
|
|
16
21
|
}),
|
|
17
22
|
});
|
|
18
23
|
var ImportClientContractCommand;
|
|
@@ -18,4 +18,8 @@ exports.ErrorI18nKey = {
|
|
|
18
18
|
moveItemsBatchLimitExceeded: 'moveItems.batchLimitExceeded',
|
|
19
19
|
moveItemsItemsNotFound: 'moveItems.itemsNotFound',
|
|
20
20
|
moveItemsInPreOrdersWarning: 'moveItems.inPreOrdersWarning',
|
|
21
|
+
consignmentImportTooManyRows: 'consignmentImport.tooManyRows',
|
|
22
|
+
clientImportTooManyRows: 'clientImport.tooManyRows',
|
|
23
|
+
clientImportInvalidFileFormat: 'clientImport.invalidFileFormat',
|
|
24
|
+
clientImportMissingRequiredColumns: 'clientImport.missingRequiredColumns',
|
|
21
25
|
};
|
package/build/constant/error.js
CHANGED
|
@@ -154,6 +154,9 @@ exports.ERRORS = {
|
|
|
154
154
|
CLIENT_HAS_TRANSACTIONS: { code: 'CL031', message: 'Client has transactions', httpCode: 400 },
|
|
155
155
|
CLIENT_DEBT_LIST_FETCH_FAILED: { code: 'CL032', message: 'Failed to get client debt list', httpCode: 500 },
|
|
156
156
|
CLIENT_OVERDUE_STATUS_FETCH_FAILED: { code: 'CL033', message: 'Failed to get client overdue status', httpCode: 500 },
|
|
157
|
+
CLIENT_IMPORT_TOO_MANY_ROWS: { code: 'CL034', message: 'Too many rows for client import', httpCode: 400 },
|
|
158
|
+
CLIENT_IMPORT_INVALID_FILE_FORMAT: { code: 'CL035', message: 'Invalid file format for client import', httpCode: 400 },
|
|
159
|
+
CLIENT_IMPORT_MISSING_REQUIRED_COLUMNS: { code: 'CL036', message: 'Missing required columns in client import file', httpCode: 400 },
|
|
157
160
|
//INDIVIDUAL PROFILE
|
|
158
161
|
CLIENT_INDIVIDUAL_PROFILE_NOT_CREATED: { code: 'CL013', message: 'Failed to create client individual profile', httpCode: 500 },
|
|
159
162
|
CLIENT_INDIVIDUAL_PROFILE_ALREADY_EXIST: { code: 'CL014', message: 'Individual profile already exist', httpCode: 409 },
|
|
@@ -226,13 +229,13 @@ exports.ERRORS = {
|
|
|
226
229
|
CONSIGNMENT_FILTERS_VALUES_FAILED: { code: 'CON014', message: 'Failed when retrieving consignment filters values', httpCode: 500 },
|
|
227
230
|
CONSIGNMENT_WRITE_OFF_NOT_EMPTY: { code: 'CON015', message: 'Consignment not deleted, write-off not empty', httpCode: 400 },
|
|
228
231
|
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
232
|
CONSIGNMENT_PRODUCT_UPDATE_INVALID_CONFIG: { code: 'CON018', message: 'Invalid config format', httpCode: 400 },
|
|
231
233
|
CONSIGNMENT_PRODUCT_UPDATE_NO_DATA_ROWS: { code: 'CON019', message: 'File has no data rows', httpCode: 400 },
|
|
232
234
|
CONSIGNMENT_PRODUCT_UPDATE_TOO_MANY_ROWS: { code: 'CON020', message: 'Too many rows', httpCode: 400 },
|
|
233
235
|
CONSIGNMENT_PRODUCT_UPDATE_DUPLICATE_MATCH: { code: 'CON021', message: 'Multiple matches for row, first used', httpCode: 200 },
|
|
234
236
|
CONSIGNMENT_PRODUCT_UPDATE_ANALYSIS_FAILED: { code: 'CON022', message: 'Update analysis failed', httpCode: 500 },
|
|
235
237
|
CONSIGNMENT_PRODUCT_UPDATE_BATCH_TOO_LARGE: { code: 'CON023', message: 'Batch size too large', httpCode: 400 },
|
|
238
|
+
CONSIGNMENT_IMPORT_TOO_MANY_ROWS: { code: 'CON024', message: 'Too many rows for this import mode', httpCode: 400 },
|
|
236
239
|
// CONSIGNMENT-IMPORT-SCHEME
|
|
237
240
|
CONSIGNMENT_IMPORT_SCHEME_NOT_CREATED: { code: 'CS001', message: 'Failed to create consignment import scheme', httpCode: 500 },
|
|
238
241
|
CONSIGNMENT_IMPORT_SCHEME_FETCH_FAILED: { code: 'CS002', message: 'Error when retrieving a consignment import scheme', httpCode: 500 },
|
|
@@ -244,6 +247,11 @@ exports.ERRORS = {
|
|
|
244
247
|
CONSIGNMENT_IMPORT_SCHEME_NOT_FOUND: { code: 'CS004', message: 'Consignment import scheme not founded', httpCode: 404 },
|
|
245
248
|
CONSIGNMENT_IMPORT_SCHEME_NOT_DELETED: { code: 'CS005', message: 'Consignment import scheme not deleted', httpCode: 500 },
|
|
246
249
|
CONSIGNMENT_IMPORT_SCHEME_NOT_UPDATED: { code: 'CS006', message: 'Failed to update consignment import scheme', httpCode: 500 },
|
|
250
|
+
CONSIGNMENT_IMPORT_SCHEME_DEFAULT_CANNOT_BE_DELETED: {
|
|
251
|
+
code: 'CS007',
|
|
252
|
+
message: 'Default consignment import scheme cannot be deleted',
|
|
253
|
+
httpCode: 400,
|
|
254
|
+
},
|
|
247
255
|
// CONSIGNMENT-IMPORT-SCHEMA-RELATION
|
|
248
256
|
CONSIGNMENT_IMPORT_SCHEMA_RELATION_NOT_CREATED: {
|
|
249
257
|
code: 'CSR001',
|
|
@@ -520,6 +528,8 @@ exports.ERRORS = {
|
|
|
520
528
|
FILE_SIZE_LIMIT_EXCEEDED: { code: 'F004', message: 'File size limit exceeded', httpCode: 400 },
|
|
521
529
|
FILE_GET_INFO_FAILED: { code: 'F005', message: 'Failed to get file info', httpCode: 500 },
|
|
522
530
|
FILE_NOT_SUPPORTED: { code: 'F006', message: 'File not supported', httpCode: 400 },
|
|
531
|
+
FILE_TOO_LARGE: { code: 'F007', message: 'File size exceeds the allowed limit', httpCode: 413 },
|
|
532
|
+
FILE_UPLOAD_FAILED: { code: 'F008', message: 'File upload failed', httpCode: 400 },
|
|
523
533
|
FILE_S3_FORBIDDEN: { code: 'F007', message: 'File S3 forbidden', httpCode: 403 },
|
|
524
534
|
//WHATSAPP
|
|
525
535
|
WHATSAPP_TEXT_NOT_SENT: { code: 'W001', message: 'Failed to send text message', httpCode: 500 },
|
|
@@ -4,34 +4,34 @@ exports.ClientImportEntityPropertyEnum = void 0;
|
|
|
4
4
|
var ClientImportEntityPropertyEnum;
|
|
5
5
|
(function (ClientImportEntityPropertyEnum) {
|
|
6
6
|
// Base Client Fields
|
|
7
|
-
ClientImportEntityPropertyEnum["NAME"] = "
|
|
8
|
-
ClientImportEntityPropertyEnum["EMAIL"] = "
|
|
9
|
-
ClientImportEntityPropertyEnum["PHONE"] = "
|
|
10
|
-
ClientImportEntityPropertyEnum["CLIENT_TYPE"] = "
|
|
11
|
-
ClientImportEntityPropertyEnum["CODE"] = "
|
|
12
|
-
ClientImportEntityPropertyEnum["CONTACT_NAME"] = "
|
|
13
|
-
ClientImportEntityPropertyEnum["ADDRESS"] = "
|
|
14
|
-
ClientImportEntityPropertyEnum["CITY"] = "
|
|
15
|
-
ClientImportEntityPropertyEnum["GROUP"] = "
|
|
16
|
-
ClientImportEntityPropertyEnum["CONTRACT_NUMBER"] = "
|
|
17
|
-
ClientImportEntityPropertyEnum["CONTRACT_DATE"] = "
|
|
7
|
+
ClientImportEntityPropertyEnum["NAME"] = "name";
|
|
8
|
+
ClientImportEntityPropertyEnum["EMAIL"] = "email";
|
|
9
|
+
ClientImportEntityPropertyEnum["PHONE"] = "phone";
|
|
10
|
+
ClientImportEntityPropertyEnum["CLIENT_TYPE"] = "clientType";
|
|
11
|
+
ClientImportEntityPropertyEnum["CODE"] = "code";
|
|
12
|
+
ClientImportEntityPropertyEnum["CONTACT_NAME"] = "contactName";
|
|
13
|
+
ClientImportEntityPropertyEnum["ADDRESS"] = "address";
|
|
14
|
+
ClientImportEntityPropertyEnum["CITY"] = "city";
|
|
15
|
+
ClientImportEntityPropertyEnum["GROUP"] = "group";
|
|
16
|
+
ClientImportEntityPropertyEnum["CONTRACT_NUMBER"] = "contractNumber";
|
|
17
|
+
ClientImportEntityPropertyEnum["CONTRACT_DATE"] = "contractDate";
|
|
18
18
|
// Individual Profile Fields
|
|
19
|
-
ClientImportEntityPropertyEnum["FIRST_NAME"] = "
|
|
20
|
-
ClientImportEntityPropertyEnum["LAST_NAME"] = "
|
|
21
|
-
ClientImportEntityPropertyEnum["MIDDLE_NAME"] = "
|
|
19
|
+
ClientImportEntityPropertyEnum["FIRST_NAME"] = "firstName";
|
|
20
|
+
ClientImportEntityPropertyEnum["LAST_NAME"] = "lastName";
|
|
21
|
+
ClientImportEntityPropertyEnum["MIDDLE_NAME"] = "middleName";
|
|
22
22
|
// Legal Profile Fields
|
|
23
|
-
ClientImportEntityPropertyEnum["FULL_COMPANY_NAME"] = "
|
|
24
|
-
ClientImportEntityPropertyEnum["TAX_ID"] = "
|
|
25
|
-
ClientImportEntityPropertyEnum["BANK_NAME"] = "
|
|
26
|
-
ClientImportEntityPropertyEnum["BANK_ACCOUNT"] = "
|
|
27
|
-
ClientImportEntityPropertyEnum["BANK_BIC"] = "
|
|
28
|
-
ClientImportEntityPropertyEnum["KPP"] = "
|
|
29
|
-
ClientImportEntityPropertyEnum["OGRN"] = "
|
|
30
|
-
ClientImportEntityPropertyEnum["OGRNIP"] = "
|
|
31
|
-
ClientImportEntityPropertyEnum["DIRECTOR_NAME"] = "
|
|
32
|
-
ClientImportEntityPropertyEnum["DIRECTOR_POSITION"] = "
|
|
33
|
-
ClientImportEntityPropertyEnum["DIRECTOR_AUTHORITY"] = "
|
|
34
|
-
ClientImportEntityPropertyEnum["EDO_ID"] = "
|
|
35
|
-
ClientImportEntityPropertyEnum["EDO_USAGE"] = "
|
|
36
|
-
ClientImportEntityPropertyEnum["LEGAL_TYPE"] = "
|
|
23
|
+
ClientImportEntityPropertyEnum["FULL_COMPANY_NAME"] = "fullCompanyName";
|
|
24
|
+
ClientImportEntityPropertyEnum["TAX_ID"] = "taxId";
|
|
25
|
+
ClientImportEntityPropertyEnum["BANK_NAME"] = "bankName";
|
|
26
|
+
ClientImportEntityPropertyEnum["BANK_ACCOUNT"] = "bankAccountNumber";
|
|
27
|
+
ClientImportEntityPropertyEnum["BANK_BIC"] = "bankBic";
|
|
28
|
+
ClientImportEntityPropertyEnum["KPP"] = "kpp";
|
|
29
|
+
ClientImportEntityPropertyEnum["OGRN"] = "ogrn";
|
|
30
|
+
ClientImportEntityPropertyEnum["OGRNIP"] = "ogrnip";
|
|
31
|
+
ClientImportEntityPropertyEnum["DIRECTOR_NAME"] = "directorName";
|
|
32
|
+
ClientImportEntityPropertyEnum["DIRECTOR_POSITION"] = "directorPosition";
|
|
33
|
+
ClientImportEntityPropertyEnum["DIRECTOR_AUTHORITY"] = "directorAuthority";
|
|
34
|
+
ClientImportEntityPropertyEnum["EDO_ID"] = "edoId";
|
|
35
|
+
ClientImportEntityPropertyEnum["EDO_USAGE"] = "edoUsage";
|
|
36
|
+
ClientImportEntityPropertyEnum["LEGAL_TYPE"] = "legalType";
|
|
37
37
|
})(ClientImportEntityPropertyEnum || (exports.ClientImportEntityPropertyEnum = ClientImportEntityPropertyEnum = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientImportErrorsEnum = void 0;
|
|
4
|
+
var ClientImportErrorsEnum;
|
|
5
|
+
(function (ClientImportErrorsEnum) {
|
|
6
|
+
ClientImportErrorsEnum["REQUIRED"] = "REQUIRED";
|
|
7
|
+
ClientImportErrorsEnum["INVALID_VALUE"] = "INVALID_VALUE";
|
|
8
|
+
ClientImportErrorsEnum["DUPLICATE_NAME"] = "DUPLICATE_NAME";
|
|
9
|
+
ClientImportErrorsEnum["DUPLICATE_EMAIL"] = "DUPLICATE_EMAIL";
|
|
10
|
+
ClientImportErrorsEnum["DUPLICATE_PHONE"] = "DUPLICATE_PHONE";
|
|
11
|
+
ClientImportErrorsEnum["NAME_ALREADY_EXISTS_IN_DB"] = "NAME_ALREADY_EXISTS_IN_DB";
|
|
12
|
+
ClientImportErrorsEnum["EMAIL_ALREADY_EXISTS_IN_DB"] = "EMAIL_ALREADY_EXISTS_IN_DB";
|
|
13
|
+
ClientImportErrorsEnum["PHONE_ALREADY_EXISTS_IN_DB"] = "PHONE_ALREADY_EXISTS_IN_DB";
|
|
14
|
+
})(ClientImportErrorsEnum || (exports.ClientImportErrorsEnum = ClientImportErrorsEnum = {}));
|
package/build/enum/index.js
CHANGED
|
@@ -56,6 +56,7 @@ __exportStar(require("./position-report-type.enum"), exports);
|
|
|
56
56
|
__exportStar(require("./discount-price-routing.enum"), exports);
|
|
57
57
|
__exportStar(require("./sales-unit.enum"), exports);
|
|
58
58
|
__exportStar(require("./client-import-entity-property.enum"), exports);
|
|
59
|
+
__exportStar(require("./client-import-errors.enum"), exports);
|
|
59
60
|
__exportStar(require("./pre-order-collection-item-import-entity-property.enum"), exports);
|
|
60
61
|
__exportStar(require("./report-period-type.enum"), exports);
|
|
61
62
|
__exportStar(require("./inventory-movement-type.enum"), exports);
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { ErrorMessageSchema } from '../../schemas';
|
|
3
|
+
import { ClientImportEntityPropertyEnum, ClientImportErrorsEnum } from '../../enum';
|
|
3
4
|
|
|
4
5
|
const ImportClientRequestSchema = z.object({});
|
|
5
6
|
|
|
7
|
+
const ClientImportRowErrorSchema = z.object({
|
|
8
|
+
row: z.number(),
|
|
9
|
+
errors: z.array(
|
|
10
|
+
z.object({
|
|
11
|
+
path: z.nativeEnum(ClientImportEntityPropertyEnum).optional(),
|
|
12
|
+
type: z.nativeEnum(ClientImportErrorsEnum),
|
|
13
|
+
}),
|
|
14
|
+
),
|
|
15
|
+
});
|
|
16
|
+
|
|
6
17
|
const ImportClientResponseSchema = z.object({
|
|
7
18
|
message: z.string().optional(),
|
|
8
19
|
data: z.object({
|
|
9
|
-
success: z.boolean(),
|
|
10
20
|
rows: z.number(),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
row: z.number(),
|
|
14
|
-
errors: z.array(DataNotExistsSchema),
|
|
15
|
-
}),
|
|
16
|
-
),
|
|
21
|
+
errors: z.array(ClientImportRowErrorSchema),
|
|
22
|
+
globalErrors: z.array(ErrorMessageSchema).optional(),
|
|
17
23
|
}),
|
|
18
24
|
});
|
|
19
25
|
|
|
@@ -15,6 +15,10 @@ export const ErrorI18nKey = {
|
|
|
15
15
|
moveItemsBatchLimitExceeded: 'moveItems.batchLimitExceeded',
|
|
16
16
|
moveItemsItemsNotFound: 'moveItems.itemsNotFound',
|
|
17
17
|
moveItemsInPreOrdersWarning: 'moveItems.inPreOrdersWarning',
|
|
18
|
+
consignmentImportTooManyRows: 'consignmentImport.tooManyRows',
|
|
19
|
+
clientImportTooManyRows: 'clientImport.tooManyRows',
|
|
20
|
+
clientImportInvalidFileFormat: 'clientImport.invalidFileFormat',
|
|
21
|
+
clientImportMissingRequiredColumns: 'clientImport.missingRequiredColumns',
|
|
18
22
|
} as const;
|
|
19
23
|
|
|
20
24
|
export type ErrorI18nKeyType = (typeof ErrorI18nKey)[keyof typeof ErrorI18nKey];
|
package/constant/error.ts
CHANGED
|
@@ -160,6 +160,9 @@ export const ERRORS = {
|
|
|
160
160
|
CLIENT_HAS_TRANSACTIONS: { code: 'CL031', message: 'Client has transactions', httpCode: 400 },
|
|
161
161
|
CLIENT_DEBT_LIST_FETCH_FAILED: { code: 'CL032', message: 'Failed to get client debt list', httpCode: 500 },
|
|
162
162
|
CLIENT_OVERDUE_STATUS_FETCH_FAILED: { code: 'CL033', message: 'Failed to get client overdue status', httpCode: 500 },
|
|
163
|
+
CLIENT_IMPORT_TOO_MANY_ROWS: { code: 'CL034', message: 'Too many rows for client import', httpCode: 400 },
|
|
164
|
+
CLIENT_IMPORT_INVALID_FILE_FORMAT: { code: 'CL035', message: 'Invalid file format for client import', httpCode: 400 },
|
|
165
|
+
CLIENT_IMPORT_MISSING_REQUIRED_COLUMNS: { code: 'CL036', message: 'Missing required columns in client import file', httpCode: 400 },
|
|
163
166
|
|
|
164
167
|
//INDIVIDUAL PROFILE
|
|
165
168
|
CLIENT_INDIVIDUAL_PROFILE_NOT_CREATED: { code: 'CL013', message: 'Failed to create client individual profile', httpCode: 500 },
|
|
@@ -235,13 +238,13 @@ export const ERRORS = {
|
|
|
235
238
|
CONSIGNMENT_FILTERS_VALUES_FAILED: { code: 'CON014', message: 'Failed when retrieving consignment filters values', httpCode: 500 },
|
|
236
239
|
CONSIGNMENT_WRITE_OFF_NOT_EMPTY: { code: 'CON015', message: 'Consignment not deleted, write-off not empty', httpCode: 400 },
|
|
237
240
|
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
241
|
CONSIGNMENT_PRODUCT_UPDATE_INVALID_CONFIG: { code: 'CON018', message: 'Invalid config format', httpCode: 400 },
|
|
240
242
|
CONSIGNMENT_PRODUCT_UPDATE_NO_DATA_ROWS: { code: 'CON019', message: 'File has no data rows', httpCode: 400 },
|
|
241
243
|
CONSIGNMENT_PRODUCT_UPDATE_TOO_MANY_ROWS: { code: 'CON020', message: 'Too many rows', httpCode: 400 },
|
|
242
244
|
CONSIGNMENT_PRODUCT_UPDATE_DUPLICATE_MATCH: { code: 'CON021', message: 'Multiple matches for row, first used', httpCode: 200 },
|
|
243
245
|
CONSIGNMENT_PRODUCT_UPDATE_ANALYSIS_FAILED: { code: 'CON022', message: 'Update analysis failed', httpCode: 500 },
|
|
244
246
|
CONSIGNMENT_PRODUCT_UPDATE_BATCH_TOO_LARGE: { code: 'CON023', message: 'Batch size too large', httpCode: 400 },
|
|
247
|
+
CONSIGNMENT_IMPORT_TOO_MANY_ROWS: { code: 'CON024', message: 'Too many rows for this import mode', httpCode: 400 },
|
|
245
248
|
|
|
246
249
|
// CONSIGNMENT-IMPORT-SCHEME
|
|
247
250
|
CONSIGNMENT_IMPORT_SCHEME_NOT_CREATED: { code: 'CS001', message: 'Failed to create consignment import scheme', httpCode: 500 },
|
|
@@ -254,6 +257,11 @@ export const ERRORS = {
|
|
|
254
257
|
CONSIGNMENT_IMPORT_SCHEME_NOT_FOUND: { code: 'CS004', message: 'Consignment import scheme not founded', httpCode: 404 },
|
|
255
258
|
CONSIGNMENT_IMPORT_SCHEME_NOT_DELETED: { code: 'CS005', message: 'Consignment import scheme not deleted', httpCode: 500 },
|
|
256
259
|
CONSIGNMENT_IMPORT_SCHEME_NOT_UPDATED: { code: 'CS006', message: 'Failed to update consignment import scheme', httpCode: 500 },
|
|
260
|
+
CONSIGNMENT_IMPORT_SCHEME_DEFAULT_CANNOT_BE_DELETED: {
|
|
261
|
+
code: 'CS007',
|
|
262
|
+
message: 'Default consignment import scheme cannot be deleted',
|
|
263
|
+
httpCode: 400,
|
|
264
|
+
},
|
|
257
265
|
|
|
258
266
|
// CONSIGNMENT-IMPORT-SCHEMA-RELATION
|
|
259
267
|
CONSIGNMENT_IMPORT_SCHEMA_RELATION_NOT_CREATED: {
|
|
@@ -545,6 +553,8 @@ export const ERRORS = {
|
|
|
545
553
|
FILE_SIZE_LIMIT_EXCEEDED: { code: 'F004', message: 'File size limit exceeded', httpCode: 400 },
|
|
546
554
|
FILE_GET_INFO_FAILED: { code: 'F005', message: 'Failed to get file info', httpCode: 500 },
|
|
547
555
|
FILE_NOT_SUPPORTED: { code: 'F006', message: 'File not supported', httpCode: 400 },
|
|
556
|
+
FILE_TOO_LARGE: { code: 'F007', message: 'File size exceeds the allowed limit', httpCode: 413 },
|
|
557
|
+
FILE_UPLOAD_FAILED: { code: 'F008', message: 'File upload failed', httpCode: 400 },
|
|
548
558
|
FILE_S3_FORBIDDEN: { code: 'F007', message: 'File S3 forbidden', httpCode: 403 },
|
|
549
559
|
|
|
550
560
|
//WHATSAPP
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
export enum ClientImportEntityPropertyEnum {
|
|
2
2
|
// Base Client Fields
|
|
3
|
-
NAME = '
|
|
4
|
-
EMAIL = '
|
|
5
|
-
PHONE = '
|
|
6
|
-
CLIENT_TYPE = '
|
|
7
|
-
CODE = '
|
|
8
|
-
CONTACT_NAME = '
|
|
9
|
-
ADDRESS = '
|
|
10
|
-
CITY = '
|
|
11
|
-
GROUP = '
|
|
12
|
-
CONTRACT_NUMBER = '
|
|
13
|
-
CONTRACT_DATE = '
|
|
3
|
+
NAME = 'name',
|
|
4
|
+
EMAIL = 'email',
|
|
5
|
+
PHONE = 'phone',
|
|
6
|
+
CLIENT_TYPE = 'clientType',
|
|
7
|
+
CODE = 'code',
|
|
8
|
+
CONTACT_NAME = 'contactName',
|
|
9
|
+
ADDRESS = 'address',
|
|
10
|
+
CITY = 'city',
|
|
11
|
+
GROUP = 'group',
|
|
12
|
+
CONTRACT_NUMBER = 'contractNumber',
|
|
13
|
+
CONTRACT_DATE = 'contractDate',
|
|
14
14
|
|
|
15
15
|
// Individual Profile Fields
|
|
16
|
-
FIRST_NAME = '
|
|
17
|
-
LAST_NAME = '
|
|
18
|
-
MIDDLE_NAME = '
|
|
16
|
+
FIRST_NAME = 'firstName',
|
|
17
|
+
LAST_NAME = 'lastName',
|
|
18
|
+
MIDDLE_NAME = 'middleName',
|
|
19
19
|
|
|
20
20
|
// Legal Profile Fields
|
|
21
|
-
FULL_COMPANY_NAME = '
|
|
22
|
-
TAX_ID = '
|
|
23
|
-
BANK_NAME = '
|
|
24
|
-
BANK_ACCOUNT = '
|
|
25
|
-
BANK_BIC = '
|
|
26
|
-
KPP = '
|
|
27
|
-
OGRN = '
|
|
28
|
-
OGRNIP = '
|
|
29
|
-
DIRECTOR_NAME = '
|
|
30
|
-
DIRECTOR_POSITION = '
|
|
31
|
-
DIRECTOR_AUTHORITY = '
|
|
32
|
-
EDO_ID = '
|
|
33
|
-
EDO_USAGE = '
|
|
34
|
-
LEGAL_TYPE = '
|
|
21
|
+
FULL_COMPANY_NAME = 'fullCompanyName',
|
|
22
|
+
TAX_ID = 'taxId',
|
|
23
|
+
BANK_NAME = 'bankName',
|
|
24
|
+
BANK_ACCOUNT = 'bankAccountNumber',
|
|
25
|
+
BANK_BIC = 'bankBic',
|
|
26
|
+
KPP = 'kpp',
|
|
27
|
+
OGRN = 'ogrn',
|
|
28
|
+
OGRNIP = 'ogrnip',
|
|
29
|
+
DIRECTOR_NAME = 'directorName',
|
|
30
|
+
DIRECTOR_POSITION = 'directorPosition',
|
|
31
|
+
DIRECTOR_AUTHORITY = 'directorAuthority',
|
|
32
|
+
EDO_ID = 'edoId',
|
|
33
|
+
EDO_USAGE = 'edoUsage',
|
|
34
|
+
LEGAL_TYPE = 'legalType',
|
|
35
35
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export enum ClientImportErrorsEnum {
|
|
2
|
+
REQUIRED = 'REQUIRED',
|
|
3
|
+
INVALID_VALUE = 'INVALID_VALUE',
|
|
4
|
+
DUPLICATE_NAME = 'DUPLICATE_NAME',
|
|
5
|
+
DUPLICATE_EMAIL = 'DUPLICATE_EMAIL',
|
|
6
|
+
DUPLICATE_PHONE = 'DUPLICATE_PHONE',
|
|
7
|
+
NAME_ALREADY_EXISTS_IN_DB = 'NAME_ALREADY_EXISTS_IN_DB',
|
|
8
|
+
EMAIL_ALREADY_EXISTS_IN_DB = 'EMAIL_ALREADY_EXISTS_IN_DB',
|
|
9
|
+
PHONE_ALREADY_EXISTS_IN_DB = 'PHONE_ALREADY_EXISTS_IN_DB',
|
|
10
|
+
}
|
package/enum/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ export * from './position-report-type.enum';
|
|
|
40
40
|
export * from './discount-price-routing.enum';
|
|
41
41
|
export * from './sales-unit.enum';
|
|
42
42
|
export * from './client-import-entity-property.enum';
|
|
43
|
+
export * from './client-import-errors.enum';
|
|
43
44
|
export * from './pre-order-collection-item-import-entity-property.enum';
|
|
44
45
|
export * from './report-period-type.enum';
|
|
45
46
|
export * from './inventory-movement-type.enum';
|