@floristcloud/api-lib 1.2.190 → 1.2.192
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-product/create-manually-pre-order-product-for-standing-order.command.js +0 -1
- package/build/constant/error.js +5 -0
- package/build/enum/pre-order-conversion-warning.enum.js +0 -1
- package/build/schemas/pre-order/pre-order-conversion-allocation.schema.js +4 -1
- package/build/schemas/pre-order/pre-order-conversion-summary-line.schema.js +0 -1
- package/build/schemas/pre-order-product/create-pre-order-product-webshop-request.schema.js +0 -1
- package/build/schemas/pre-order-product/pre-order-product-base.schema.js +0 -1
- package/build/schemas/pre-order-product/pre-order-product-for-client.schema.js +0 -1
- package/build/schemas/pre-order-product/update-pre-order-product-webshop-request.schema.js +0 -1
- package/commands/pre-order-product/create-manually-pre-order-product-for-standing-order.command.ts +0 -1
- package/constant/error.ts +5 -0
- package/enum/pre-order-conversion-warning.enum.ts +0 -1
- package/package.json +1 -1
- package/schemas/pre-order/pre-order-conversion-allocation.schema.ts +8 -1
- package/schemas/pre-order/pre-order-conversion-summary-line.schema.ts +0 -1
- package/schemas/pre-order-product/create-pre-order-product-webshop-request.schema.ts +0 -1
- package/schemas/pre-order-product/pre-order-product-base.schema.ts +0 -1
- package/schemas/pre-order-product/pre-order-product-for-client.schema.ts +0 -1
- package/schemas/pre-order-product/update-pre-order-product-webshop-request.schema.ts +0 -1
|
@@ -5,7 +5,6 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const schemas_1 = require("../../schemas");
|
|
6
6
|
const CreateManuallyPreOrderProductForStandingOrderRequestSchema = schemas_1.CreatePreOrderProductSchema.omit({
|
|
7
7
|
preOrderCollectionItemUUID: true,
|
|
8
|
-
isReplaceable: true,
|
|
9
8
|
isPurchased: true,
|
|
10
9
|
highAttention: true,
|
|
11
10
|
}).extend({
|
package/build/constant/error.js
CHANGED
|
@@ -1777,6 +1777,10 @@ exports.ERRORS = {
|
|
|
1777
1777
|
message: 'Product stock cannot be recomputed: it is not in the 1C sync consignment',
|
|
1778
1778
|
httpCode: 409,
|
|
1779
1779
|
},
|
|
1780
|
+
// Файл обмена больше ONE_C_MAX_EXCHANGE_FILE_BYTES: тело сбрасывается без чтения в память.
|
|
1781
|
+
ONE_C_EXCHANGE_FILE_TOO_LARGE: { code: 'OC024', message: '1C exchange file exceeds the size limit', httpCode: 413 },
|
|
1782
|
+
// Приём каталога выключен на интеграции (CompanyIntegration.isCatalogExchangeEnabled), обмен заказами продолжается.
|
|
1783
|
+
ONE_C_CATALOG_EXCHANGE_DISABLED: { code: 'OC025', message: '1C catalog exchange is disabled for this company', httpCode: 409 },
|
|
1780
1784
|
// COMPANY INTEGRATION (общая запись интеграции компании)
|
|
1781
1785
|
COMPANY_INTEGRATION_FETCH_FAILED: { code: 'CINT001', message: 'Failed to read company integration', httpCode: 500 },
|
|
1782
1786
|
COMPANY_INTEGRATION_NOT_SAVED: { code: 'CINT002', message: 'Failed to save company integration', httpCode: 500 },
|
|
@@ -1787,6 +1791,7 @@ exports.ERRORS = {
|
|
|
1787
1791
|
message: 'The unit is not among the saved units of the company integration',
|
|
1788
1792
|
httpCode: 400,
|
|
1789
1793
|
},
|
|
1794
|
+
INTEGRATION_WAREHOUSES_NOT_SAVED: { code: 'CINT006', message: 'Failed to save integration warehouses', httpCode: 500 },
|
|
1790
1795
|
// OZEXPORT INTEGRATION (FC-513)
|
|
1791
1796
|
OZEXPORT_AUTH_FAILED: { code: 'OZ001', message: 'ozexport rejected the username or password', httpCode: 400 },
|
|
1792
1797
|
OZEXPORT_PARSER_UNAVAILABLE: {
|
|
@@ -4,5 +4,4 @@ exports.PreOrderConversionWarningEnum = void 0;
|
|
|
4
4
|
var PreOrderConversionWarningEnum;
|
|
5
5
|
(function (PreOrderConversionWarningEnum) {
|
|
6
6
|
PreOrderConversionWarningEnum["STOP_PRICE_EXCEEDED"] = "STOP_PRICE_EXCEEDED";
|
|
7
|
-
PreOrderConversionWarningEnum["REPLACEMENT_NOT_ALLOWED"] = "REPLACEMENT_NOT_ALLOWED";
|
|
8
7
|
})(PreOrderConversionWarningEnum || (exports.PreOrderConversionWarningEnum = PreOrderConversionWarningEnum = {}));
|
|
@@ -7,6 +7,9 @@ const zod_1 = require("zod");
|
|
|
7
7
|
const money_schema_1 = require("../money.schema");
|
|
8
8
|
const pre_order_conversion_difference_schema_1 = require("./pre-order-conversion-difference.schema");
|
|
9
9
|
const pre_order_conversion_attributes_schema_1 = require("./pre-order-conversion-attributes.schema");
|
|
10
|
+
// REPLACEMENT_NOT_ALLOWED выведен из оборота вместе с isReplaceable, но лежит в сводках, сохранённых раньше:
|
|
11
|
+
// отбрасываем его при чтении, иначе такая сводка не пройдёт проверку enum и пропадёт целиком.
|
|
12
|
+
const REMOVED_PRE_ORDER_CONVERSION_WARNINGS = ['REPLACEMENT_NOT_ALLOWED'];
|
|
10
13
|
exports.PreOrderConversionAllocationSchema = zod_1.z.object({
|
|
11
14
|
orderUUID: zod_1.z.uuid(),
|
|
12
15
|
orderId: zod_1.z.number().int(),
|
|
@@ -18,6 +21,6 @@ exports.PreOrderConversionAllocationSchema = zod_1.z.object({
|
|
|
18
21
|
multiplicityOptionUUID: zod_1.z.string().nullable(),
|
|
19
22
|
kind: zod_1.z.enum(pre_order_conversion_match_kind_enum_1.PreOrderConversionMatchKindEnum),
|
|
20
23
|
differences: pre_order_conversion_difference_schema_1.PreOrderConversionDifferenceSchema.array(),
|
|
21
|
-
warnings: zod_1.z.enum(pre_order_conversion_warning_enum_1.PreOrderConversionWarningEnum).array(),
|
|
24
|
+
warnings: zod_1.z.preprocess(value => (Array.isArray(value) ? value.filter(warning => !REMOVED_PRE_ORDER_CONVERSION_WARNINGS.includes(warning)) : value), zod_1.z.enum(pre_order_conversion_warning_enum_1.PreOrderConversionWarningEnum).array()),
|
|
22
25
|
product: pre_order_conversion_attributes_schema_1.PreOrderConversionAttributesSchema,
|
|
23
26
|
});
|
|
@@ -11,7 +11,6 @@ exports.PreOrderConversionSummaryLineSchema = zod_1.z.object({
|
|
|
11
11
|
requested: pre_order_conversion_attributes_schema_1.PreOrderConversionAttributesSchema,
|
|
12
12
|
comment: zod_1.z.string().nullable(),
|
|
13
13
|
stopPrice: money_schema_1.MoneySchema.nullable(),
|
|
14
|
-
isReplaceable: zod_1.z.boolean(),
|
|
15
14
|
requestedQuantity: zod_1.z.number().int().nonnegative(),
|
|
16
15
|
allocatedQuantity: zod_1.z.number().int().nonnegative(),
|
|
17
16
|
closedQuantity: zod_1.z.number().int().nonnegative(),
|
|
@@ -10,7 +10,6 @@ exports.CreatePreOrderProductWebshopRequestSchema = zod_1.z.object({
|
|
|
10
10
|
// Целое положительное: ноль и минус уменьшали бы остаток позиции коллекции.
|
|
11
11
|
quantity: zod_1.z.number().int().positive(),
|
|
12
12
|
comment: zod_1.z.string().nullable(),
|
|
13
|
-
isReplaceable: zod_1.z.boolean(),
|
|
14
13
|
stopPrice: money_schema_1.MoneySchema.nullable(),
|
|
15
14
|
highAttention: zod_1.z.boolean(),
|
|
16
15
|
});
|
|
@@ -13,7 +13,6 @@ exports.PreOrderProductSchema = zod_1.z.object({
|
|
|
13
13
|
comment: zod_1.z.string().nullable(),
|
|
14
14
|
tag: zod_1.z.string().nullable(),
|
|
15
15
|
isPurchased: zod_1.z.boolean(),
|
|
16
|
-
isReplaceable: zod_1.z.boolean(),
|
|
17
16
|
stopPrice: money_schema_1.MoneySchema.nullable(),
|
|
18
17
|
highAttention: zod_1.z.boolean(),
|
|
19
18
|
categoryUUID: zod_1.z.string().nullable(),
|
|
@@ -11,7 +11,6 @@ exports.PreOrderProductForClientSchema = zod_1.z.object({
|
|
|
11
11
|
quantity: zod_1.z.number(),
|
|
12
12
|
comment: zod_1.z.string().nullable(),
|
|
13
13
|
tag: zod_1.z.string().nullable(),
|
|
14
|
-
isReplaceable: zod_1.z.boolean(),
|
|
15
14
|
stopPrice: money_schema_1.MoneySchema.nullable(),
|
|
16
15
|
highAttention: zod_1.z.boolean(),
|
|
17
16
|
categoryUUID: zod_1.z.string().nullable(),
|
|
@@ -9,7 +9,6 @@ exports.UpdatePreOrderProductWebshopRequestSchema = zod_1.z
|
|
|
9
9
|
multiplicityOptionUUID: zod_1.z.uuid().nullable().optional(),
|
|
10
10
|
quantity: zod_1.z.number().int().positive(),
|
|
11
11
|
comment: zod_1.z.string().nullable(),
|
|
12
|
-
isReplaceable: zod_1.z.boolean(),
|
|
13
12
|
stopPrice: money_schema_1.MoneySchema.nullable(),
|
|
14
13
|
highAttention: zod_1.z.boolean(),
|
|
15
14
|
})
|
package/commands/pre-order-product/create-manually-pre-order-product-for-standing-order.command.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { PreOrderProductSchema, CreatePreOrderProductSchema } from '../../schema
|
|
|
3
3
|
|
|
4
4
|
const CreateManuallyPreOrderProductForStandingOrderRequestSchema = CreatePreOrderProductSchema.omit({
|
|
5
5
|
preOrderCollectionItemUUID: true,
|
|
6
|
-
isReplaceable: true,
|
|
7
6
|
isPurchased: true,
|
|
8
7
|
highAttention: true,
|
|
9
8
|
}).extend({
|
package/constant/error.ts
CHANGED
|
@@ -1846,6 +1846,10 @@ export const ERRORS = {
|
|
|
1846
1846
|
message: 'Product stock cannot be recomputed: it is not in the 1C sync consignment',
|
|
1847
1847
|
httpCode: 409,
|
|
1848
1848
|
},
|
|
1849
|
+
// Файл обмена больше ONE_C_MAX_EXCHANGE_FILE_BYTES: тело сбрасывается без чтения в память.
|
|
1850
|
+
ONE_C_EXCHANGE_FILE_TOO_LARGE: { code: 'OC024', message: '1C exchange file exceeds the size limit', httpCode: 413 },
|
|
1851
|
+
// Приём каталога выключен на интеграции (CompanyIntegration.isCatalogExchangeEnabled), обмен заказами продолжается.
|
|
1852
|
+
ONE_C_CATALOG_EXCHANGE_DISABLED: { code: 'OC025', message: '1C catalog exchange is disabled for this company', httpCode: 409 },
|
|
1849
1853
|
|
|
1850
1854
|
// COMPANY INTEGRATION (общая запись интеграции компании)
|
|
1851
1855
|
COMPANY_INTEGRATION_FETCH_FAILED: { code: 'CINT001', message: 'Failed to read company integration', httpCode: 500 },
|
|
@@ -1857,6 +1861,7 @@ export const ERRORS = {
|
|
|
1857
1861
|
message: 'The unit is not among the saved units of the company integration',
|
|
1858
1862
|
httpCode: 400,
|
|
1859
1863
|
},
|
|
1864
|
+
INTEGRATION_WAREHOUSES_NOT_SAVED: { code: 'CINT006', message: 'Failed to save integration warehouses', httpCode: 500 },
|
|
1860
1865
|
|
|
1861
1866
|
// OZEXPORT INTEGRATION (FC-513)
|
|
1862
1867
|
OZEXPORT_AUTH_FAILED: { code: 'OZ001', message: 'ozexport rejected the username or password', httpCode: 400 },
|
package/package.json
CHANGED
|
@@ -5,6 +5,10 @@ import { MoneySchema } from '../money.schema';
|
|
|
5
5
|
import { PreOrderConversionDifferenceSchema } from './pre-order-conversion-difference.schema';
|
|
6
6
|
import { PreOrderConversionAttributesSchema } from './pre-order-conversion-attributes.schema';
|
|
7
7
|
|
|
8
|
+
// REPLACEMENT_NOT_ALLOWED выведен из оборота вместе с isReplaceable, но лежит в сводках, сохранённых раньше:
|
|
9
|
+
// отбрасываем его при чтении, иначе такая сводка не пройдёт проверку enum и пропадёт целиком.
|
|
10
|
+
const REMOVED_PRE_ORDER_CONVERSION_WARNINGS: readonly unknown[] = ['REPLACEMENT_NOT_ALLOWED'];
|
|
11
|
+
|
|
8
12
|
export const PreOrderConversionAllocationSchema = z.object({
|
|
9
13
|
orderUUID: z.uuid(),
|
|
10
14
|
orderId: z.number().int(),
|
|
@@ -16,6 +20,9 @@ export const PreOrderConversionAllocationSchema = z.object({
|
|
|
16
20
|
multiplicityOptionUUID: z.string().nullable(),
|
|
17
21
|
kind: z.enum(PreOrderConversionMatchKindEnum),
|
|
18
22
|
differences: PreOrderConversionDifferenceSchema.array(),
|
|
19
|
-
warnings: z.
|
|
23
|
+
warnings: z.preprocess(
|
|
24
|
+
value => (Array.isArray(value) ? value.filter(warning => !REMOVED_PRE_ORDER_CONVERSION_WARNINGS.includes(warning)) : value),
|
|
25
|
+
z.enum(PreOrderConversionWarningEnum).array(),
|
|
26
|
+
),
|
|
20
27
|
product: PreOrderConversionAttributesSchema,
|
|
21
28
|
});
|
|
@@ -9,7 +9,6 @@ export const PreOrderConversionSummaryLineSchema = z.object({
|
|
|
9
9
|
requested: PreOrderConversionAttributesSchema,
|
|
10
10
|
comment: z.string().nullable(),
|
|
11
11
|
stopPrice: MoneySchema.nullable(),
|
|
12
|
-
isReplaceable: z.boolean(),
|
|
13
12
|
requestedQuantity: z.number().int().nonnegative(),
|
|
14
13
|
allocatedQuantity: z.number().int().nonnegative(),
|
|
15
14
|
closedQuantity: z.number().int().nonnegative(),
|
|
@@ -8,7 +8,6 @@ export const CreatePreOrderProductWebshopRequestSchema = z.object({
|
|
|
8
8
|
// Целое положительное: ноль и минус уменьшали бы остаток позиции коллекции.
|
|
9
9
|
quantity: z.number().int().positive(),
|
|
10
10
|
comment: z.string().nullable(),
|
|
11
|
-
isReplaceable: z.boolean(),
|
|
12
11
|
stopPrice: MoneySchema.nullable(),
|
|
13
12
|
highAttention: z.boolean(),
|
|
14
13
|
});
|
|
@@ -11,7 +11,6 @@ export const PreOrderProductSchema = z.object({
|
|
|
11
11
|
comment: z.string().nullable(),
|
|
12
12
|
tag: z.string().nullable(),
|
|
13
13
|
isPurchased: z.boolean(),
|
|
14
|
-
isReplaceable: z.boolean(),
|
|
15
14
|
stopPrice: MoneySchema.nullable(),
|
|
16
15
|
highAttention: z.boolean(),
|
|
17
16
|
categoryUUID: z.string().nullable(),
|
|
@@ -9,7 +9,6 @@ export const PreOrderProductForClientSchema = z.object({
|
|
|
9
9
|
quantity: z.number(),
|
|
10
10
|
comment: z.string().nullable(),
|
|
11
11
|
tag: z.string().nullable(),
|
|
12
|
-
isReplaceable: z.boolean(),
|
|
13
12
|
stopPrice: MoneySchema.nullable(),
|
|
14
13
|
highAttention: z.boolean(),
|
|
15
14
|
categoryUUID: z.string().nullable(),
|
|
@@ -7,7 +7,6 @@ export const UpdatePreOrderProductWebshopRequestSchema = z
|
|
|
7
7
|
multiplicityOptionUUID: z.uuid().nullable().optional(),
|
|
8
8
|
quantity: z.number().int().positive(),
|
|
9
9
|
comment: z.string().nullable(),
|
|
10
|
-
isReplaceable: z.boolean(),
|
|
11
10
|
stopPrice: MoneySchema.nullable(),
|
|
12
11
|
highAttention: z.boolean(),
|
|
13
12
|
})
|