@floristcloud/api-lib 1.2.199 → 1.2.200

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.
Files changed (21) hide show
  1. package/build/commands/integration/one-c/get-one-c-orders-sync-status.query.js +10 -0
  2. package/build/commands/integration/one-c/index.js +2 -0
  3. package/build/commands/integration/one-c/retry-one-c-order-deletion.command.js +8 -0
  4. package/build/constant/error.js +2 -0
  5. package/build/schemas/integration/one-c/get-one-c-orders-sync-status-request.schema.js +7 -0
  6. package/build/schemas/integration/one-c/get-one-c-orders-sync-status-response.schema.js +11 -0
  7. package/build/schemas/integration/one-c/index.js +4 -0
  8. package/build/schemas/integration/one-c/one-c-order-exchange-state.schema.js +8 -0
  9. package/build/schemas/integration/one-c/one-c-order-sync-status.schema.js +11 -0
  10. package/build/schemas/integration/one-c/retry-one-c-order-deletion-response.schema.js +10 -0
  11. package/commands/integration/one-c/get-one-c-orders-sync-status.query.ts +11 -0
  12. package/commands/integration/one-c/index.ts +2 -0
  13. package/commands/integration/one-c/retry-one-c-order-deletion.command.ts +7 -0
  14. package/constant/error.ts +2 -0
  15. package/package.json +1 -1
  16. package/schemas/integration/one-c/get-one-c-orders-sync-status-request.schema.ts +5 -0
  17. package/schemas/integration/one-c/get-one-c-orders-sync-status-response.schema.ts +9 -0
  18. package/schemas/integration/one-c/index.ts +4 -0
  19. package/schemas/integration/one-c/one-c-order-exchange-state.schema.ts +8 -0
  20. package/schemas/integration/one-c/one-c-order-sync-status.schema.ts +9 -0
  21. package/schemas/integration/one-c/retry-one-c-order-deletion-response.schema.ts +8 -0
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetOneCOrdersSyncStatusContractQuery = void 0;
4
+ const get_one_c_orders_sync_status_request_schema_1 = require("../../../schemas/integration/one-c/get-one-c-orders-sync-status-request.schema");
5
+ const get_one_c_orders_sync_status_response_schema_1 = require("../../../schemas/integration/one-c/get-one-c-orders-sync-status-response.schema");
6
+ var GetOneCOrdersSyncStatusContractQuery;
7
+ (function (GetOneCOrdersSyncStatusContractQuery) {
8
+ GetOneCOrdersSyncStatusContractQuery.RequestSchema = get_one_c_orders_sync_status_request_schema_1.GetOneCOrdersSyncStatusRequestSchema;
9
+ GetOneCOrdersSyncStatusContractQuery.ResponseSchema = get_one_c_orders_sync_status_response_schema_1.GetOneCOrdersSyncStatusResponseSchema;
10
+ })(GetOneCOrdersSyncStatusContractQuery || (exports.GetOneCOrdersSyncStatusContractQuery = GetOneCOrdersSyncStatusContractQuery = {}));
@@ -19,6 +19,8 @@ __exportStar(require("./rotate-one-c-password.command"), exports);
19
19
  __exportStar(require("./disconnect-one-c.command"), exports);
20
20
  __exportStar(require("./get-one-c-status.query"), exports);
21
21
  __exportStar(require("./get-one-c-order-exchange-state.query"), exports);
22
+ __exportStar(require("./get-one-c-orders-sync-status.query"), exports);
23
+ __exportStar(require("./retry-one-c-order-deletion.command"), exports);
22
24
  __exportStar(require("./get-one-c-stock-conflict-list.query"), exports);
23
25
  __exportStar(require("./get-one-c-stock-conflict-preview.query"), exports);
