@floristcloud/api-lib 1.2.227 → 1.2.228
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/moysklad/get-moysklad-money-account-links.query.js +8 -0
- package/build/commands/integration/moysklad/get-moysklad-payment-sync-check.query.js +10 -0
- package/build/commands/integration/moysklad/index.js +4 -0
- package/build/commands/integration/moysklad/list-moysklad-money-targets.query.js +8 -0
- package/build/commands/integration/moysklad/save-moysklad-money-account-link.command.js +10 -0
- package/build/commands/order/get-order-list.query.js +4 -70
- package/build/constant/client-registration.constant.js +11 -0
- package/build/constant/error.js +30 -0
- package/build/constant/index.js +2 -0
- package/build/constant/write-off-image.constant.js +11 -0
- package/build/enum/external-entity-type.enum.js +1 -0
- package/build/enum/index.js +2 -0
- package/build/enum/money-account-integration-link-kind.enum.js +9 -0
- package/build/enum/notification-type.enum.js +3 -0
- package/build/enum/order-source.enum.js +9 -0
- package/build/enum/payment-invoice-file-deletion-status.enum.js +9 -0
- package/build/schemas/client/register-client-webshop-request.schema.js +5 -4
- package/build/schemas/integration/moysklad/enable-moysklad-request.schema.js +2 -0
- package/build/schemas/integration/moysklad/index.js +9 -0
- package/build/schemas/integration/moysklad/moysklad-money-account-link.schema.js +11 -0
- package/build/schemas/integration/moysklad/moysklad-money-account-links-response.schema.js +6 -0
- package/build/schemas/integration/moysklad/moysklad-money-target-ref.schema.js +17 -0
- package/build/schemas/integration/moysklad/moysklad-money-target.schema.js +14 -0
- package/build/schemas/integration/moysklad/moysklad-money-targets-response.schema.js +6 -0
- package/build/schemas/integration/moysklad/moysklad-payment-sync-check-request.schema.js +8 -0
- package/build/schemas/integration/moysklad/moysklad-payment-sync-check-response.schema.js +6 -0
- package/build/schemas/integration/moysklad/moysklad-payment-sync-check.schema.js +10 -0
- package/build/schemas/integration/moysklad/moysklad-status.schema.js +1 -0
- package/build/schemas/integration/moysklad/save-moysklad-money-account-link-request.schema.js +10 -0
- package/build/schemas/order/get-order-list-request.schema.js +67 -0
- package/build/schemas/order/get-order-list-response-data.schema.js +6 -0
- package/build/schemas/order/get-order-list-response.schema.js +6 -0
- package/build/schemas/order/index.js +4 -0
- package/build/schemas/order/order-creator.schema.js +5 -0
- package/build/schemas/order/order-extended.schema.js +4 -0
- package/build/schemas/pre-order/get-pre-order-list-request.schema.js +2 -0
- package/build/schemas/pre-order/pre-order.schema.js +4 -0
- package/build/schemas/write-off/write-off-image.schema.js +4 -0
- package/commands/integration/moysklad/get-moysklad-money-account-links.query.ts +7 -0
- package/commands/integration/moysklad/get-moysklad-payment-sync-check.query.ts +10 -0
- package/commands/integration/moysklad/index.ts +5 -0
- package/commands/integration/moysklad/list-moysklad-money-targets.query.ts +7 -0
- package/commands/integration/moysklad/save-moysklad-money-account-link.command.ts +10 -0
- package/commands/order/get-order-list.query.ts +3 -76
- package/constant/client-registration.constant.ts +8 -0
- package/constant/error.ts +30 -0
- package/constant/index.ts +2 -0
- package/constant/write-off-image.constant.ts +8 -0
- package/enum/external-entity-type.enum.ts +1 -0
- package/enum/index.ts +3 -0
- package/enum/money-account-integration-link-kind.enum.ts +5 -0
- package/enum/notification-type.enum.ts +3 -0
- package/enum/order-source.enum.ts +8 -0
- package/enum/payment-invoice-file-deletion-status.enum.ts +5 -0
- package/package.json +1 -1
- package/schemas/client/register-client-webshop-request.schema.ts +10 -4
- package/schemas/integration/moysklad/enable-moysklad-request.schema.ts +2 -0
- package/schemas/integration/moysklad/index.ts +10 -0
- package/schemas/integration/moysklad/moysklad-money-account-link.schema.ts +9 -0
- package/schemas/integration/moysklad/moysklad-money-account-links-response.schema.ts +4 -0
- package/schemas/integration/moysklad/moysklad-money-target-ref.schema.ts +15 -0
- package/schemas/integration/moysklad/moysklad-money-target.schema.ts +12 -0
- package/schemas/integration/moysklad/moysklad-money-targets-response.schema.ts +4 -0
- package/schemas/integration/moysklad/moysklad-payment-sync-check-request.schema.ts +6 -0
- package/schemas/integration/moysklad/moysklad-payment-sync-check-response.schema.ts +4 -0
- package/schemas/integration/moysklad/moysklad-payment-sync-check.schema.ts +8 -0
- package/schemas/integration/moysklad/moysklad-status.schema.ts +1 -0
- package/schemas/integration/moysklad/save-moysklad-money-account-link-request.schema.ts +8 -0
- package/schemas/order/get-order-list-request.schema.ts +71 -0
- package/schemas/order/get-order-list-response-data.schema.ts +3 -0
- package/schemas/order/get-order-list-response.schema.ts +3 -0
- package/schemas/order/index.ts +8 -0
- package/schemas/order/order-creator.schema.ts +2 -0
- package/schemas/order/order-extended.schema.ts +4 -0
- package/schemas/pre-order/get-pre-order-list-request.schema.ts +2 -0
- package/schemas/pre-order/pre-order.schema.ts +4 -0
- package/schemas/write-off/write-off-image.schema.ts +4 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetMoyskladMoneyAccountLinksContractQuery = void 0;
|
|
4
|
+
const moysklad_money_account_links_response_schema_1 = require("../../../schemas/integration/moysklad/moysklad-money-account-links-response.schema");
|
|
5
|
+
var GetMoyskladMoneyAccountLinksContractQuery;
|
|
6
|
+
(function (GetMoyskladMoneyAccountLinksContractQuery) {
|
|
7
|
+
GetMoyskladMoneyAccountLinksContractQuery.ResponseSchema = moysklad_money_account_links_response_schema_1.MoyskladMoneyAccountLinksResponseSchema;
|
|
8
|
+
})(GetMoyskladMoneyAccountLinksContractQuery || (exports.GetMoyskladMoneyAccountLinksContractQuery = GetMoyskladMoneyAccountLinksContractQuery = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetMoyskladPaymentSyncCheckContractQuery = void 0;
|
|
4
|
+
const moysklad_payment_sync_check_request_schema_1 = require("../../../schemas/integration/moysklad/moysklad-payment-sync-check-request.schema");
|
|
5
|
+
const moysklad_payment_sync_check_response_schema_1 = require("../../../schemas/integration/moysklad/moysklad-payment-sync-check-response.schema");
|
|
6
|
+
var GetMoyskladPaymentSyncCheckContractQuery;
|
|
7
|
+
(function (GetMoyskladPaymentSyncCheckContractQuery) {
|
|
8
|
+
GetMoyskladPaymentSyncCheckContractQuery.RequestSchema = moysklad_payment_sync_check_request_schema_1.MoyskladPaymentSyncCheckRequestSchema;
|
|
9
|
+
GetMoyskladPaymentSyncCheckContractQuery.ResponseSchema = moysklad_payment_sync_check_response_schema_1.MoyskladPaymentSyncCheckResponseSchema;
|
|
10
|
+
})(GetMoyskladPaymentSyncCheckContractQuery || (exports.GetMoyskladPaymentSyncCheckContractQuery = GetMoyskladPaymentSyncCheckContractQuery = {}));
|
|
@@ -33,3 +33,7 @@ __exportStar(require("./get-moysklad-order-states.query"), exports);
|
|
|
33
33
|
__exportStar(require("./update-moysklad-order-state-mapping.command"), exports);
|
|
34
34
|
__exportStar(require("./get-seller-sync-status.query"), exports);
|
|
35
35
|
__exportStar(require("./retry-seller-sync.command"), exports);
|
|
36
|
+
__exportStar(require("./list-moysklad-money-targets.query"), exports);
|
|
37
|
+
__exportStar(require("./get-moysklad-money-account-links.query"), exports);
|
|
38
|
+
__exportStar(require("./save-moysklad-money-account-link.command"), exports);
|
|
39
|
+
__exportStar(require("./get-moysklad-payment-sync-check.query"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListMoyskladMoneyTargetsContractQuery = void 0;
|
|
4
|
+
const moysklad_money_targets_response_schema_1 = require("../../../schemas/integration/moysklad/moysklad-money-targets-response.schema");
|
|
5
|
+
var ListMoyskladMoneyTargetsContractQuery;
|
|
6
|
+
(function (ListMoyskladMoneyTargetsContractQuery) {
|
|
7
|
+
ListMoyskladMoneyTargetsContractQuery.ResponseSchema = moysklad_money_targets_response_schema_1.MoyskladMoneyTargetsResponseSchema;
|
|
8
|
+
})(ListMoyskladMoneyTargetsContractQuery || (exports.ListMoyskladMoneyTargetsContractQuery = ListMoyskladMoneyTargetsContractQuery = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SaveMoyskladMoneyAccountLinkContractCommand = void 0;
|
|
4
|
+
const moysklad_money_account_links_response_schema_1 = require("../../../schemas/integration/moysklad/moysklad-money-account-links-response.schema");
|
|
5
|
+
const save_moysklad_money_account_link_request_schema_1 = require("../../../schemas/integration/moysklad/save-moysklad-money-account-link-request.schema");
|
|
6
|
+
var SaveMoyskladMoneyAccountLinkContractCommand;
|
|
7
|
+
(function (SaveMoyskladMoneyAccountLinkContractCommand) {
|
|
8
|
+
SaveMoyskladMoneyAccountLinkContractCommand.RequestSchema = save_moysklad_money_account_link_request_schema_1.SaveMoyskladMoneyAccountLinkRequestSchema;
|
|
9
|
+
SaveMoyskladMoneyAccountLinkContractCommand.ResponseSchema = moysklad_money_account_links_response_schema_1.MoyskladMoneyAccountLinksResponseSchema;
|
|
10
|
+
})(SaveMoyskladMoneyAccountLinkContractCommand || (exports.SaveMoyskladMoneyAccountLinkContractCommand = SaveMoyskladMoneyAccountLinkContractCommand = {}));
|
|
@@ -1,76 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetOrderListContractQuery = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const date_helper_1 = require("../../helpers/date.helper");
|
|
7
|
-
const query_boolean_helper_1 = require("../../helpers/query-boolean.helper");
|
|
8
|
-
const enum_1 = require("../../enum");
|
|
9
|
-
const GetOrderListRequestSchema = zod_1.z
|
|
10
|
-
.object({
|
|
11
|
-
page: zod_1.z.string().transform(val => Number(val) || 1),
|
|
12
|
-
count: zod_1.z.string().transform(val => Number(val) || 10),
|
|
13
|
-
startDate: zod_1.z.coerce.date().optional(),
|
|
14
|
-
endDate: zod_1.z.coerce.date().optional(),
|
|
15
|
-
isDelivery: zod_1.z.coerce.boolean().optional(),
|
|
16
|
-
isPaid: zod_1.z.coerce.boolean().optional(),
|
|
17
|
-
consignmentUUID: zod_1.z.string().optional(),
|
|
18
|
-
tag: zod_1.z.string().optional(),
|
|
19
|
-
clientUUID: zod_1.z.string().optional(),
|
|
20
|
-
searchQuery: zod_1.z.string().optional(),
|
|
21
|
-
consignmentDeliveryDate: zod_1.z.coerce.date().optional(),
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated Используйте `deliveryDateFrom` / `deliveryDateTo`. Оставлен ради сохранённых
|
|
24
|
-
* ссылок и MCP-клиентов: трактуется как период из одного дня (from = to = deliveryDate).
|
|
25
|
-
*/
|
|
26
|
-
deliveryDate: zod_1.z.coerce.date().optional(),
|
|
27
|
-
// Период даты отгрузки/выдачи заказа (`plannedShipmentDate`) — и доставка, и самовывоз; имена
|
|
28
|
-
// остались от фильтра по дате доставки. Календарные дни `YYYY-MM-DD`, обе границы включительно.
|
|
29
|
-
deliveryDateFrom: zod_1.z.coerce.date().optional(),
|
|
30
|
-
deliveryDateTo: zod_1.z.coerce.date().optional(),
|
|
31
|
-
byProductSearchQuery: zod_1.z.string().optional(),
|
|
32
|
-
statuses: zod_1.z.nativeEnum(enum_1.OrderStatusEnum).array().optional(),
|
|
33
|
-
type: zod_1.z.nativeEnum(enum_1.OrderTypeEnum).optional(),
|
|
34
|
-
city: zod_1.z.string().optional(),
|
|
35
|
-
responsibleUserUUID: zod_1.z.string().optional(),
|
|
36
|
-
group: zod_1.z.string().optional(),
|
|
37
|
-
// Только заказы, ещё не включённые ни в один счёт на оплату — список для пикера при
|
|
38
|
-
// выставлении счёта. Комбинируется с остальными критериями обычным AND.
|
|
39
|
-
withoutPaymentInvoice: zod_1.z.coerce.boolean().optional(),
|
|
40
|
-
// То же для передаточного документа — пикер заказов при выпуске УПД. Здесь `queryBooleanSchema`,
|
|
41
|
-
// а не `z.coerce.boolean()`: в query всегда приходит текст, и `Boolean('false') === true`,
|
|
42
|
-
// то есть флаг соседа невозможно выключить явным значением, только опустив параметр.
|
|
43
|
-
withoutTransferDocument: query_boolean_helper_1.queryBooleanSchema,
|
|
44
|
-
})
|
|
45
|
-
.refine(value => {
|
|
46
|
-
const { startDate, endDate } = value;
|
|
47
|
-
if (startDate && endDate) {
|
|
48
|
-
return (0, date_helper_1.dateRangeCheck)(startDate, endDate);
|
|
49
|
-
}
|
|
50
|
-
return true;
|
|
51
|
-
}, {
|
|
52
|
-
message: 'validation.dateRange',
|
|
53
|
-
path: ['endDate', 'startDate'],
|
|
54
|
-
})
|
|
55
|
-
.refine(value => {
|
|
56
|
-
const { deliveryDateFrom, deliveryDateTo } = value;
|
|
57
|
-
if (deliveryDateFrom && deliveryDateTo) {
|
|
58
|
-
return (0, date_helper_1.dateRangeCheck)(deliveryDateFrom, deliveryDateTo);
|
|
59
|
-
}
|
|
60
|
-
return true;
|
|
61
|
-
}, {
|
|
62
|
-
message: 'validation.dateRange',
|
|
63
|
-
path: ['deliveryDateTo', 'deliveryDateFrom'],
|
|
64
|
-
});
|
|
65
|
-
const GetOrderListResponseSchema = zod_1.z.object({
|
|
66
|
-
message: zod_1.z.string().optional(),
|
|
67
|
-
data: zod_1.z.object({
|
|
68
|
-
orderList: schemas_1.OrderExtendedSchema.array(),
|
|
69
|
-
total: zod_1.z.number(),
|
|
70
|
-
}),
|
|
71
|
-
});
|
|
4
|
+
const get_order_list_request_schema_1 = require("../../schemas/order/get-order-list-request.schema");
|
|
5
|
+
const get_order_list_response_schema_1 = require("../../schemas/order/get-order-list-response.schema");
|
|
72
6
|
var GetOrderListContractQuery;
|
|
73
7
|
(function (GetOrderListContractQuery) {
|
|
74
|
-
GetOrderListContractQuery.RequestSchema = GetOrderListRequestSchema;
|
|
75
|
-
GetOrderListContractQuery.ResponseSchema = GetOrderListResponseSchema;
|
|
8
|
+
GetOrderListContractQuery.RequestSchema = get_order_list_request_schema_1.GetOrderListRequestSchema;
|
|
9
|
+
GetOrderListContractQuery.ResponseSchema = get_order_list_response_schema_1.GetOrderListResponseSchema;
|
|
76
10
|
})(GetOrderListContractQuery || (exports.GetOrderListContractQuery = GetOrderListContractQuery = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CLIENT_REGISTRATION_EMAIL_MAX_LENGTH = exports.CLIENT_REGISTRATION_PHONE_MAX_LENGTH = exports.CLIENT_REGISTRATION_CONTACT_NAME_MAX_LENGTH = exports.CLIENT_REGISTRATION_NAME_MAX_LENGTH = void 0;
|
|
4
|
+
// Потолки полей публичной заявки на регистрацию с витрины. Тело запроса до 1 МиБ, а данные заявки уходят
|
|
5
|
+
// в письма админам и в payload уведомлений — без границы туда попадает мегабайт текста.
|
|
6
|
+
exports.CLIENT_REGISTRATION_NAME_MAX_LENGTH = 255;
|
|
7
|
+
exports.CLIENT_REGISTRATION_CONTACT_NAME_MAX_LENGTH = 255;
|
|
8
|
+
// Номер с кодом страны и разделителями укладывается с запасом.
|
|
9
|
+
exports.CLIENT_REGISTRATION_PHONE_MAX_LENGTH = 32;
|
|
10
|
+
// Предел длины адреса по RFC 5321.
|
|
11
|
+
exports.CLIENT_REGISTRATION_EMAIL_MAX_LENGTH = 254;
|
package/build/constant/error.js
CHANGED
|
@@ -68,6 +68,11 @@ exports.ERRORS = {
|
|
|
68
68
|
MONEY_ACCOUNT_FETCH_FAILED: { code: 'M006', message: 'Error when retrieving a list of money accounts', httpCode: 500 },
|
|
69
69
|
MONEY_ACCOUNT_HAS_TRANSACTIONS: { code: 'M007', message: 'Money account has transactions', httpCode: 400 },
|
|
70
70
|
MONEY_ACCOUNT_ACCESS_DENIED: { code: 'M008', message: 'Money account access denied', httpCode: 500 },
|
|
71
|
+
MONEY_ACCOUNT_INTEGRATION_LINK_FAILED: {
|
|
72
|
+
code: 'M009',
|
|
73
|
+
message: 'Failed to read or save money account integration link',
|
|
74
|
+
httpCode: 500,
|
|
75
|
+
},
|
|
71
76
|
//NOTIFICATION
|
|
72
77
|
NOTIFICATION_NOT_CREATED: { code: 'N001', message: 'Failed to create Notification', httpCode: 500 },
|
|
73
78
|
NOTIFICATION_NOT_FOUND: { code: 'N002', message: 'Notification not found', httpCode: 400 },
|
|
@@ -1826,6 +1831,11 @@ exports.ERRORS = {
|
|
|
1826
1831
|
message: 'Latest sync job for this entity is not DEAD; cannot retry',
|
|
1827
1832
|
httpCode: 409,
|
|
1828
1833
|
},
|
|
1834
|
+
OUTBOUND_SYNC_ENTITY_LOCK_LOST: {
|
|
1835
|
+
code: 'OS006',
|
|
1836
|
+
message: 'Outbound sync job lost its entity lock before writing to the external system; will retry shortly',
|
|
1837
|
+
httpCode: 409,
|
|
1838
|
+
},
|
|
1829
1839
|
MOYSKLAD_STOCK_SYNC_CAP_EXCEEDED: {
|
|
1830
1840
|
code: 'MS015',
|
|
1831
1841
|
message: 'MoySklad stock-sync concurrency cap exceeded; will retry shortly',
|
|
@@ -1866,6 +1876,26 @@ exports.ERRORS = {
|
|
|
1866
1876
|
message: 'The demand is waiting for the order to be pushed to MoySklad; will retry shortly',
|
|
1867
1877
|
httpCode: 409,
|
|
1868
1878
|
},
|
|
1879
|
+
MOYSKLAD_PAYMENT_CLIENT_NOT_LINKED: {
|
|
1880
|
+
code: 'MS024',
|
|
1881
|
+
message: 'Payment client has no MoySklad link; import clients first',
|
|
1882
|
+
httpCode: 400,
|
|
1883
|
+
},
|
|
1884
|
+
MOYSKLAD_PAYMENT_WAITING_ORDER_PUSH: {
|
|
1885
|
+
code: 'MS025',
|
|
1886
|
+
message: 'The payment is waiting for its order to be created in MoySklad; will retry shortly',
|
|
1887
|
+
httpCode: 409,
|
|
1888
|
+
},
|
|
1889
|
+
MOYSKLAD_MONEY_TARGET_NOT_FOUND: {
|
|
1890
|
+
code: 'MS026',
|
|
1891
|
+
message: 'The MoySklad cash desk or bank account was not found in the connected account',
|
|
1892
|
+
httpCode: 400,
|
|
1893
|
+
},
|
|
1894
|
+
MOYSKLAD_PAYMENT_CREATE_LOCK_BUSY: {
|
|
1895
|
+
code: 'MS027',
|
|
1896
|
+
message: 'Another payment is being created in MoySklad for this account; will retry shortly',
|
|
1897
|
+
httpCode: 409,
|
|
1898
|
+
},
|
|
1869
1899
|
// 1C COMMERCEML INTEGRATION
|
|
1870
1900
|
ONE_C_NOT_CONNECTED: { code: 'OC001', message: '1C integration is not connected for this company', httpCode: 404 },
|
|
1871
1901
|
ONE_C_CONNECT_FAILED: { code: 'OC002', message: 'Failed to connect 1C integration', httpCode: 500 },
|
package/build/constant/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __exportStar(require("./report.constant"), exports);
|
|
|
24
24
|
__exportStar(require("./oksm"), exports);
|
|
25
25
|
__exportStar(require("./okei"), exports);
|
|
26
26
|
__exportStar(require("./contact-phone.constant"), exports);
|
|
27
|
+
__exportStar(require("./client-registration.constant"), exports);
|
|
27
28
|
__exportStar(require("./settings.constant"), exports);
|
|
28
29
|
__exportStar(require("./consignment-product-enrichment.constant"), exports);
|
|
29
30
|
__exportStar(require("./attribute-normalization.constant"), exports);
|
|
@@ -34,3 +35,4 @@ __exportStar(require("./order-external-number.constant"), exports);
|
|
|
34
35
|
__exportStar(require("./discount-rules-pricing-type-list.constant"), exports);
|
|
35
36
|
__exportStar(require("./measure-unit-limits"), exports);
|
|
36
37
|
__exportStar(require("./product-resolution.constant"), exports);
|
|
38
|
+
__exportStar(require("./write-off-image.constant"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WRITE_OFF_IMAGE_RETENTION_DAYS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Retention policy for write-off photos (FC-632): 90 days from the record's creation. After that a photo counts as
|
|
6
|
+
* unavailable — clients show «фото удалено», the export gives no link, archives skip it.
|
|
7
|
+
*
|
|
8
|
+
* This is a policy, not a storage check. The lifecycle rule on `write-offs/` deletes new photos around this time
|
|
9
|
+
* (with up to a day of lag), while older photos under `images/` are not deleted by it and may still be in the bucket.
|
|
10
|
+
*/
|
|
11
|
+
exports.WRITE_OFF_IMAGE_RETENTION_DAYS = 90;
|
|
@@ -11,4 +11,5 @@ var ExternalEntityTypeEnum;
|
|
|
11
11
|
ExternalEntityTypeEnum["SUPPLIER_ORDER"] = "SUPPLIER_ORDER";
|
|
12
12
|
ExternalEntityTypeEnum["SUPPLIER_ORDER_POSITION"] = "SUPPLIER_ORDER_POSITION";
|
|
13
13
|
ExternalEntityTypeEnum["PAYMENT"] = "PAYMENT";
|
|
14
|
+
ExternalEntityTypeEnum["TRANSACTION"] = "TRANSACTION";
|
|
14
15
|
})(ExternalEntityTypeEnum || (exports.ExternalEntityTypeEnum = ExternalEntityTypeEnum = {}));
|
package/build/enum/index.js
CHANGED
|
@@ -73,6 +73,7 @@ __exportStar(require("./image-type.enum"), exports);
|
|
|
73
73
|
__exportStar(require("./import-error-code.enum"), exports);
|
|
74
74
|
__exportStar(require("./integration-check-status.enum"), exports);
|
|
75
75
|
__exportStar(require("./integration-provider.enum"), exports);
|
|
76
|
+
__exportStar(require("./money-account-integration-link-kind.enum"), exports);
|
|
76
77
|
__exportStar(require("./integration-status.enum"), exports);
|
|
77
78
|
__exportStar(require("./inventory-movement-type.enum"), exports);
|
|
78
79
|
__exportStar(require("./invoice-product-field.enum"), exports);
|
|
@@ -211,3 +212,4 @@ __exportStar(require("./product-resolution-image-reason.enum"), exports);
|
|
|
211
212
|
__exportStar(require("./product-resolution-matched-attribute.enum"), exports);
|
|
212
213
|
__exportStar(require("./product-resolution-decision-action.enum"), exports);
|
|
213
214
|
__exportStar(require("./product-resolution-write-mode.enum"), exports);
|
|
215
|
+
__exportStar(require("./order-source.enum"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoneyAccountIntegrationLinkKindEnum = void 0;
|
|
4
|
+
// Куда во внешней системе ложатся деньги счёта FC. Для МойСклада: касса юрлица или его расчётный счёт.
|
|
5
|
+
var MoneyAccountIntegrationLinkKindEnum;
|
|
6
|
+
(function (MoneyAccountIntegrationLinkKindEnum) {
|
|
7
|
+
MoneyAccountIntegrationLinkKindEnum["CASH"] = "CASH";
|
|
8
|
+
MoneyAccountIntegrationLinkKindEnum["BANK"] = "BANK";
|
|
9
|
+
})(MoneyAccountIntegrationLinkKindEnum || (exports.MoneyAccountIntegrationLinkKindEnum = MoneyAccountIntegrationLinkKindEnum = {}));
|
|
@@ -26,4 +26,7 @@ var NotificationTypeEnum;
|
|
|
26
26
|
NotificationTypeEnum["PRE_ORDER_CREATED"] = "PRE_ORDER_CREATED";
|
|
27
27
|
// Клиенту: рассылка сценария PRE_ORDER_COLLECTION_OPENED — открыт сбор предзаказов.
|
|
28
28
|
NotificationTypeEnum["PRE_ORDER_COLLECTION_OPENED"] = "PRE_ORDER_COLLECTION_OPENED";
|
|
29
|
+
// Админам: на витрине подана заявка с телефоном или email клиента, у которого нет учётной записи.
|
|
30
|
+
// Заявитель получает нейтральный ответ; привязывать заявку к клиенту автоматически нельзя — это захват аккаунта.
|
|
31
|
+
NotificationTypeEnum["CLIENT_REGISTRATION_CONFLICT"] = "CLIENT_REGISTRATION_CONFLICT";
|
|
29
32
|
})(NotificationTypeEnum || (exports.NotificationTypeEnum = NotificationTypeEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentInvoiceFileDeletionStatusEnum = void 0;
|
|
4
|
+
var PaymentInvoiceFileDeletionStatusEnum;
|
|
5
|
+
(function (PaymentInvoiceFileDeletionStatusEnum) {
|
|
6
|
+
PaymentInvoiceFileDeletionStatusEnum["READY_FOR_DELETE"] = "READY_FOR_DELETE";
|
|
7
|
+
PaymentInvoiceFileDeletionStatusEnum["DELETED"] = "DELETED";
|
|
8
|
+
PaymentInvoiceFileDeletionStatusEnum["DELETE_FAILED"] = "DELETE_FAILED";
|
|
9
|
+
})(PaymentInvoiceFileDeletionStatusEnum || (exports.PaymentInvoiceFileDeletionStatusEnum = PaymentInvoiceFileDeletionStatusEnum = {}));
|
|
@@ -4,11 +4,12 @@ exports.RegisterClientWebshopRequestSchema = void 0;
|
|
|
4
4
|
const password_schema_1 = require("../auth/password.schema");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const client_type_enum_1 = require("../../enum/client-type.enum");
|
|
7
|
+
const client_registration_constant_1 = require("../../constant/client-registration.constant");
|
|
7
8
|
exports.RegisterClientWebshopRequestSchema = zod_1.z.object({
|
|
8
|
-
name: zod_1.z.string(),
|
|
9
|
+
name: zod_1.z.string().max(client_registration_constant_1.CLIENT_REGISTRATION_NAME_MAX_LENGTH),
|
|
9
10
|
password: password_schema_1.PasswordSchema,
|
|
10
|
-
contactName: zod_1.z.string().nullable(),
|
|
11
|
-
phone: zod_1.z.string(),
|
|
12
|
-
email: zod_1.z.email().toLowerCase(),
|
|
11
|
+
contactName: zod_1.z.string().max(client_registration_constant_1.CLIENT_REGISTRATION_CONTACT_NAME_MAX_LENGTH).nullable(),
|
|
12
|
+
phone: zod_1.z.string().max(client_registration_constant_1.CLIENT_REGISTRATION_PHONE_MAX_LENGTH),
|
|
13
|
+
email: zod_1.z.email().max(client_registration_constant_1.CLIENT_REGISTRATION_EMAIL_MAX_LENGTH).toLowerCase(),
|
|
13
14
|
type: zod_1.z.nativeEnum(client_type_enum_1.ClientTypeEnum),
|
|
14
15
|
});
|
|
@@ -21,4 +21,6 @@ exports.EnableMoyskladRequestSchema = zod_1.z.object({
|
|
|
21
21
|
// Posted demand (отгрузка) in MS. No default on purpose: a client that does not send them keeps the saved values.
|
|
22
22
|
isDemandEnabled: zod_1.z.boolean().optional(),
|
|
23
23
|
demandOrderStatus: zod_1.z.enum(moysklad_demand_order_status_list_1.MOYSKLAD_DEMAND_ORDER_STATUS_LIST).optional(),
|
|
24
|
+
// Выгрузка оплат клиентов в МС. Без default по той же причине, что у отгрузок.
|
|
25
|
+
isPaymentSyncEnabled: zod_1.z.boolean().optional(),
|
|
24
26
|
});
|
|
@@ -42,3 +42,12 @@ __exportStar(require("./seller-sync-failure.schema"), exports);
|
|
|
42
42
|
__exportStar(require("./seller-sync-status.schema"), exports);
|
|
43
43
|
__exportStar(require("./seller-sync-status-response.schema"), exports);
|
|
44
44
|
__exportStar(require("./seller-sync-request.schema"), exports);
|
|
45
|
+
__exportStar(require("./moysklad-money-target-ref.schema"), exports);
|
|
46
|
+
__exportStar(require("./moysklad-money-target.schema"), exports);
|
|
47
|
+
__exportStar(require("./moysklad-money-targets-response.schema"), exports);
|
|
48
|
+
__exportStar(require("./moysklad-money-account-link.schema"), exports);
|
|
49
|
+
__exportStar(require("./moysklad-money-account-links-response.schema"), exports);
|
|
50
|
+
__exportStar(require("./save-moysklad-money-account-link-request.schema"), exports);
|
|
51
|
+
__exportStar(require("./moysklad-payment-sync-check-request.schema"), exports);
|
|
52
|
+
__exportStar(require("./moysklad-payment-sync-check.schema"), exports);
|
|
53
|
+
__exportStar(require("./moysklad-payment-sync-check-response.schema"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoyskladMoneyAccountLinkSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const money_account_integration_link_kind_enum_1 = require("../../../enum/money-account-integration-link-kind.enum");
|
|
6
|
+
exports.MoyskladMoneyAccountLinkSchema = zod_1.z.object({
|
|
7
|
+
moneyAccountUUID: zod_1.z.uuid(),
|
|
8
|
+
kind: zod_1.z.nativeEnum(money_account_integration_link_kind_enum_1.MoneyAccountIntegrationLinkKindEnum),
|
|
9
|
+
organizationId: zod_1.z.string(),
|
|
10
|
+
externalAccountId: zod_1.z.string().nullable(),
|
|
11
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoyskladMoneyAccountLinksResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const moysklad_money_account_link_schema_1 = require("./moysklad-money-account-link.schema");
|
|
6
|
+
exports.MoyskladMoneyAccountLinksResponseSchema = zod_1.z.object({ data: zod_1.z.array(moysklad_money_account_link_schema_1.MoyskladMoneyAccountLinkSchema) });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoyskladMoneyTargetRefSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const money_account_integration_link_kind_enum_1 = require("../../../enum/money-account-integration-link-kind.enum");
|
|
6
|
+
// Место денег в МойСкладе: касса юрлица (CASH, своего id у неё нет) или его расчётный счёт (BANK, externalAccountId). Идентификаторы МойСклада —
|
|
7
|
+
// 8-4-4-4-12, но не RFC 9562, поэтому z.guid(), а не z.uuid().
|
|
8
|
+
exports.MoyskladMoneyTargetRefSchema = zod_1.z
|
|
9
|
+
.object({
|
|
10
|
+
kind: zod_1.z.nativeEnum(money_account_integration_link_kind_enum_1.MoneyAccountIntegrationLinkKindEnum),
|
|
11
|
+
organizationId: zod_1.z.guid(),
|
|
12
|
+
externalAccountId: zod_1.z.guid().nullable(),
|
|
13
|
+
})
|
|
14
|
+
.refine(target => (target.kind === money_account_integration_link_kind_enum_1.MoneyAccountIntegrationLinkKindEnum.BANK) === (target.externalAccountId !== null), {
|
|
15
|
+
message: 'externalAccountId is required for BANK and must be null for CASH',
|
|
16
|
+
path: ['externalAccountId'],
|
|
17
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoyskladMoneyTargetSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const money_account_integration_link_kind_enum_1 = require("../../../enum/money-account-integration-link-kind.enum");
|
|
6
|
+
// Вариант для выпадающего списка: касса или расчётный счёт юрлица МойСклада с подписями.
|
|
7
|
+
exports.MoyskladMoneyTargetSchema = zod_1.z.object({
|
|
8
|
+
kind: zod_1.z.nativeEnum(money_account_integration_link_kind_enum_1.MoneyAccountIntegrationLinkKindEnum),
|
|
9
|
+
organizationId: zod_1.z.string(),
|
|
10
|
+
organizationName: zod_1.z.string(),
|
|
11
|
+
externalAccountId: zod_1.z.string().nullable(),
|
|
12
|
+
accountNumber: zod_1.z.string().nullable(),
|
|
13
|
+
bankName: zod_1.z.string().nullable(),
|
|
14
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoyskladMoneyTargetsResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const moysklad_money_target_schema_1 = require("./moysklad-money-target.schema");
|
|
6
|
+
exports.MoyskladMoneyTargetsResponseSchema = zod_1.z.object({ data: zod_1.z.array(moysklad_money_target_schema_1.MoyskladMoneyTargetSchema) });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoyskladPaymentSyncCheckRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.MoyskladPaymentSyncCheckRequestSchema = zod_1.z.object({
|
|
6
|
+
moneyAccountUUID: zod_1.z.uuid(),
|
|
7
|
+
orderUUID: zod_1.z.uuid().optional(),
|
|
8
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoyskladPaymentSyncCheckResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const moysklad_payment_sync_check_schema_1 = require("./moysklad-payment-sync-check.schema");
|
|
6
|
+
exports.MoyskladPaymentSyncCheckResponseSchema = zod_1.z.object({ data: moysklad_payment_sync_check_schema_1.MoyskladPaymentSyncCheckSchema });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoyskladPaymentSyncCheckSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// isSynced — оплата клиента на этот счёт уйдёт в МойСклад. isOrganizationMismatch — юрлицо счёта в МС не совпадает
|
|
6
|
+
// с юрлицом заказа: документ оплаты создастся на юрлицо счёта, но со ссылкой на заказ другого юрлица.
|
|
7
|
+
exports.MoyskladPaymentSyncCheckSchema = zod_1.z.object({
|
|
8
|
+
isSynced: zod_1.z.boolean(),
|
|
9
|
+
isOrganizationMismatch: zod_1.z.boolean(),
|
|
10
|
+
});
|
|
@@ -33,4 +33,5 @@ exports.MoyskladStatusSchema = zod_1.z.object({
|
|
|
33
33
|
orderStateMapping: moysklad_order_state_mapping_schema_1.MoyskladOrderStateMappingSchema,
|
|
34
34
|
isDemandEnabled: zod_1.z.boolean(),
|
|
35
35
|
demandOrderStatus: zod_1.z.nativeEnum(order_status_enum_1.OrderStatusEnum),
|
|
36
|
+
isPaymentSyncEnabled: zod_1.z.boolean(),
|
|
36
37
|
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SaveMoyskladMoneyAccountLinkRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const moysklad_money_target_ref_schema_1 = require("./moysklad-money-target-ref.schema");
|
|
6
|
+
// target = null снимает связь: оплаты со счёта перестают уходить в МойСклад.
|
|
7
|
+
exports.SaveMoyskladMoneyAccountLinkRequestSchema = zod_1.z.object({
|
|
8
|
+
moneyAccountUUID: zod_1.z.uuid(),
|
|
9
|
+
target: moysklad_money_target_ref_schema_1.MoyskladMoneyTargetRefSchema.nullable(),
|
|
10
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetOrderListRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const date_helper_1 = require("../../helpers/date.helper");
|
|
6
|
+
const query_boolean_helper_1 = require("../../helpers/query-boolean.helper");
|
|
7
|
+
const enum_1 = require("../../enum");
|
|
8
|
+
exports.GetOrderListRequestSchema = zod_1.z
|
|
9
|
+
.object({
|
|
10
|
+
page: zod_1.z.string().transform(val => Number(val) || 1),
|
|
11
|
+
count: zod_1.z.string().transform(val => Number(val) || 10),
|
|
12
|
+
startDate: zod_1.z.coerce.date().optional(),
|
|
13
|
+
endDate: zod_1.z.coerce.date().optional(),
|
|
14
|
+
isDelivery: zod_1.z.coerce.boolean().optional(),
|
|
15
|
+
isPaid: zod_1.z.coerce.boolean().optional(),
|
|
16
|
+
consignmentUUID: zod_1.z.string().optional(),
|
|
17
|
+
tag: zod_1.z.string().optional(),
|
|
18
|
+
clientUUID: zod_1.z.string().optional(),
|
|
19
|
+
// Филиал клиента (`Order.branchUUID`). Точное совпадение; осмысленно вместе с `clientUUID`,
|
|
20
|
+
// но не требует его — филиал и так принадлежит одному клиенту.
|
|
21
|
+
branchUUID: zod_1.z.uuid().optional(),
|
|
22
|
+
searchQuery: zod_1.z.string().optional(),
|
|
23
|
+
consignmentDeliveryDate: zod_1.z.coerce.date().optional(),
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Используйте `deliveryDateFrom` / `deliveryDateTo`. Оставлен ради сохранённых
|
|
26
|
+
* ссылок и MCP-клиентов: трактуется как период из одного дня (from = to = deliveryDate).
|
|
27
|
+
*/
|
|
28
|
+
deliveryDate: zod_1.z.coerce.date().optional(),
|
|
29
|
+
// Период даты отгрузки/выдачи заказа (`plannedShipmentDate`) — и доставка, и самовывоз; имена
|
|
30
|
+
// остались от фильтра по дате доставки. Календарные дни `YYYY-MM-DD`, обе границы включительно.
|
|
31
|
+
deliveryDateFrom: zod_1.z.coerce.date().optional(),
|
|
32
|
+
deliveryDateTo: zod_1.z.coerce.date().optional(),
|
|
33
|
+
byProductSearchQuery: zod_1.z.string().optional(),
|
|
34
|
+
statuses: zod_1.z.nativeEnum(enum_1.OrderStatusEnum).array().optional(),
|
|
35
|
+
source: zod_1.z.nativeEnum(enum_1.OrderSourceEnum).optional(),
|
|
36
|
+
type: zod_1.z.nativeEnum(enum_1.OrderTypeEnum).optional(),
|
|
37
|
+
city: zod_1.z.string().optional(),
|
|
38
|
+
responsibleUserUUID: zod_1.z.string().optional(),
|
|
39
|
+
group: zod_1.z.string().optional(),
|
|
40
|
+
// Только заказы, ещё не включённые ни в один счёт на оплату — список для пикера при
|
|
41
|
+
// выставлении счёта. Комбинируется с остальными критериями обычным AND.
|
|
42
|
+
withoutPaymentInvoice: zod_1.z.coerce.boolean().optional(),
|
|
43
|
+
// То же для передаточного документа — пикер заказов при выпуске УПД. Здесь `queryBooleanSchema`,
|
|
44
|
+
// а не `z.coerce.boolean()`: в query всегда приходит текст, и `Boolean('false') === true`,
|
|
45
|
+
// то есть флаг соседа невозможно выключить явным значением, только опустив параметр.
|
|
46
|
+
withoutTransferDocument: query_boolean_helper_1.queryBooleanSchema,
|
|
47
|
+
})
|
|
48
|
+
.refine(value => {
|
|
49
|
+
const { startDate, endDate } = value;
|
|
50
|
+
if (startDate && endDate) {
|
|
51
|
+
return (0, date_helper_1.dateRangeCheck)(startDate, endDate);
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
}, {
|
|
55
|
+
message: 'validation.dateRange',
|
|
56
|
+
path: ['endDate', 'startDate'],
|
|
57
|
+
})
|
|
58
|
+
.refine(value => {
|
|
59
|
+
const { deliveryDateFrom, deliveryDateTo } = value;
|
|
60
|
+
if (deliveryDateFrom && deliveryDateTo) {
|
|
61
|
+
return (0, date_helper_1.dateRangeCheck)(deliveryDateFrom, deliveryDateTo);
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
}, {
|
|
65
|
+
message: 'validation.dateRange',
|
|
66
|
+
path: ['deliveryDateTo', 'deliveryDateFrom'],
|
|
67
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetOrderListResponseDataSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const order_extended_schema_1 = require("./order-extended.schema");
|
|
6
|
+
exports.GetOrderListResponseDataSchema = zod_1.z.object({ orderList: order_extended_schema_1.OrderExtendedSchema.array(), total: zod_1.z.number() });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetOrderListResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const get_order_list_response_data_schema_1 = require("./get-order-list-response-data.schema");
|
|
6
|
+
exports.GetOrderListResponseSchema = zod_1.z.object({ message: zod_1.z.string().optional(), data: get_order_list_response_data_schema_1.GetOrderListResponseDataSchema });
|
|
@@ -42,3 +42,7 @@ __exportStar(require("./order-vat-transition-execute-failure.schema"), exports);
|
|
|
42
42
|
__exportStar(require("./order-vat-transition-execute-result.schema"), exports);
|
|
43
43
|
__exportStar(require("./order-vat-transition-execute-response.schema"), exports);
|
|
44
44
|
__exportStar(require("./order-vat-source-confirmation.schema"), exports);
|
|
45
|
+
__exportStar(require("./get-order-list-request.schema"), exports);
|
|
46
|
+
__exportStar(require("./get-order-list-response.schema"), exports);
|
|
47
|
+
__exportStar(require("./get-order-list-response-data.schema"), exports);
|
|
48
|
+
__exportStar(require("./order-creator.schema"), exports);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrderCreatorSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.OrderCreatorSchema = zod_1.z.object({ uuid: zod_1.z.string().uuid(), name: zod_1.z.string(), isClient: zod_1.z.boolean() });
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OrderExtendedSchema = void 0;
|
|
4
|
+
const order_creator_schema_1 = require("./order-creator.schema");
|
|
5
|
+
const order_source_enum_1 = require("../../enum/order-source.enum");
|
|
4
6
|
const zod_1 = require("zod");
|
|
5
7
|
const client_base_schema_1 = require("../client/client-base.schema");
|
|
6
8
|
const branch_schema_1 = require("../branch/branch.schema");
|
|
@@ -8,6 +10,8 @@ const order_delivery_schema_1 = require("../order-delivery/order-delivery.schema
|
|
|
8
10
|
const delivery_route_schema_1 = require("../delivery-route/delivery-route.schema");
|
|
9
11
|
const order_base_schema_1 = require("./order-base.schema");
|
|
10
12
|
exports.OrderExtendedSchema = order_base_schema_1.OrderSchema.extend({
|
|
13
|
+
source: zod_1.z.nativeEnum(order_source_enum_1.OrderSourceEnum).nullable(),
|
|
14
|
+
creator: order_creator_schema_1.OrderCreatorSchema.nullable(),
|
|
11
15
|
client: client_base_schema_1.ClientSchema,
|
|
12
16
|
branch: branch_schema_1.BranchSchema.nullable(),
|
|
13
17
|
delivery: order_delivery_schema_1.OrderDeliverySchema.nullable(),
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetPreOrderListRequestSchema = void 0;
|
|
4
|
+
const order_source_enum_1 = require("../../enum/order-source.enum");
|
|
4
5
|
const zod_1 = require("zod");
|
|
5
6
|
const optional_query_boolean_helper_1 = require("../../helpers/optional-query-boolean.helper");
|
|
6
7
|
const enum_1 = require("../../enum");
|
|
7
8
|
exports.GetPreOrderListRequestSchema = zod_1.z.object({
|
|
9
|
+
source: zod_1.z.nativeEnum(order_source_enum_1.OrderSourceEnum).optional(),
|
|
8
10
|
page: zod_1.z.string().transform(val => Number(val) || 1),
|
|
9
11
|
excludeClosed: optional_query_boolean_helper_1.optionalQueryBooleanSchema,
|
|
10
12
|
count: zod_1.z.coerce.number().optional().default(10),
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpdatePreOrderWebshopSchema = exports.CreatePreOrderWebshopSchema = exports.UpdatePreOrderSchema = exports.UpdatablePreOrderStatusSchema = exports.CreatePreOrderSchema = exports.PreOrderListSchema = exports.PreOrderWithClientSchema = exports.PreOrderExtendedSchema = exports.PreOrderSchema = void 0;
|
|
4
|
+
const order_creator_schema_1 = require("../order/order-creator.schema");
|
|
5
|
+
const order_source_enum_1 = require("../../enum/order-source.enum");
|
|
4
6
|
const pre_order_conversion_current_order_schema_1 = require("./pre-order-conversion-current-order.schema");
|
|
5
7
|
const pre_order_conversion_change_schema_1 = require("./pre-order-conversion-change.schema");
|
|
6
8
|
const pre_order_conversion_summary_schema_1 = require("./pre-order-conversion-summary.schema");
|
|
@@ -24,6 +26,8 @@ exports.PreOrderSchema = zod_1.z.object({
|
|
|
24
26
|
createdAt: zod_1.z.coerce.date(),
|
|
25
27
|
});
|
|
26
28
|
exports.PreOrderExtendedSchema = exports.PreOrderSchema.extend({
|
|
29
|
+
source: zod_1.z.nativeEnum(order_source_enum_1.OrderSourceEnum).nullable(),
|
|
30
|
+
creator: order_creator_schema_1.OrderCreatorSchema.nullable(),
|
|
27
31
|
client: client_base_schema_1.ClientSchema,
|
|
28
32
|
branch: branch_schema_1.BranchSchema.nullable(),
|
|
29
33
|
preOrderCollection: pre_order_collection_schema_1.PreOrderCollectionSchema.nullable(),
|
|
@@ -8,4 +8,8 @@ exports.WriteOffImageSchema = zod_1.z.object({
|
|
|
8
8
|
url: zod_1.z.string(),
|
|
9
9
|
createdAt: zod_1.z.date(),
|
|
10
10
|
deletedAt: zod_1.z.date().nullable(),
|
|
11
|
+
// Retention policy (WRITE_OFF_IMAGE_RETENTION_DAYS), not a storage check: once expired, treat the photo as
|
|
12
|
+
// unavailable whether or not the file is still in the bucket. The record itself stays.
|
|
13
|
+
fileExpiresAt: zod_1.z.date(),
|
|
14
|
+
isFileExpired: zod_1.z.boolean(),
|
|
11
15
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { MoyskladMoneyAccountLinksResponseSchema } from '../../../schemas/integration/moysklad/moysklad-money-account-links-response.schema';
|
|
3
|
+
|
|
4
|
+
export namespace GetMoyskladMoneyAccountLinksContractQuery {
|
|
5
|
+
export const ResponseSchema = MoyskladMoneyAccountLinksResponseSchema;
|
|
6
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
7
|
+
}
|