@floristcloud/api-lib 1.2.26 → 1.2.28
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/integration/index.js +1 -0
- package/build/commands/integration/moysklad/get-moysklad-status.query.js +8 -0
- package/build/commands/integration/moysklad/index.js +1 -0
- package/build/commands/integration/moysklad/sync-moysklad-stock.command.js +16 -0
- package/build/commands/integration/one-c/connect-one-c.command.js +15 -0
- package/build/commands/integration/one-c/disconnect-one-c.command.js +14 -0
- package/build/commands/integration/one-c/get-one-c-status.query.js +18 -0
- package/build/commands/integration/one-c/index.js +20 -0
- package/build/commands/integration/one-c/rotate-one-c-password.command.js +15 -0
- package/build/commands/order-product/group/update-group-order-product-order.command.js +8 -4
- package/build/constant/error.js +36 -1
- package/build/enum/action-log-type.enum.js +1 -0
- package/build/enum/integration-provider.enum.js +1 -0
- package/build/schemas/consignment/consignment.schema.js +0 -1
- package/build/schemas/order/order.schema.js +0 -1
- package/build/schemas/product/product.schema.js +0 -1
- package/commands/integration/index.ts +1 -1
- package/commands/integration/moysklad/get-moysklad-status.query.ts +8 -0
- package/commands/integration/moysklad/index.ts +1 -0
- package/commands/integration/moysklad/sync-moysklad-stock.command.ts +15 -0
- package/commands/integration/one-c/connect-one-c.command.ts +14 -0
- package/commands/integration/one-c/disconnect-one-c.command.ts +13 -0
- package/commands/integration/one-c/get-one-c-status.query.ts +17 -0
- package/commands/integration/one-c/index.ts +4 -0
- package/commands/integration/one-c/rotate-one-c-password.command.ts +14 -0
- package/commands/order-product/group/update-group-order-product-order.command.ts +11 -6
- package/constant/error.ts +37 -1
- package/enum/action-log-type.enum.ts +1 -0
- package/enum/integration-provider.enum.ts +1 -0
- package/package.json +1 -1
- package/schemas/consignment/consignment.schema.ts +0 -1
- package/schemas/order/order.schema.ts +0 -1
- package/schemas/product/product.schema.ts +0 -1
|
@@ -16,6 +16,14 @@ const GetMoyskladStatusResponseSchema = zod_1.z.object({
|
|
|
16
16
|
nameProcessingConvention: zod_1.z.nativeEnum(consignment_import_name_convention_enum_1.ConsignmentImportNameConventionEnum).nullable(),
|
|
17
17
|
isRemoveSizeFromName: zod_1.z.boolean(),
|
|
18
18
|
isCutCategoryFromName: zod_1.z.boolean(),
|
|
19
|
+
lastStockSyncedAt: zod_1.z.string().datetime().nullable(),
|
|
20
|
+
stockSyncStatus: zod_1.z.enum(['PENDING', 'RUNNING', 'DEAD', 'IDLE']),
|
|
21
|
+
stockSyncDeadInfo: zod_1.z
|
|
22
|
+
.object({
|
|
23
|
+
errorCode: zod_1.z.string(),
|
|
24
|
+
errorMessage: zod_1.z.string(),
|
|
25
|
+
})
|
|
26
|
+
.nullable(),
|
|
19
27
|
}),
|
|
20
28
|
});
|
|
21
29
|
var GetMoyskladStatusContractQuery;
|
|
@@ -26,3 +26,4 @@ __exportStar(require("./scan-moysklad-clients-import.query"), exports);
|
|
|
26
26
|
__exportStar(require("./execute-moysklad-clients-import.command"), exports);
|
|
27
27
|
__exportStar(require("./get-order-sync-status.query"), exports);
|
|
28
28
|
__exportStar(require("./get-orders-batch-sync-status.query"), exports);
|
|
29
|
+
__exportStar(require("./sync-moysklad-stock.command"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SyncMoyskladStockContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const SyncMoyskladStockResponseSchema = zod_1.z.object({
|
|
6
|
+
message: zod_1.z.string().optional(),
|
|
7
|
+
data: zod_1.z.object({
|
|
8
|
+
jobUUID: zod_1.z.string().uuid(),
|
|
9
|
+
status: zod_1.z.enum(['PENDING', 'RUNNING']),
|
|
10
|
+
wasAlreadyQueued: zod_1.z.boolean(),
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
var SyncMoyskladStockContractCommand;
|
|
14
|
+
(function (SyncMoyskladStockContractCommand) {
|
|
15
|
+
SyncMoyskladStockContractCommand.ResponseSchema = SyncMoyskladStockResponseSchema;
|
|
16
|
+
})(SyncMoyskladStockContractCommand || (exports.SyncMoyskladStockContractCommand = SyncMoyskladStockContractCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectOneCContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const ConnectOneCResponseSchema = zod_1.z.object({
|
|
6
|
+
message: zod_1.z.string().optional(),
|
|
7
|
+
data: zod_1.z.object({
|
|
8
|
+
username: zod_1.z.string(),
|
|
9
|
+
password: zod_1.z.string(),
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
12
|
+
var ConnectOneCContractCommand;
|
|
13
|
+
(function (ConnectOneCContractCommand) {
|
|
14
|
+
ConnectOneCContractCommand.ResponseSchema = ConnectOneCResponseSchema;
|
|
15
|
+
})(ConnectOneCContractCommand || (exports.ConnectOneCContractCommand = ConnectOneCContractCommand = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DisconnectOneCContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const DisconnectOneCResponseSchema = zod_1.z.object({
|
|
6
|
+
message: zod_1.z.string().optional(),
|
|
7
|
+
data: zod_1.z.object({
|
|
8
|
+
success: zod_1.z.literal(true),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
11
|
+
var DisconnectOneCContractCommand;
|
|
12
|
+
(function (DisconnectOneCContractCommand) {
|
|
13
|
+
DisconnectOneCContractCommand.ResponseSchema = DisconnectOneCResponseSchema;
|
|
14
|
+
})(DisconnectOneCContractCommand || (exports.DisconnectOneCContractCommand = DisconnectOneCContractCommand = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetOneCStatusContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const GetOneCStatusResponseSchema = zod_1.z.object({
|
|
6
|
+
message: zod_1.z.string().optional(),
|
|
7
|
+
data: zod_1.z.object({
|
|
8
|
+
isConnected: zod_1.z.boolean(),
|
|
9
|
+
isEnabled: zod_1.z.boolean(),
|
|
10
|
+
username: zod_1.z.string().nullable(),
|
|
11
|
+
lastCheckauthAt: zod_1.z.string().datetime().nullable(),
|
|
12
|
+
lastSyncAt: zod_1.z.string().datetime().nullable(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
var GetOneCStatusContractQuery;
|
|
16
|
+
(function (GetOneCStatusContractQuery) {
|
|
17
|
+
GetOneCStatusContractQuery.ResponseSchema = GetOneCStatusResponseSchema;
|
|
18
|
+
})(GetOneCStatusContractQuery || (exports.GetOneCStatusContractQuery = GetOneCStatusContractQuery = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./connect-one-c.command"), exports);
|
|
18
|
+
__exportStar(require("./rotate-one-c-password.command"), exports);
|
|
19
|
+
__exportStar(require("./disconnect-one-c.command"), exports);
|
|
20
|
+
__exportStar(require("./get-one-c-status.query"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RotateOneCPasswordContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const RotateOneCPasswordResponseSchema = zod_1.z.object({
|
|
6
|
+
message: zod_1.z.string().optional(),
|
|
7
|
+
data: zod_1.z.object({
|
|
8
|
+
username: zod_1.z.string(),
|
|
9
|
+
password: zod_1.z.string(),
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
12
|
+
var RotateOneCPasswordContractCommand;
|
|
13
|
+
(function (RotateOneCPasswordContractCommand) {
|
|
14
|
+
RotateOneCPasswordContractCommand.ResponseSchema = RotateOneCPasswordResponseSchema;
|
|
15
|
+
})(RotateOneCPasswordContractCommand || (exports.RotateOneCPasswordContractCommand = RotateOneCPasswordContractCommand = {}));
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateGroupOrderProductOrderContractCommand = void 0;
|
|
3
|
+
exports.UpdateGroupOrderProductOrderContractCommand = exports.BULK_MOVE_ORDER_PRODUCT_LIMIT = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
exports.BULK_MOVE_ORDER_PRODUCT_LIMIT = 200;
|
|
5
6
|
const UpdateGroupOrderProductOrderRequestSchema = zod_1.z.object({
|
|
6
|
-
orderProductUUIDList: zod_1.z
|
|
7
|
+
orderProductUUIDList: zod_1.z
|
|
8
|
+
.array(zod_1.z.object({
|
|
7
9
|
uuid: zod_1.z.string(),
|
|
8
|
-
quantity: zod_1.z.coerce.number(),
|
|
9
|
-
}))
|
|
10
|
+
quantity: zod_1.z.coerce.number().int().positive(),
|
|
11
|
+
}))
|
|
12
|
+
.min(1)
|
|
13
|
+
.max(exports.BULK_MOVE_ORDER_PRODUCT_LIMIT),
|
|
10
14
|
newOrderUUID: zod_1.z.uuid(),
|
|
11
15
|
isDelete: zod_1.z.coerce.boolean().optional().default(true),
|
|
12
16
|
isComment: zod_1.z.coerce.boolean().optional().default(true),
|
package/build/constant/error.js
CHANGED
|
@@ -430,6 +430,16 @@ exports.ERRORS = {
|
|
|
430
430
|
message: 'Another bulk operation on this order is in progress, retry later',
|
|
431
431
|
httpCode: 409,
|
|
432
432
|
},
|
|
433
|
+
ORDER_PRODUCT_HAS_WRITE_OFF: {
|
|
434
|
+
code: 'OP019',
|
|
435
|
+
message: 'Cannot move order-product: it has a write-off attached',
|
|
436
|
+
httpCode: 400,
|
|
437
|
+
},
|
|
438
|
+
ORDER_MOVE_BULK_OPERATION_IN_PROGRESS: {
|
|
439
|
+
code: 'OP020',
|
|
440
|
+
message: 'Another bulk-move operation on this pair of orders is in progress, retry later',
|
|
441
|
+
httpCode: 409,
|
|
442
|
+
},
|
|
433
443
|
//TRANSACTION
|
|
434
444
|
TRANSACTION_NOT_CREATED: { code: 'TR001', message: 'Failed to transaction product', httpCode: 500 },
|
|
435
445
|
TRANSACTION_FETCH_FAILED: { code: 'TR002', message: 'Error when retrieving a transaction', httpCode: 500 },
|
|
@@ -986,7 +996,11 @@ exports.ERRORS = {
|
|
|
986
996
|
MOYSKLAD_NOT_CONNECTED: { code: 'MS003', message: 'MoySklad integration is not connected for this company', httpCode: 404 },
|
|
987
997
|
MOYSKLAD_API_ERROR: { code: 'MS004', message: 'MoySklad API request failed', httpCode: 502 },
|
|
988
998
|
MOYSKLAD_DISCONNECT_FAILED: { code: 'MS005', message: 'Failed to disconnect MoySklad integration', httpCode: 500 },
|
|
989
|
-
MOYSKLAD_SETTINGS_INVALID: {
|
|
999
|
+
MOYSKLAD_SETTINGS_INVALID: {
|
|
1000
|
+
code: 'MS006',
|
|
1001
|
+
message: 'Provided organization or store does not belong to the connected MoySklad account',
|
|
1002
|
+
httpCode: 400,
|
|
1003
|
+
},
|
|
990
1004
|
INTEGRATION_ENC_KEY_NOT_SET: { code: 'MS007', message: 'Integration encryption key is not configured on the server', httpCode: 500 },
|
|
991
1005
|
MOYSKLAD_IMPORT_IN_PROGRESS: { code: 'MS008', message: 'MoySklad import is already in progress for this company', httpCode: 409 },
|
|
992
1006
|
MOYSKLAD_CLIENTS_IMPORT_IN_PROGRESS: {
|
|
@@ -1029,4 +1043,25 @@ exports.ERRORS = {
|
|
|
1029
1043
|
message: 'Outbound sync entity type is not supported by this provider',
|
|
1030
1044
|
httpCode: 400,
|
|
1031
1045
|
},
|
|
1046
|
+
MOYSKLAD_STOCK_SYNC_CAP_EXCEEDED: {
|
|
1047
|
+
code: 'MS015',
|
|
1048
|
+
message: 'MoySklad stock-sync concurrency cap exceeded; will retry shortly',
|
|
1049
|
+
httpCode: 429,
|
|
1050
|
+
},
|
|
1051
|
+
MOYSKLAD_STOCK_SYNC_LOCK_BUSY: {
|
|
1052
|
+
code: 'MS016',
|
|
1053
|
+
message: 'MoySklad sync lock is held by another job for this company; will retry shortly',
|
|
1054
|
+
httpCode: 409,
|
|
1055
|
+
},
|
|
1056
|
+
MOYSKLAD_INTEGRATION_DISABLED: {
|
|
1057
|
+
code: 'MS017',
|
|
1058
|
+
message: 'MoySklad integration is disabled for this company',
|
|
1059
|
+
httpCode: 409,
|
|
1060
|
+
},
|
|
1061
|
+
// 1C COMMERCEML INTEGRATION
|
|
1062
|
+
ONE_C_NOT_CONNECTED: { code: 'OC001', message: '1C integration is not connected for this company', httpCode: 404 },
|
|
1063
|
+
ONE_C_CONNECT_FAILED: { code: 'OC002', message: 'Failed to connect 1C integration', httpCode: 500 },
|
|
1064
|
+
ONE_C_INVALID_CREDENTIALS: { code: 'OC003', message: '1C credentials are invalid', httpCode: 401 },
|
|
1065
|
+
ONE_C_INTEGRATION_DISABLED: { code: 'OC004', message: '1C integration is disabled for this company', httpCode: 409 },
|
|
1066
|
+
ONE_C_SESSION_INVALID: { code: 'OC005', message: '1C session is missing or expired', httpCode: 401 },
|
|
1032
1067
|
};
|
|
@@ -9,6 +9,7 @@ var ActionLogTypeEnum;
|
|
|
9
9
|
ActionLogTypeEnum["DELETE_ORDER"] = "DELETE_ORDER";
|
|
10
10
|
ActionLogTypeEnum["DELETE_ORDER_ITEM"] = "DELETE_ORDER_ITEM";
|
|
11
11
|
ActionLogTypeEnum["UPDATE_ORDER_ITEM"] = "UPDATE_ORDER_ITEM";
|
|
12
|
+
ActionLogTypeEnum["MOVE_ORDER_ITEM"] = "MOVE_ORDER_ITEM";
|
|
12
13
|
ActionLogTypeEnum["ADD_PAYMENT"] = "ADD_PAYMENT";
|
|
13
14
|
ActionLogTypeEnum["DELETE_PAYMENT"] = "DELETE_PAYMENT";
|
|
14
15
|
ActionLogTypeEnum["CREATE_PREORDER"] = "CREATE_PREORDER";
|
|
@@ -4,4 +4,5 @@ exports.IntegrationProviderEnum = void 0;
|
|
|
4
4
|
var IntegrationProviderEnum;
|
|
5
5
|
(function (IntegrationProviderEnum) {
|
|
6
6
|
IntegrationProviderEnum["MOYSKLAD"] = "MOYSKLAD";
|
|
7
|
+
IntegrationProviderEnum["ONE_C"] = "ONE_C";
|
|
7
8
|
})(IntegrationProviderEnum || (exports.IntegrationProviderEnum = IntegrationProviderEnum = {}));
|
|
@@ -15,7 +15,6 @@ exports.ConsignmentSchema = zod_1.z.object({
|
|
|
15
15
|
isInStock: zod_1.z.boolean(),
|
|
16
16
|
status: zod_1.z.nativeEnum(enum_1.ConsignmentStatusEnum),
|
|
17
17
|
url: zod_1.z.string().nullable(),
|
|
18
|
-
isWithSync: zod_1.z.boolean(),
|
|
19
18
|
createdAt: zod_1.z.date(),
|
|
20
19
|
updatedAt: zod_1.z.date(),
|
|
21
20
|
deletedAt: zod_1.z.date().nullable(),
|
|
@@ -13,7 +13,6 @@ exports.OrderSchema = zod_1.z.object({
|
|
|
13
13
|
clientUUID: zod_1.z.uuid(),
|
|
14
14
|
branchUUID: zod_1.z.uuid().nullable(),
|
|
15
15
|
creatorUserUUID: zod_1.z.uuid(),
|
|
16
|
-
isSync: zod_1.z.boolean(),
|
|
17
16
|
totalCost: zod_1.z.number(),
|
|
18
17
|
subtotal: zod_1.z.number(),
|
|
19
18
|
deliveryCost: zod_1.z.number(),
|
|
@@ -11,7 +11,6 @@ const discount_rules_schema_1 = require("../discount-rules/discount-rules.schema
|
|
|
11
11
|
const __1 = require("../..");
|
|
12
12
|
exports.ProductSchema = zod_1.z.object({
|
|
13
13
|
uuid: zod_1.z.uuid(),
|
|
14
|
-
dataSyncId: zod_1.z.string().nullable(),
|
|
15
14
|
consignmentUUID: zod_1.z.uuid(),
|
|
16
15
|
categoryUUID: zod_1.z.uuid().nullable(),
|
|
17
16
|
name: zod_1.z.string(),
|
|
@@ -14,6 +14,14 @@ const GetMoyskladStatusResponseSchema = z.object({
|
|
|
14
14
|
nameProcessingConvention: z.nativeEnum(ConsignmentImportNameConventionEnum).nullable(),
|
|
15
15
|
isRemoveSizeFromName: z.boolean(),
|
|
16
16
|
isCutCategoryFromName: z.boolean(),
|
|
17
|
+
lastStockSyncedAt: z.string().datetime().nullable(),
|
|
18
|
+
stockSyncStatus: z.enum(['PENDING', 'RUNNING', 'DEAD', 'IDLE']),
|
|
19
|
+
stockSyncDeadInfo: z
|
|
20
|
+
.object({
|
|
21
|
+
errorCode: z.string(),
|
|
22
|
+
errorMessage: z.string(),
|
|
23
|
+
})
|
|
24
|
+
.nullable(),
|
|
17
25
|
}),
|
|
18
26
|
});
|
|
19
27
|
|
|
@@ -10,3 +10,4 @@ export * from './scan-moysklad-clients-import.query';
|
|
|
10
10
|
export * from './execute-moysklad-clients-import.command';
|
|
11
11
|
export * from './get-order-sync-status.query';
|
|
12
12
|
export * from './get-orders-batch-sync-status.query';
|
|
13
|
+
export * from './sync-moysklad-stock.command';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const SyncMoyskladStockResponseSchema = z.object({
|
|
4
|
+
message: z.string().optional(),
|
|
5
|
+
data: z.object({
|
|
6
|
+
jobUUID: z.string().uuid(),
|
|
7
|
+
status: z.enum(['PENDING', 'RUNNING']),
|
|
8
|
+
wasAlreadyQueued: z.boolean(),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export namespace SyncMoyskladStockContractCommand {
|
|
13
|
+
export const ResponseSchema = SyncMoyskladStockResponseSchema;
|
|
14
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const ConnectOneCResponseSchema = z.object({
|
|
4
|
+
message: z.string().optional(),
|
|
5
|
+
data: z.object({
|
|
6
|
+
username: z.string(),
|
|
7
|
+
password: z.string(),
|
|
8
|
+
}),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export namespace ConnectOneCContractCommand {
|
|
12
|
+
export const ResponseSchema = ConnectOneCResponseSchema;
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const DisconnectOneCResponseSchema = z.object({
|
|
4
|
+
message: z.string().optional(),
|
|
5
|
+
data: z.object({
|
|
6
|
+
success: z.literal(true),
|
|
7
|
+
}),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export namespace DisconnectOneCContractCommand {
|
|
11
|
+
export const ResponseSchema = DisconnectOneCResponseSchema;
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const GetOneCStatusResponseSchema = z.object({
|
|
4
|
+
message: z.string().optional(),
|
|
5
|
+
data: z.object({
|
|
6
|
+
isConnected: z.boolean(),
|
|
7
|
+
isEnabled: z.boolean(),
|
|
8
|
+
username: z.string().nullable(),
|
|
9
|
+
lastCheckauthAt: z.string().datetime().nullable(),
|
|
10
|
+
lastSyncAt: z.string().datetime().nullable(),
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export namespace GetOneCStatusContractQuery {
|
|
15
|
+
export const ResponseSchema = GetOneCStatusResponseSchema;
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const RotateOneCPasswordResponseSchema = z.object({
|
|
4
|
+
message: z.string().optional(),
|
|
5
|
+
data: z.object({
|
|
6
|
+
username: z.string(),
|
|
7
|
+
password: z.string(),
|
|
8
|
+
}),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export namespace RotateOneCPasswordContractCommand {
|
|
12
|
+
export const ResponseSchema = RotateOneCPasswordResponseSchema;
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
+
export const BULK_MOVE_ORDER_PRODUCT_LIMIT = 200;
|
|
4
|
+
|
|
3
5
|
const UpdateGroupOrderProductOrderRequestSchema = z.object({
|
|
4
|
-
orderProductUUIDList: z
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
orderProductUUIDList: z
|
|
7
|
+
.array(
|
|
8
|
+
z.object({
|
|
9
|
+
uuid: z.string(),
|
|
10
|
+
quantity: z.coerce.number().int().positive(),
|
|
11
|
+
}),
|
|
12
|
+
)
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(BULK_MOVE_ORDER_PRODUCT_LIMIT),
|
|
10
15
|
newOrderUUID: z.uuid(),
|
|
11
16
|
isDelete: z.coerce.boolean().optional().default(true),
|
|
12
17
|
isComment: z.coerce.boolean().optional().default(true),
|
package/constant/error.ts
CHANGED
|
@@ -446,6 +446,16 @@ export const ERRORS = {
|
|
|
446
446
|
message: 'Another bulk operation on this order is in progress, retry later',
|
|
447
447
|
httpCode: 409,
|
|
448
448
|
},
|
|
449
|
+
ORDER_PRODUCT_HAS_WRITE_OFF: {
|
|
450
|
+
code: 'OP019',
|
|
451
|
+
message: 'Cannot move order-product: it has a write-off attached',
|
|
452
|
+
httpCode: 400,
|
|
453
|
+
},
|
|
454
|
+
ORDER_MOVE_BULK_OPERATION_IN_PROGRESS: {
|
|
455
|
+
code: 'OP020',
|
|
456
|
+
message: 'Another bulk-move operation on this pair of orders is in progress, retry later',
|
|
457
|
+
httpCode: 409,
|
|
458
|
+
},
|
|
449
459
|
|
|
450
460
|
//TRANSACTION
|
|
451
461
|
TRANSACTION_NOT_CREATED: { code: 'TR001', message: 'Failed to transaction product', httpCode: 500 },
|
|
@@ -1046,7 +1056,11 @@ export const ERRORS = {
|
|
|
1046
1056
|
MOYSKLAD_NOT_CONNECTED: { code: 'MS003', message: 'MoySklad integration is not connected for this company', httpCode: 404 },
|
|
1047
1057
|
MOYSKLAD_API_ERROR: { code: 'MS004', message: 'MoySklad API request failed', httpCode: 502 },
|
|
1048
1058
|
MOYSKLAD_DISCONNECT_FAILED: { code: 'MS005', message: 'Failed to disconnect MoySklad integration', httpCode: 500 },
|
|
1049
|
-
MOYSKLAD_SETTINGS_INVALID: {
|
|
1059
|
+
MOYSKLAD_SETTINGS_INVALID: {
|
|
1060
|
+
code: 'MS006',
|
|
1061
|
+
message: 'Provided organization or store does not belong to the connected MoySklad account',
|
|
1062
|
+
httpCode: 400,
|
|
1063
|
+
},
|
|
1050
1064
|
INTEGRATION_ENC_KEY_NOT_SET: { code: 'MS007', message: 'Integration encryption key is not configured on the server', httpCode: 500 },
|
|
1051
1065
|
MOYSKLAD_IMPORT_IN_PROGRESS: { code: 'MS008', message: 'MoySklad import is already in progress for this company', httpCode: 409 },
|
|
1052
1066
|
MOYSKLAD_CLIENTS_IMPORT_IN_PROGRESS: {
|
|
@@ -1089,4 +1103,26 @@ export const ERRORS = {
|
|
|
1089
1103
|
message: 'Outbound sync entity type is not supported by this provider',
|
|
1090
1104
|
httpCode: 400,
|
|
1091
1105
|
},
|
|
1106
|
+
MOYSKLAD_STOCK_SYNC_CAP_EXCEEDED: {
|
|
1107
|
+
code: 'MS015',
|
|
1108
|
+
message: 'MoySklad stock-sync concurrency cap exceeded; will retry shortly',
|
|
1109
|
+
httpCode: 429,
|
|
1110
|
+
},
|
|
1111
|
+
MOYSKLAD_STOCK_SYNC_LOCK_BUSY: {
|
|
1112
|
+
code: 'MS016',
|
|
1113
|
+
message: 'MoySklad sync lock is held by another job for this company; will retry shortly',
|
|
1114
|
+
httpCode: 409,
|
|
1115
|
+
},
|
|
1116
|
+
MOYSKLAD_INTEGRATION_DISABLED: {
|
|
1117
|
+
code: 'MS017',
|
|
1118
|
+
message: 'MoySklad integration is disabled for this company',
|
|
1119
|
+
httpCode: 409,
|
|
1120
|
+
},
|
|
1121
|
+
|
|
1122
|
+
// 1C COMMERCEML INTEGRATION
|
|
1123
|
+
ONE_C_NOT_CONNECTED: { code: 'OC001', message: '1C integration is not connected for this company', httpCode: 404 },
|
|
1124
|
+
ONE_C_CONNECT_FAILED: { code: 'OC002', message: 'Failed to connect 1C integration', httpCode: 500 },
|
|
1125
|
+
ONE_C_INVALID_CREDENTIALS: { code: 'OC003', message: '1C credentials are invalid', httpCode: 401 },
|
|
1126
|
+
ONE_C_INTEGRATION_DISABLED: { code: 'OC004', message: '1C integration is disabled for this company', httpCode: 409 },
|
|
1127
|
+
ONE_C_SESSION_INVALID: { code: 'OC005', message: '1C session is missing or expired', httpCode: 401 },
|
|
1092
1128
|
} as const;
|
|
@@ -5,6 +5,7 @@ export enum ActionLogTypeEnum {
|
|
|
5
5
|
DELETE_ORDER = 'DELETE_ORDER',
|
|
6
6
|
DELETE_ORDER_ITEM = 'DELETE_ORDER_ITEM',
|
|
7
7
|
UPDATE_ORDER_ITEM = 'UPDATE_ORDER_ITEM',
|
|
8
|
+
MOVE_ORDER_ITEM = 'MOVE_ORDER_ITEM',
|
|
8
9
|
ADD_PAYMENT = 'ADD_PAYMENT',
|
|
9
10
|
DELETE_PAYMENT = 'DELETE_PAYMENT',
|
|
10
11
|
CREATE_PREORDER = 'CREATE_PREORDER',
|
package/package.json
CHANGED