24
26
  __exportStar(require("./resolve-one-c-stock-conflict.command"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RetryOneCOrderDeletionContractCommand = void 0;
4
+ const retry_one_c_order_deletion_response_schema_1 = require("../../../schemas/integration/one-c/retry-one-c-order-deletion-response.schema");
5
+ var RetryOneCOrderDeletionContractCommand;
6
+ (function (RetryOneCOrderDeletionContractCommand) {
7
+ RetryOneCOrderDeletionContractCommand.ResponseSchema = retry_one_c_order_deletion_response_schema_1.RetryOneCOrderDeletionResponseSchema;
8
+ })(RetryOneCOrderDeletionContractCommand || (exports.RetryOneCOrderDeletionContractCommand = RetryOneCOrderDeletionContractCommand = {}));
@@ -1823,6 +1823,8 @@ exports.ERRORS = {
1823
1823
  },
1824
1824
  ONE_C_ORDER_APPLY_EMPTY: { code: 'OC031', message: '1C order contains no lines', httpCode: 422 },
1825
1825
  ONE_C_ORDER_APPLY_MIXED_PRICES: { code: 'OC032', message: '1C order contains one product at different prices', httpCode: 422 },
1826
+ ONE_C_ORDER_MANAGED_BY_ONE_C: { code: 'OC033', message: 'The order is managed by 1C and cannot be changed', httpCode: 409 },
1827
+ ONE_C_ORDER_DELETION_NOT_REQUESTED: { code: 'OC034', message: 'The order has no deletion request from 1C', httpCode: 409 },
1826
1828
  // COMPANY INTEGRATION (общая запись интеграции компании)
1827
1829
  COMPANY_INTEGRATION_FETCH_FAILED: { code: 'CINT001', message: 'Failed to read company integration', httpCode: 500 },
1828
1830
  COMPANY_INTEGRATION_NOT_SAVED: { code: 'CINT002', message: 'Failed to save company integration', httpCode: 500 },
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetOneCOrdersSyncStatusRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.GetOneCOrdersSyncStatusRequestSchema = zod_1.z.object({
6
+ orderUUIDs: zod_1.z.array(zod_1.z.string().uuid()).min(1).max(200),
7
+ });
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetOneCOrdersSyncStatusResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const one_c_order_sync_status_schema_1 = require("./one-c-order-sync-status.schema");
6
+ exports.GetOneCOrdersSyncStatusResponseSchema = zod_1.z.object({
7
+ message: zod_1.z.string().optional(),
8
+ data: zod_1.z.object({
9
+ statuses: zod_1.z.array(one_c_order_sync_status_schema_1.OneCOrderSyncStatusSchema),
10
+ }),
11
+ });
@@ -32,3 +32,7 @@ __exportStar(require("./update-one-c-settings-request.schema"), exports);
32
32
  __exportStar(require("./update-one-c-settings-response.schema"), exports);
33
33
  __exportStar(require("./one-c-order-exchange-state.schema"), exports);
34
34
  __exportStar(require("./get-one-c-order-exchange-state-response.schema"), exports);
35
+ __exportStar(require("./get-one-c-orders-sync-status-request.schema"), exports);
36
+ __exportStar(require("./get-one-c-orders-sync-status-response.schema"), exports);
37
+ __exportStar(require("./one-c-order-sync-status.schema"), exports);
38
+ __exportStar(require("./retry-one-c-order-deletion-response.schema"), exports);
@@ -32,4 +32,12 @@ exports.OneCOrderExchangeStateSchema = zod_1.z.object({
32
32
  // Последнее применение состава из 1С не прошло (режим ONE_C): код ошибки и когда.
33
33
  applyErrorCode: zod_1.z.string().nullable(),
34
34
  applyErrorAt: zod_1.z.string().datetime().nullable(),
35
+ // 1С ведёт заказ и отправка подтверждена: заказ в FC не редактируется.
36
+ isEditLocked: zod_1.z.boolean(),
37
+ // Документ снят в 1С (пометка удаления или отмена), заказ ждёт удаления в FC.
38
+ deletionRequestedAt: zod_1.z.string().datetime().nullable(),
39
+ // Удаление не прошло: код причины и номер счёта или УПД, если причина в них.
40
+ deletionErrorCode: zod_1.z.string().nullable(),
41
+ deletionErrorDetail: zod_1.z.string().nullable(),
42
+ deletionErrorAt: zod_1.z.string().datetime().nullable(),
35
43
  });
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OneCOrderSyncStatusSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ // Заказ с ошибкой синхронизации с 1С: удаление по сигналу из 1С не прошло.
6
+ exports.OneCOrderSyncStatusSchema = zod_1.z.object({
7
+ orderUUID: zod_1.z.string().uuid(),
8
+ deletionErrorCode: zod_1.z.string(),
9
+ // Номер счёта или УПД, если причина в них.
10
+ deletionErrorDetail: zod_1.z.string().nullable(),
11
+ });
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RetryOneCOrderDeletionResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.RetryOneCOrderDeletionResponseSchema = zod_1.z.object({
6
+ message: zod_1.z.string().optional(),
7
+ data: zod_1.z.object({
8
+ success: zod_1.z.boolean(),
9
+ }),
10
+ });
@@ -0,0 +1,11 @@
1
+ import type { z } from 'zod';
2
+ import { GetOneCOrdersSyncStatusRequestSchema } from '../../../schemas/integration/one-c/get-one-c-orders-sync-status-request.schema';
3
+ import { GetOneCOrdersSyncStatusResponseSchema } from '../../../schemas/integration/one-c/get-one-c-orders-sync-status-response.schema';
4
+
5
+ export namespace GetOneCOrdersSyncStatusContractQuery {
6
+ export const RequestSchema = GetOneCOrdersSyncStatusRequestSchema;
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
9
+ export const ResponseSchema = GetOneCOrdersSyncStatusResponseSchema;
10
+ export type Response = z.infer<typeof ResponseSchema>;
11
+ }
@@ -3,6 +3,8 @@ export * from './rotate-one-c-password.command';
3
3
  export * from './disconnect-one-c.command';
4
4
  export * from './get-one-c-status.query';
5
5
  export * from './get-one-c-order-exchange-state.query';
6
+ export * from './get-one-c-orders-sync-status.query';
7
+ export * from './retry-one-c-order-deletion.command';
6
8
  export * from './get-one-c-stock-conflict-list.query';
7
9
  export * from './get-one-c-stock-conflict-preview.query';
8
10
  export * from './resolve-one-c-stock-conflict.command';
@@ -0,0 +1,7 @@
1
+ import type { z } from 'zod';
2
+ import { RetryOneCOrderDeletionResponseSchema } from '../../../schemas/integration/one-c/retry-one-c-order-deletion-response.schema';
3
+
4
+ export namespace RetryOneCOrderDeletionContractCommand {
5
+ export const ResponseSchema = RetryOneCOrderDeletionResponseSchema;
6
+ export type Response = z.infer<typeof ResponseSchema>;
7
+ }
package/constant/error.ts CHANGED
@@ -1895,6 +1895,8 @@ export const ERRORS = {
1895
1895
  },
1896
1896
  ONE_C_ORDER_APPLY_EMPTY: { code: 'OC031', message: '1C order contains no lines', httpCode: 422 },
1897
1897
  ONE_C_ORDER_APPLY_MIXED_PRICES: { code: 'OC032', message: '1C order contains one product at different prices', httpCode: 422 },
1898
+ ONE_C_ORDER_MANAGED_BY_ONE_C: { code: 'OC033', message: 'The order is managed by 1C and cannot be changed', httpCode: 409 },
1899
+ ONE_C_ORDER_DELETION_NOT_REQUESTED: { code: 'OC034', message: 'The order has no deletion request from 1C', httpCode: 409 },
1898
1900
 
1899
1901
  // COMPANY INTEGRATION (общая запись интеграции компании)
1900
1902
  COMPANY_INTEGRATION_FETCH_FAILED: { code: 'CINT001', message: 'Failed to read company integration', httpCode: 500 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.199",
3
+ "version": "1.2.200",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+
3
+ export const GetOneCOrdersSyncStatusRequestSchema = z.object({
4
+ orderUUIDs: z.array(z.string().uuid()).min(1).max(200),
5
+ });
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ import { OneCOrderSyncStatusSchema } from './one-c-order-sync-status.schema';
3
+
4
+ export const GetOneCOrdersSyncStatusResponseSchema = z.object({
5
+ message: z.string().optional(),
6
+ data: z.object({
7
+ statuses: z.array(OneCOrderSyncStatusSchema),
8
+ }),
9
+ });
@@ -16,3 +16,7 @@ export * from './update-one-c-settings-request.schema';
16
16
  export * from './update-one-c-settings-response.schema';
17
17
  export * from './one-c-order-exchange-state.schema';
18
18
  export * from './get-one-c-order-exchange-state-response.schema';
19
+ export * from './get-one-c-orders-sync-status-request.schema';
20
+ export * from './get-one-c-orders-sync-status-response.schema';
21
+ export * from './one-c-order-sync-status.schema';
22
+ export * from './retry-one-c-order-deletion-response.schema';
@@ -31,4 +31,12 @@ export const OneCOrderExchangeStateSchema = z.object({
31
31
  // Последнее применение состава из 1С не прошло (режим ONE_C): код ошибки и когда.
32
32
  applyErrorCode: z.string().nullable(),
33
33
  applyErrorAt: z.string().datetime().nullable(),
34
+ // 1С ведёт заказ и отправка подтверждена: заказ в FC не редактируется.
35
+ isEditLocked: z.boolean(),
36
+ // Документ снят в 1С (пометка удаления или отмена), заказ ждёт удаления в FC.
37
+ deletionRequestedAt: z.string().datetime().nullable(),
38
+ // Удаление не прошло: код причины и номер счёта или УПД, если причина в них.
39
+ deletionErrorCode: z.string().nullable(),
40
+ deletionErrorDetail: z.string().nullable(),
41
+ deletionErrorAt: z.string().datetime().nullable(),
34
42
  });
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+
3
+ // Заказ с ошибкой синхронизации с 1С: удаление по сигналу из 1С не прошло.
4
+ export const OneCOrderSyncStatusSchema = z.object({
5
+ orderUUID: z.string().uuid(),
6
+ deletionErrorCode: z.string(),
7
+ // Номер счёта или УПД, если причина в них.
8
+ deletionErrorDetail: z.string().nullable(),
9
+ });
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+
3
+ export const RetryOneCOrderDeletionResponseSchema = z.object({
4
+ message: z.string().optional(),
5
+ data: z.object({
6
+ success: z.boolean(),
7
+ }),
8
+ });