@floristcloud/api-lib 1.2.96 → 1.2.98
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/account-deletion-request/initiate-public-account-deletion.command.js +2 -0
- package/build/commands/action-log/get-action-log-list-for-client.query.js +1 -1
- package/build/commands/action-log/get-action-log-list.query.js +1 -1
- package/build/commands/auth/list-mobile-buyer-tenants.command.js +2 -2
- package/build/commands/auth/reset-password-by-token.command.js +1 -1
- package/build/commands/bank-payment/get-bank-payment-list.query.js +1 -1
- package/build/commands/consignment/execute-consignment-product-update.command.js +2 -2
- package/build/commands/consignment/get-consignment-list.query.js +1 -1
- package/build/commands/discount-rules/remove-consignment-discount.command.js +1 -1
- package/build/commands/discount-rules/set-consignment-discount.command.js +1 -1
- package/build/commands/employee-schedule/get-employee-schedule-list.query.js +1 -1
- package/build/commands/order/get-order-list.query.js +2 -1
- package/build/commands/order/group/merge-orders.command.js +1 -1
- package/build/commands/order/webshop/get-order-list-for-client.query.js +3 -3
- package/build/commands/order-product/group/price-correction-analyze.command.js +1 -1
- package/build/commands/order-product/webshop/create-order-product-for-client.command.js +1 -1
- package/build/commands/pre-order/group/analyze-copy-pre-orders.command.js +1 -1
- package/build/commands/pre-order/group/analyze-create-pre-orders-from-standing-orders.command.js +1 -1
- package/build/commands/pre-order/group/group-copy-pre-orders-to-collection.command.js +3 -2
- package/build/commands/pre-order/group/group-create-pre-orders-from-standing-orders.command.js +1 -1
- package/build/commands/pre-order-collection-item/execute-pre-order-collection-item-update.command.js +2 -2
- package/build/commands/product/group/delete-group-product.command.js +2 -3
- package/build/commands/product/group/update-group-product-update-batch.command.js +2 -2
- package/build/commands/report/export-client-statement.query.js +1 -1
- package/build/commands/report/export-inventory-movement.query.js +1 -1
- package/build/commands/report/export-inventory-turnover.query.js +1 -1
- package/build/commands/report/export-sales-by-client.query.js +2 -2
- package/build/commands/report/export-sales-by-position.query.js +2 -2
- package/build/commands/report/export-sales-revenue.query.js +1 -1
- package/build/commands/report/get-daily-orders-summary.query.js +2 -2
- package/build/commands/report/get-report-by-client-weeks.query.js +1 -1
- package/build/commands/report/get-report-for-period.query.js +1 -1
- package/build/commands/report/get-report-group-by-client.query.js +1 -1
- package/build/commands/report/get-report-group-by-position.query.js +1 -1
- package/build/commands/report/get-sales-summary.query.js +1 -1
- package/build/commands/transaction/export-transactions.command.js +1 -1
- package/build/commands/transaction/get-sum-transaction-by-money-account.query.js +1 -1
- package/build/commands/transaction/get-transaction-list.query.js +1 -1
- package/build/commands/transaction/get-transaction-summary.query.js +1 -1
- package/build/commands/transaction/webshop/get-transaction-list-for-client.query.js +1 -1
- package/build/commands/user/createUser.command.js +2 -0
- package/build/commands/user/createUserByClientId.command.js +3 -1
- package/build/commands/user/createUserForCompany.command.js +3 -1
- package/build/commands/work-session/export-overtime.query.js +1 -1
- package/build/commands/write-off/create-write-off-from-pending.command.js +1 -1
- package/build/commands/write-off/get-write-off-list.query.js +1 -1
- package/build/commands/write-off/update-write-off-status.command.js +1 -1
- package/build/constant/error-i18n-key.js +43 -0
- package/build/constant/error.js +113 -14
- package/build/constant/index.js +2 -0
- package/build/constant/validation-i18n-key.js +39 -0
- package/build/constant/validation-i18n-message.js +47 -0
- package/build/constant/verbose.js +11 -10
- package/build/schemas/api-error.schema.js +32 -0
- package/build/schemas/consignment-transfer/accept-consignment-transfer.schema.js +1 -1
- package/build/schemas/index.js +1 -0
- package/build/schemas/order-service-line/order-service-line.schema.js +1 -1
- package/build/schemas/pre-order/pre-order-copy.schema.js +2 -1
- package/commands/account-deletion-request/initiate-public-account-deletion.command.ts +2 -0
- package/commands/action-log/get-action-log-list-for-client.query.ts +1 -1
- package/commands/action-log/get-action-log-list.query.ts +1 -1
- package/commands/auth/list-mobile-buyer-tenants.command.ts +2 -2
- package/commands/auth/reset-password-by-token.command.ts +1 -1
- package/commands/bank-payment/get-bank-payment-list.query.ts +1 -1
- package/commands/consignment/execute-consignment-product-update.command.ts +2 -2
- package/commands/consignment/get-consignment-list.query.ts +1 -1
- package/commands/discount-rules/remove-consignment-discount.command.ts +1 -1
- package/commands/discount-rules/set-consignment-discount.command.ts +1 -1
- package/commands/employee-schedule/get-employee-schedule-list.query.ts +1 -1
- package/commands/order/get-order-list.query.ts +2 -1
- package/commands/order/group/merge-orders.command.ts +1 -1
- package/commands/order/webshop/get-order-list-for-client.query.ts +3 -3
- package/commands/order-product/group/price-correction-analyze.command.ts +1 -1
- package/commands/order-product/webshop/create-order-product-for-client.command.ts +1 -1
- package/commands/pre-order/group/analyze-copy-pre-orders.command.ts +2 -2
- package/commands/pre-order/group/analyze-create-pre-orders-from-standing-orders.command.ts +2 -1
- package/commands/pre-order/group/group-copy-pre-orders-to-collection.command.ts +3 -2
- package/commands/pre-order/group/group-create-pre-orders-from-standing-orders.command.ts +2 -2
- package/commands/pre-order-collection-item/execute-pre-order-collection-item-update.command.ts +2 -2
- package/commands/product/group/delete-group-product.command.ts +4 -5
- package/commands/product/group/update-group-product-update-batch.command.ts +2 -2
- package/commands/report/export-client-statement.query.ts +1 -1
- package/commands/report/export-inventory-movement.query.ts +1 -1
- package/commands/report/export-inventory-turnover.query.ts +1 -1
- package/commands/report/export-sales-by-client.query.ts +2 -2
- package/commands/report/export-sales-by-position.query.ts +2 -2
- package/commands/report/export-sales-revenue.query.ts +1 -1
- package/commands/report/get-daily-orders-summary.query.ts +2 -2
- package/commands/report/get-report-by-client-weeks.query.ts +1 -1
- package/commands/report/get-report-for-period.query.ts +1 -1
- package/commands/report/get-report-group-by-client.query.ts +1 -1
- package/commands/report/get-report-group-by-position.query.ts +3 -3
- package/commands/report/get-sales-summary.query.ts +1 -1
- package/commands/transaction/export-transactions.command.ts +1 -1
- package/commands/transaction/get-sum-transaction-by-money-account.query.ts +1 -1
- package/commands/transaction/get-transaction-list.query.ts +1 -1
- package/commands/transaction/get-transaction-summary.query.ts +1 -1
- package/commands/transaction/webshop/get-transaction-list-for-client.query.ts +1 -1
- package/commands/user/createUser.command.ts +2 -0
- package/commands/user/createUserByClientId.command.ts +3 -1
- package/commands/user/createUserForCompany.command.ts +3 -1
- package/commands/work-session/export-overtime.query.ts +4 -7
- package/commands/write-off/create-write-off-from-pending.command.ts +1 -1
- package/commands/write-off/get-write-off-list.query.ts +1 -1
- package/commands/write-off/update-write-off-status.command.ts +1 -1
- package/constant/error-i18n-key.ts +53 -0
- package/constant/error.ts +116 -14
- package/constant/index.ts +2 -0
- package/constant/validation-i18n-key.ts +38 -0
- package/constant/validation-i18n-message.ts +46 -0
- package/constant/verbose.ts +12 -11
- package/package.json +1 -1
- package/schemas/api-error.schema.ts +34 -0
- package/schemas/consignment-transfer/accept-consignment-transfer.schema.ts +1 -1
- package/schemas/index.ts +1 -0
- package/schemas/order-service-line/order-service-line.schema.ts +1 -1
- package/schemas/pre-order/pre-order-copy.schema.ts +2 -1
|
@@ -7,6 +7,8 @@ const InitiatePublicAccountDeletionRequestSchema = zod_1.z.object({
|
|
|
7
7
|
});
|
|
8
8
|
const InitiatePublicAccountDeletionResponseSchema = zod_1.z.object({
|
|
9
9
|
message: zod_1.z.string(),
|
|
10
|
+
code: zod_1.z.string().optional(),
|
|
11
|
+
i18nKey: zod_1.z.string().optional(),
|
|
10
12
|
data: zod_1.z.object({
|
|
11
13
|
success: zod_1.z.boolean(),
|
|
12
14
|
}),
|
|
@@ -20,7 +20,7 @@ const GetActionLogListForClientRequestSchema = zod_1.z
|
|
|
20
20
|
}
|
|
21
21
|
return true;
|
|
22
22
|
}, {
|
|
23
|
-
message: '
|
|
23
|
+
message: 'validation.dateRange',
|
|
24
24
|
path: ['endDate', 'startDate'],
|
|
25
25
|
});
|
|
26
26
|
const GetActionLogListForClientResponseSchema = zod_1.z.object({
|
|
@@ -21,7 +21,7 @@ const GetActionLogListRequestSchema = zod_1.z
|
|
|
21
21
|
}
|
|
22
22
|
return true;
|
|
23
23
|
}, {
|
|
24
|
-
message: '
|
|
24
|
+
message: 'validation.dateRange',
|
|
25
25
|
path: ['endDate', 'startDate'],
|
|
26
26
|
});
|
|
27
27
|
const GetActionLogListResponseSchema = zod_1.z.object({
|
|
@@ -7,8 +7,8 @@ const ListMobileBuyerTenantsRequestSchema = zod_1.z
|
|
|
7
7
|
phone: zod_1.z.string().min(1).optional(),
|
|
8
8
|
email: zod_1.z.email().optional(),
|
|
9
9
|
})
|
|
10
|
-
.refine(
|
|
11
|
-
message: '
|
|
10
|
+
.refine(data => data.phone || data.email, {
|
|
11
|
+
message: 'validation.emailOrPhoneRequired',
|
|
12
12
|
});
|
|
13
13
|
const MobileBuyerTenantItemSchema = zod_1.z.object({
|
|
14
14
|
companyUUID: zod_1.z.uuid(),
|
|
@@ -10,7 +10,7 @@ exports.ResetPasswordByTokenRequestSchema = zod_1.z
|
|
|
10
10
|
password: zod_1.z.string(),
|
|
11
11
|
})
|
|
12
12
|
.refine(data => data.email || data.phone, {
|
|
13
|
-
message: '
|
|
13
|
+
message: 'validation.emailOrPhoneRequired',
|
|
14
14
|
path: ['email', 'phone'],
|
|
15
15
|
});
|
|
16
16
|
exports.ResetPasswordByTokenResponseSchema = zod_1.z.object({
|
|
@@ -21,7 +21,7 @@ const GetBankPaymentListRequestSchema = zod_1.z
|
|
|
21
21
|
}
|
|
22
22
|
return true;
|
|
23
23
|
}, {
|
|
24
|
-
message: '
|
|
24
|
+
message: 'validation.dateRange',
|
|
25
25
|
path: ['endDate', 'startDate'],
|
|
26
26
|
});
|
|
27
27
|
const GetBankPaymentListResponseSchema = zod_1.z.object({
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExecuteConsignmentProductUpdateContractCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const error_message_schema_1 = require("../../schemas/error-message.schema");
|
|
5
6
|
const OptionUpdateSchema = zod_1.z.object({
|
|
6
7
|
title: zod_1.z.string().nullable().optional(),
|
|
7
8
|
optionMultiplicity: zod_1.z.number().nullable().optional(),
|
|
@@ -40,9 +41,8 @@ const UpdateBatchResponseSchema = zod_1.z.object({
|
|
|
40
41
|
success: zod_1.z.boolean(),
|
|
41
42
|
successCount: zod_1.z.number(),
|
|
42
43
|
failedCount: zod_1.z.number(),
|
|
43
|
-
errors: zod_1.z.array(
|
|
44
|
+
errors: zod_1.z.array(error_message_schema_1.ErrorMessageSchema.extend({
|
|
44
45
|
uuid: zod_1.z.string(),
|
|
45
|
-
error: zod_1.z.string(),
|
|
46
46
|
})),
|
|
47
47
|
}),
|
|
48
48
|
});
|
|
@@ -28,7 +28,7 @@ const GetConsignmentListRequestSchema = zod_1.z
|
|
|
28
28
|
}
|
|
29
29
|
return true;
|
|
30
30
|
}, {
|
|
31
|
-
message: '
|
|
31
|
+
message: 'validation.dateRange',
|
|
32
32
|
path: ['endDate', 'startDate'],
|
|
33
33
|
});
|
|
34
34
|
const GetConsignmentListResponseSchema = zod_1.z.object({
|
|
@@ -8,7 +8,7 @@ const RemoveConsignmentDiscountBodySchema = zod_1.z
|
|
|
8
8
|
productUUIDs: zod_1.z.uuid().array().optional().default([]),
|
|
9
9
|
})
|
|
10
10
|
.refine(data => Boolean(data.consignmentUUID) || data.productUUIDs.length > 0, {
|
|
11
|
-
message: '
|
|
11
|
+
message: 'validation.consignmentOrProducts',
|
|
12
12
|
});
|
|
13
13
|
const RemoveConsignmentDiscountRequestSchema = zod_1.z.object({
|
|
14
14
|
data: RemoveConsignmentDiscountBodySchema,
|
|
@@ -11,7 +11,7 @@ const SetConsignmentDiscountBodySchema = zod_1.z
|
|
|
11
11
|
})
|
|
12
12
|
.and(schemas_1.discountRulesModeSchema)
|
|
13
13
|
.refine(data => Boolean(data.consignmentUUID) || data.productUUIDs.length > 0, {
|
|
14
|
-
message: '
|
|
14
|
+
message: 'validation.consignmentOrProducts',
|
|
15
15
|
});
|
|
16
16
|
const SetConsignmentDiscountRequestSchema = zod_1.z.object({
|
|
17
17
|
data: SetConsignmentDiscountBodySchema,
|
|
@@ -24,7 +24,7 @@ const GetEmployeeScheduleListRequestSchema = zod_1.z
|
|
|
24
24
|
}
|
|
25
25
|
return true;
|
|
26
26
|
}, {
|
|
27
|
-
message: '
|
|
27
|
+
message: 'validation.dateRange',
|
|
28
28
|
path: ['endDate', 'startDate'],
|
|
29
29
|
});
|
|
30
30
|
const GetEmployeeScheduleListResponseSchema = zod_1.z.object({
|
|
@@ -18,6 +18,7 @@ const GetOrderListRequestSchema = zod_1.z
|
|
|
18
18
|
clientUUID: zod_1.z.string().optional(),
|
|
19
19
|
searchQuery: zod_1.z.string().optional(),
|
|
20
20
|
consignmentDeliveryDate: zod_1.z.coerce.date().optional(),
|
|
21
|
+
deliveryDate: zod_1.z.coerce.date().optional(),
|
|
21
22
|
byProductSearchQuery: zod_1.z.string().optional(),
|
|
22
23
|
statuses: zod_1.z.nativeEnum(enum_1.OrderStatusEnum).array().optional(),
|
|
23
24
|
type: zod_1.z.nativeEnum(enum_1.OrderTypeEnum).optional(),
|
|
@@ -32,7 +33,7 @@ const GetOrderListRequestSchema = zod_1.z
|
|
|
32
33
|
}
|
|
33
34
|
return true;
|
|
34
35
|
}, {
|
|
35
|
-
message: '
|
|
36
|
+
message: 'validation.dateRange',
|
|
36
37
|
path: ['endDate', 'startDate'],
|
|
37
38
|
});
|
|
38
39
|
const GetOrderListResponseSchema = zod_1.z.object({
|
|
@@ -9,7 +9,7 @@ const MergeOrdersRequestSchema = zod_1.z
|
|
|
9
9
|
targetOrderUUID: zod_1.z.string().uuid().optional(),
|
|
10
10
|
})
|
|
11
11
|
.refine(data => !data.targetOrderUUID || data.orderUUIDList.includes(data.targetOrderUUID), {
|
|
12
|
-
message: '
|
|
12
|
+
message: 'validation.targetOrderInList',
|
|
13
13
|
path: ['targetOrderUUID'],
|
|
14
14
|
});
|
|
15
15
|
exports.MergeOrdersGroupAnalysisResponseSchema = zod_1.z.object({
|
|
@@ -23,10 +23,10 @@ const GetOrderForClientListRequestSchema = zod_1.z
|
|
|
23
23
|
.nativeEnum(order_status_enum_1.OrderStatusEnum)
|
|
24
24
|
.array()
|
|
25
25
|
.optional()
|
|
26
|
-
.transform(arr => (arr && arr.length === 0 ? enum_1.OrderWebshopAvailableStatusList : arr !== null && arr !== void 0 ? arr : enum_1.OrderWebshopAvailableStatusList))
|
|
26
|
+
.transform(arr => (arr && arr.length === 0 ? enum_1.OrderWebshopAvailableStatusList : (arr !== null && arr !== void 0 ? arr : enum_1.OrderWebshopAvailableStatusList)))
|
|
27
27
|
.default(enum_1.OrderWebshopAvailableStatusList)
|
|
28
28
|
.refine(arr => arr.every(s => enum_1.OrderWebshopAvailableStatusList.includes(s)), {
|
|
29
|
-
message: '
|
|
29
|
+
message: 'validation.statusNotAllowedWebshop',
|
|
30
30
|
}),
|
|
31
31
|
})
|
|
32
32
|
.refine(value => {
|
|
@@ -36,7 +36,7 @@ const GetOrderForClientListRequestSchema = zod_1.z
|
|
|
36
36
|
}
|
|
37
37
|
return true;
|
|
38
38
|
}, {
|
|
39
|
-
message: '
|
|
39
|
+
message: 'validation.dateRange',
|
|
40
40
|
path: ['endDate', 'startDate'],
|
|
41
41
|
});
|
|
42
42
|
const GetOrderForClientListResponseSchema = zod_1.z.object({
|
|
@@ -9,7 +9,7 @@ const PriceCorrectionAnalyzeRequestSchema = zod_1.z
|
|
|
9
9
|
consignmentUUID: zod_1.z.string().uuid().optional(),
|
|
10
10
|
})
|
|
11
11
|
.refine(data => { var _a; return ((_a = data.productUUIDList) === null || _a === void 0 ? void 0 : _a.length) || data.consignmentUUID; }, {
|
|
12
|
-
message: '
|
|
12
|
+
message: 'validation.productListOrConsignment',
|
|
13
13
|
});
|
|
14
14
|
const PriceCorrectionAnalyzeResponseSchema = zod_1.z.object({
|
|
15
15
|
message: zod_1.z.string().optional(),
|
|
@@ -4,7 +4,7 @@ exports.CreateOrderProductClientContractCommand = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const schemas_1 = require("../../../schemas");
|
|
6
6
|
const CreateOrderProductClientRequestSchema = zod_1.z.object({
|
|
7
|
-
quantity: zod_1.z.number().positive({ message: '
|
|
7
|
+
quantity: zod_1.z.number().positive({ message: 'validation.quantityPositive' }),
|
|
8
8
|
optionUUID: zod_1.z.uuid().optional().nullable(),
|
|
9
9
|
});
|
|
10
10
|
const CreateOrderProductClientResponseSchema = zod_1.z.object({
|
|
@@ -12,7 +12,7 @@ const AnalyzeCopyPreOrdersResponseSchema = zod_1.z.object({
|
|
|
12
12
|
message: zod_1.z.string().optional(),
|
|
13
13
|
data: zod_1.z.object({
|
|
14
14
|
analyses: zod_1.z.array(schemas_1.CopyAnalysisSchema),
|
|
15
|
-
errorList: zod_1.z.array(
|
|
15
|
+
errorList: zod_1.z.array(schemas_1.ErrorMessageSchema).optional(),
|
|
16
16
|
}),
|
|
17
17
|
});
|
|
18
18
|
var AnalyzeCopyPreOrdersContractCommand;
|
package/build/commands/pre-order/group/analyze-create-pre-orders-from-standing-orders.command.js
CHANGED
|
@@ -21,7 +21,7 @@ const AnalyzeCreatePreOrdersFromStandingOrdersResponseSchema = zod_1.z.object({
|
|
|
21
21
|
})),
|
|
22
22
|
remainingQuantity: zod_1.z.number(),
|
|
23
23
|
})),
|
|
24
|
-
warnings: zod_1.z.record(zod_1.z.string(), zod_1.z.array(
|
|
24
|
+
warnings: zod_1.z.record(zod_1.z.string(), zod_1.z.array(schemas_1.ErrorMessageSchema)),
|
|
25
25
|
})),
|
|
26
26
|
errorList: zod_1.z
|
|
27
27
|
.array(zod_1.z.object({
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GroupCopyPreOrdersToCollectionContractCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const pre_order_product_schema_1 = require("../../../schemas/pre-order-product/pre-order-product.schema");
|
|
6
|
+
const error_message_schema_1 = require("../../../schemas/error-message.schema");
|
|
6
7
|
const GroupCopyPreOrdersToCollectionRequestSchema = zod_1.z.object({
|
|
7
8
|
preOrderUUIDList: zod_1.z.array(zod_1.z.uuid()),
|
|
8
9
|
targetPreOrderCollectionUUID: zod_1.z.uuid(),
|
|
@@ -21,7 +22,7 @@ const GroupCopyPreOrdersToCollectionResponseSchema = zod_1.z.object({
|
|
|
21
22
|
uuid: zod_1.z.string(),
|
|
22
23
|
preOrderNum: zod_1.z.number(),
|
|
23
24
|
}),
|
|
24
|
-
warnings: zod_1.z.array(
|
|
25
|
+
warnings: zod_1.z.array(error_message_schema_1.ErrorMessageSchema),
|
|
25
26
|
})),
|
|
26
27
|
failed: zod_1.z.array(zod_1.z.object({
|
|
27
28
|
sourcePreOrder: zod_1.z.object({
|
|
@@ -29,7 +30,7 @@ const GroupCopyPreOrdersToCollectionResponseSchema = zod_1.z.object({
|
|
|
29
30
|
preOrderNum: zod_1.z.number(),
|
|
30
31
|
clientName: zod_1.z.string(),
|
|
31
32
|
}),
|
|
32
|
-
error: zod_1.z.array(
|
|
33
|
+
error: zod_1.z.array(error_message_schema_1.ErrorMessageSchema),
|
|
33
34
|
})),
|
|
34
35
|
}),
|
|
35
36
|
});
|
package/build/commands/pre-order/group/group-create-pre-orders-from-standing-orders.command.js
CHANGED
|
@@ -15,7 +15,7 @@ const GroupCreatePreOrdersFromStandingOrdersResponseSchema = zod_1.z.object({
|
|
|
15
15
|
.object({
|
|
16
16
|
standingOrderUUID: zod_1.z.uuid(),
|
|
17
17
|
preOrders: schemas_1.PreOrderSchema.array(),
|
|
18
|
-
warnings: zod_1.z.
|
|
18
|
+
warnings: zod_1.z.array(schemas_1.ErrorMessageSchema),
|
|
19
19
|
})
|
|
20
20
|
.array(),
|
|
21
21
|
failed: zod_1.z
|
package/build/commands/pre-order-collection-item/execute-pre-order-collection-item-update.command.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExecutePreOrderCollectionItemUpdateContractCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const error_message_schema_1 = require("../../schemas/error-message.schema");
|
|
5
6
|
const OptionUpdateSchema = zod_1.z.object({
|
|
6
7
|
title: zod_1.z.string().nullable().optional(),
|
|
7
8
|
optionMultiplicity: zod_1.z.number().nullable().optional(),
|
|
@@ -37,9 +38,8 @@ const UpdateBatchResponseSchema = zod_1.z.object({
|
|
|
37
38
|
success: zod_1.z.boolean(),
|
|
38
39
|
successCount: zod_1.z.number(),
|
|
39
40
|
failedCount: zod_1.z.number(),
|
|
40
|
-
errors: zod_1.z.array(
|
|
41
|
+
errors: zod_1.z.array(error_message_schema_1.ErrorMessageSchema.extend({
|
|
41
42
|
uuid: zod_1.z.string(),
|
|
42
|
-
error: zod_1.z.string(),
|
|
43
43
|
})),
|
|
44
44
|
}),
|
|
45
45
|
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DeleteGroupProductContractCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const error_message_schema_1 = require("../../../schemas/error-message.schema");
|
|
5
6
|
const DeleteGroupProductRequestSchema = zod_1.z.object({
|
|
6
7
|
productUUIDList: zod_1.z.array(zod_1.z.string()),
|
|
7
8
|
});
|
|
@@ -9,10 +10,8 @@ const DeleteGroupProductResponseSchema = zod_1.z.object({
|
|
|
9
10
|
message: zod_1.z.string().optional(),
|
|
10
11
|
data: zod_1.z.object({
|
|
11
12
|
success: zod_1.z.boolean(),
|
|
12
|
-
warnings:
|
|
13
|
-
.object({
|
|
13
|
+
warnings: error_message_schema_1.ErrorMessageSchema.extend({
|
|
14
14
|
uuid: zod_1.z.string(),
|
|
15
|
-
message: zod_1.z.string().optional(),
|
|
16
15
|
})
|
|
17
16
|
.array()
|
|
18
17
|
.optional(),
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.UpdateGroupProductUpdateBatchContractCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const enum_1 = require("../../../enum");
|
|
6
|
+
const error_message_schema_1 = require("../../../schemas/error-message.schema");
|
|
6
7
|
const UpdateGroupProductUpdateBatchRequestSchema = zod_1.z.object({
|
|
7
8
|
productUUIDList: zod_1.z.array(zod_1.z.string()),
|
|
8
9
|
data: zod_1.z
|
|
@@ -32,9 +33,8 @@ const UpdateGroupProductUpdateBatchResponseSchema = zod_1.z.object({
|
|
|
32
33
|
successCount: zod_1.z.number().optional(),
|
|
33
34
|
failedCount: zod_1.z.number().optional(),
|
|
34
35
|
errors: zod_1.z
|
|
35
|
-
.array(
|
|
36
|
+
.array(error_message_schema_1.ErrorMessageSchema.extend({
|
|
36
37
|
productUUID: zod_1.z.uuid(),
|
|
37
|
-
message: zod_1.z.string(),
|
|
38
38
|
}))
|
|
39
39
|
.optional(),
|
|
40
40
|
}),
|
|
@@ -16,7 +16,7 @@ const ExportClientStatementRequestSchema = zod_1.z
|
|
|
16
16
|
}
|
|
17
17
|
return true;
|
|
18
18
|
}, {
|
|
19
|
-
message: '
|
|
19
|
+
message: 'validation.dateRange',
|
|
20
20
|
path: ['endDate', 'startDate'],
|
|
21
21
|
});
|
|
22
22
|
const ExportClientStatementResponseSchema = zod_1.z.object({
|
|
@@ -18,7 +18,7 @@ const ExportInventoryMovementRequestSchema = zod_1.z
|
|
|
18
18
|
}
|
|
19
19
|
return true;
|
|
20
20
|
}, {
|
|
21
|
-
message: '
|
|
21
|
+
message: 'validation.dateRange',
|
|
22
22
|
path: ['endDate', 'startDate'],
|
|
23
23
|
});
|
|
24
24
|
// Ответ для обычного отчета (по категориям)
|
|
@@ -17,7 +17,7 @@ const ExportInventoryTurnoverRequestSchema = zod_1.z
|
|
|
17
17
|
}
|
|
18
18
|
return true;
|
|
19
19
|
}, {
|
|
20
|
-
message: '
|
|
20
|
+
message: 'validation.dateRange',
|
|
21
21
|
path: ['endDate', 'startDate'],
|
|
22
22
|
});
|
|
23
23
|
// Ответ для обычного отчета (по категориям)
|
|
@@ -9,11 +9,11 @@ const ExportSalesByClientRequestSchema = zod_1.z
|
|
|
9
9
|
endDate: zod_1.z.coerce.date(),
|
|
10
10
|
})
|
|
11
11
|
.refine(value => (0, date_helper_1.dateRangeCheck)(value.startDate, value.endDate), {
|
|
12
|
-
message: '
|
|
12
|
+
message: 'validation.dateRange',
|
|
13
13
|
path: ['endDate', 'startDate'],
|
|
14
14
|
})
|
|
15
15
|
.refine(value => (0, date_helper_1.isStatementPeriodWithinLimit)(value.startDate, value.endDate), {
|
|
16
|
-
message: '
|
|
16
|
+
message: 'validation.reportPeriodMax',
|
|
17
17
|
path: ['endDate', 'startDate'],
|
|
18
18
|
});
|
|
19
19
|
const ExportSalesByClientResponseSchema = zod_1.z.object({
|
|
@@ -11,11 +11,11 @@ const ExportSalesByPositionRequestSchema = zod_1.z
|
|
|
11
11
|
groupBy: zod_1.z.nativeEnum(sales_by_position_group_by_enum_1.SalesByPositionGroupByEnum).default(sales_by_position_group_by_enum_1.SalesByPositionGroupByEnum.PRODUCT),
|
|
12
12
|
})
|
|
13
13
|
.refine(value => (0, date_helper_1.dateRangeCheck)(value.startDate, value.endDate), {
|
|
14
|
-
message: '
|
|
14
|
+
message: 'validation.dateRange',
|
|
15
15
|
path: ['endDate', 'startDate'],
|
|
16
16
|
})
|
|
17
17
|
.refine(value => (0, date_helper_1.isStatementPeriodWithinLimit)(value.startDate, value.endDate), {
|
|
18
|
-
message: '
|
|
18
|
+
message: 'validation.reportPeriodMax',
|
|
19
19
|
path: ['endDate', 'startDate'],
|
|
20
20
|
});
|
|
21
21
|
const ExportSalesByPositionResponseSchema = zod_1.z.object({
|
|
@@ -17,7 +17,7 @@ const ExportSalesRevenueRequestSchema = zod_1.z
|
|
|
17
17
|
}
|
|
18
18
|
return true;
|
|
19
19
|
}, {
|
|
20
|
-
message: '
|
|
20
|
+
message: 'validation.dateRange',
|
|
21
21
|
path: ['endDate', 'startDate'],
|
|
22
22
|
});
|
|
23
23
|
const ExportSalesRevenueResponseSchema = zod_1.z.object({
|
|
@@ -9,11 +9,11 @@ const GetDailyOrdersSummaryRequestSchema = zod_1.z
|
|
|
9
9
|
endDate: zod_1.z.coerce.date(),
|
|
10
10
|
})
|
|
11
11
|
.refine(value => (0, date_helper_1.dateRangeCheck)(value.startDate, value.endDate), {
|
|
12
|
-
message: '
|
|
12
|
+
message: 'validation.dateRange',
|
|
13
13
|
path: ['endDate', 'startDate'],
|
|
14
14
|
})
|
|
15
15
|
.refine(value => (0, date_helper_1.isStatementPeriodWithinLimit)(value.startDate, value.endDate), {
|
|
16
|
-
message: '
|
|
16
|
+
message: 'validation.reportPeriodMax',
|
|
17
17
|
path: ['endDate', 'startDate'],
|
|
18
18
|
});
|
|
19
19
|
const UnitsByMeasureSchema = zod_1.z.object({
|
|
@@ -17,7 +17,7 @@ const GetReportByClientWeeksRequestSchema = zod_1.z
|
|
|
17
17
|
}
|
|
18
18
|
return true;
|
|
19
19
|
}, {
|
|
20
|
-
message: '
|
|
20
|
+
message: 'validation.dateRange',
|
|
21
21
|
path: ['endDate', 'startDate'],
|
|
22
22
|
});
|
|
23
23
|
const GetReportGroupByClientResponseSchema = zod_1.z.object({
|
|
@@ -15,7 +15,7 @@ const GetReportForPeriodRequestSchema = zod_1.z
|
|
|
15
15
|
}
|
|
16
16
|
return true;
|
|
17
17
|
}, {
|
|
18
|
-
message: '
|
|
18
|
+
message: 'validation.dateRange',
|
|
19
19
|
path: ['endDate', 'startDate'],
|
|
20
20
|
});
|
|
21
21
|
const GetReportForPeriodResponseSchema = zod_1.z.object({
|
|
@@ -15,7 +15,7 @@ const GetReportGroupByClientRequestSchema = zod_1.z
|
|
|
15
15
|
}
|
|
16
16
|
return true;
|
|
17
17
|
}, {
|
|
18
|
-
message: '
|
|
18
|
+
message: 'validation.dateRange',
|
|
19
19
|
path: ['endDate', 'startDate'],
|
|
20
20
|
});
|
|
21
21
|
const GetReportGroupByClientResponseSchema = zod_1.z.object({
|
|
@@ -18,7 +18,7 @@ const GetReportGroupByPositionRequestSchema = zod_1.z
|
|
|
18
18
|
}
|
|
19
19
|
return true;
|
|
20
20
|
}, {
|
|
21
|
-
message: '
|
|
21
|
+
message: 'validation.dateRange',
|
|
22
22
|
path: ['endDate', 'startDate'],
|
|
23
23
|
});
|
|
24
24
|
const GetReportGroupByPositionResponseSchema = zod_1.z.object({
|
|
@@ -17,7 +17,7 @@ const GetSalesSummaryRequestSchema = zod_1.z
|
|
|
17
17
|
}
|
|
18
18
|
return true;
|
|
19
19
|
}, {
|
|
20
|
-
message: '
|
|
20
|
+
message: 'validation.dateRange',
|
|
21
21
|
path: ['endDate', 'startDate'],
|
|
22
22
|
});
|
|
23
23
|
const SalesSummaryTotalsSchema = zod_1.z.object({
|
|
@@ -20,7 +20,7 @@ const ExportTransactionsRequestSchema = zod_1.z
|
|
|
20
20
|
}
|
|
21
21
|
return true;
|
|
22
22
|
}, {
|
|
23
|
-
message: '
|
|
23
|
+
message: 'validation.dateRange',
|
|
24
24
|
path: ['endDate', 'startDate'],
|
|
25
25
|
});
|
|
26
26
|
const ExportTransactionsResponseSchema = zod_1.z.object({
|
|
@@ -16,7 +16,7 @@ const GetSumTransactionByMoneyAccountRequestSchema = zod_1.z
|
|
|
16
16
|
}
|
|
17
17
|
return true;
|
|
18
18
|
}, {
|
|
19
|
-
message: '
|
|
19
|
+
message: 'validation.dateRange',
|
|
20
20
|
path: ['endDate', 'startDate'],
|
|
21
21
|
});
|
|
22
22
|
const GetSumTransactionByMoneyAccountResponseSchema = zod_1.z.object({
|
|
@@ -24,7 +24,7 @@ const GetTransactionListRequestSchema = zod_1.z
|
|
|
24
24
|
}
|
|
25
25
|
return true;
|
|
26
26
|
}, {
|
|
27
|
-
message: '
|
|
27
|
+
message: 'validation.dateRange',
|
|
28
28
|
path: ['endDate', 'startDate'],
|
|
29
29
|
});
|
|
30
30
|
const GetTransactionListResponseSchema = zod_1.z.object({
|
|
@@ -21,7 +21,7 @@ const GetTransactionSummaryRequestSchema = zod_1.z
|
|
|
21
21
|
}
|
|
22
22
|
return true;
|
|
23
23
|
}, {
|
|
24
|
-
message: '
|
|
24
|
+
message: 'validation.dateRange',
|
|
25
25
|
path: ['endDate', 'startDate'],
|
|
26
26
|
});
|
|
27
27
|
const GetTransactionSummaryResponseSchema = zod_1.z.object({
|
|
@@ -23,7 +23,7 @@ const GetTransactionListForClientRequestSchema = zod_1.z
|
|
|
23
23
|
}
|
|
24
24
|
return true;
|
|
25
25
|
}, {
|
|
26
|
-
message: '
|
|
26
|
+
message: 'validation.dateRange',
|
|
27
27
|
path: ['endDate', 'startDate'],
|
|
28
28
|
});
|
|
29
29
|
const GetTransactionListForClientResponseSchema = zod_1.z.object({
|
|
@@ -5,6 +5,8 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const schemas_1 = require("../../schemas");
|
|
6
6
|
const CreateUserResponseSchema = zod_1.z.object({
|
|
7
7
|
message: zod_1.z.string().optional(),
|
|
8
|
+
code: zod_1.z.string().optional(),
|
|
9
|
+
i18nKey: zod_1.z.string().optional(),
|
|
8
10
|
data: schemas_1.UserSchema.optional(),
|
|
9
11
|
});
|
|
10
12
|
var CreateUserCommand;
|
|
@@ -14,12 +14,14 @@ const CreateUserByClientIdRequestSchema = zod_1.z.object({
|
|
|
14
14
|
roles: zod_1.z.array(zod_1.z.nativeEnum(enum_1.UserRoleEnum)).optional().default([enum_1.UserRoleEnum.BUYER]),
|
|
15
15
|
})
|
|
16
16
|
.refine(data => data.email || data.phone, {
|
|
17
|
-
message: '
|
|
17
|
+
message: 'validation.emailOrPhoneRequired',
|
|
18
18
|
}),
|
|
19
19
|
clientUuid: zod_1.z.uuid(),
|
|
20
20
|
});
|
|
21
21
|
const CreateUserByClientIdResponseSchema = zod_1.z.object({
|
|
22
22
|
message: zod_1.z.string().optional(),
|
|
23
|
+
code: zod_1.z.string().optional(),
|
|
24
|
+
i18nKey: zod_1.z.string().optional(),
|
|
23
25
|
data: schemas_1.UserSchema,
|
|
24
26
|
});
|
|
25
27
|
var CreateUserByClientIdCommand;
|
|
@@ -6,7 +6,7 @@ const schemas_1 = require("../../schemas");
|
|
|
6
6
|
const enum_1 = require("../../enum");
|
|
7
7
|
const UserRoles = zod_1.z.nativeEnum(enum_1.UserRoleEnum);
|
|
8
8
|
const AllowedRoles = UserRoles.refine(role => role !== enum_1.UserRoleEnum.BUYER, {
|
|
9
|
-
message: '
|
|
9
|
+
message: 'validation.allowedRoles',
|
|
10
10
|
});
|
|
11
11
|
const CreateUserForCompanyRequestSchema = schemas_1.UserSchema.pick({
|
|
12
12
|
email: true,
|
|
@@ -18,6 +18,8 @@ const CreateUserForCompanyRequestSchema = schemas_1.UserSchema.pick({
|
|
|
18
18
|
}));
|
|
19
19
|
const CreateUserForCompanyResponseSchema = zod_1.z.object({
|
|
20
20
|
message: zod_1.z.string().optional(),
|
|
21
|
+
code: zod_1.z.string().optional(),
|
|
22
|
+
i18nKey: zod_1.z.string().optional(),
|
|
21
23
|
data: schemas_1.UserSchema,
|
|
22
24
|
});
|
|
23
25
|
var CreateUserForCompanyCommand;
|
|
@@ -10,7 +10,7 @@ const ExportOvertimeRequestSchema = zod_1.z
|
|
|
10
10
|
userUUIDs: zod_1.z.array(zod_1.z.string().uuid()).optional(),
|
|
11
11
|
})
|
|
12
12
|
.refine(value => (0, date_helper_1.dateRangeCheck)(value.startDate, value.endDate), {
|
|
13
|
-
message: '
|
|
13
|
+
message: 'validation.dateRange',
|
|
14
14
|
path: ['endDate', 'startDate'],
|
|
15
15
|
});
|
|
16
16
|
const ExportOvertimeResponseSchema = zod_1.z.object({
|
|
@@ -16,7 +16,7 @@ const CreateWriteOffFromPendingRequestSchema = zod_1.z
|
|
|
16
16
|
}
|
|
17
17
|
return true;
|
|
18
18
|
}, {
|
|
19
|
-
message: '
|
|
19
|
+
message: 'validation.rejectionReasonRequired',
|
|
20
20
|
path: ['rejectionReason'],
|
|
21
21
|
});
|
|
22
22
|
const CreateWriteOffFromPendingResponseSchema = zod_1.z.object({
|
|
@@ -27,7 +27,7 @@ const GetWriteOffListRequestSchema = zod_1.z
|
|
|
27
27
|
}
|
|
28
28
|
return true;
|
|
29
29
|
}, {
|
|
30
|
-
message: '
|
|
30
|
+
message: 'validation.dateRange',
|
|
31
31
|
path: ['endDate', 'startDate'],
|
|
32
32
|
});
|
|
33
33
|
const GetWriteOffListResponseSchema = zod_1.z.object({
|
|
@@ -15,7 +15,7 @@ const UpdateWriteOffStatusRequestSchema = zod_1.z
|
|
|
15
15
|
}
|
|
16
16
|
return true;
|
|
17
17
|
}, {
|
|
18
|
-
message: '
|
|
18
|
+
message: 'validation.rejectionReasonRequired',
|
|
19
19
|
path: ['rejectionReason'],
|
|
20
20
|
});
|
|
21
21
|
const UpdateWriteOffStatusResponseSchema = zod_1.z.object({
|