@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
|
@@ -16,6 +16,7 @@ const GetOrderListRequestSchema = z
|
|
|
16
16
|
clientUUID: z.string().optional(),
|
|
17
17
|
searchQuery: z.string().optional(),
|
|
18
18
|
consignmentDeliveryDate: z.coerce.date().optional(),
|
|
19
|
+
deliveryDate: z.coerce.date().optional(),
|
|
19
20
|
byProductSearchQuery: z.string().optional(),
|
|
20
21
|
statuses: z.nativeEnum(OrderStatusEnum).array().optional(),
|
|
21
22
|
type: z.nativeEnum(OrderTypeEnum).optional(),
|
|
@@ -32,7 +33,7 @@ const GetOrderListRequestSchema = z
|
|
|
32
33
|
return true;
|
|
33
34
|
},
|
|
34
35
|
{
|
|
35
|
-
message: '
|
|
36
|
+
message: 'validation.dateRange',
|
|
36
37
|
path: ['endDate', 'startDate'],
|
|
37
38
|
},
|
|
38
39
|
);
|
|
@@ -7,7 +7,7 @@ const MergeOrdersRequestSchema = z
|
|
|
7
7
|
targetOrderUUID: z.string().uuid().optional(),
|
|
8
8
|
})
|
|
9
9
|
.refine(data => !data.targetOrderUUID || data.orderUUIDList.includes(data.targetOrderUUID), {
|
|
10
|
-
message: '
|
|
10
|
+
message: 'validation.targetOrderInList',
|
|
11
11
|
path: ['targetOrderUUID'],
|
|
12
12
|
});
|
|
13
13
|
|
|
@@ -21,10 +21,10 @@ const GetOrderForClientListRequestSchema = z
|
|
|
21
21
|
.nativeEnum(OrderStatusEnum)
|
|
22
22
|
.array()
|
|
23
23
|
.optional()
|
|
24
|
-
.transform(arr => (arr && arr.length === 0 ? OrderWebshopAvailableStatusList : arr ?? OrderWebshopAvailableStatusList))
|
|
24
|
+
.transform(arr => (arr && arr.length === 0 ? OrderWebshopAvailableStatusList : (arr ?? OrderWebshopAvailableStatusList)))
|
|
25
25
|
.default(OrderWebshopAvailableStatusList)
|
|
26
26
|
.refine(arr => arr.every(s => OrderWebshopAvailableStatusList.includes(s)), {
|
|
27
|
-
message: '
|
|
27
|
+
message: 'validation.statusNotAllowedWebshop',
|
|
28
28
|
}),
|
|
29
29
|
})
|
|
30
30
|
.refine(
|
|
@@ -36,7 +36,7 @@ const GetOrderForClientListRequestSchema = z
|
|
|
36
36
|
return true;
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
message: '
|
|
39
|
+
message: 'validation.dateRange',
|
|
40
40
|
path: ['endDate', 'startDate'],
|
|
41
41
|
},
|
|
42
42
|
);
|
|
@@ -7,7 +7,7 @@ const PriceCorrectionAnalyzeRequestSchema = z
|
|
|
7
7
|
consignmentUUID: z.string().uuid().optional(),
|
|
8
8
|
})
|
|
9
9
|
.refine(data => data.productUUIDList?.length || data.consignmentUUID, {
|
|
10
|
-
message: '
|
|
10
|
+
message: 'validation.productListOrConsignment',
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
const PriceCorrectionAnalyzeResponseSchema = z.object({
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { OrderProductForClientSchema } from '../../../schemas';
|
|
3
3
|
|
|
4
4
|
const CreateOrderProductClientRequestSchema = z.object({
|
|
5
|
-
quantity: z.number().positive({ message: '
|
|
5
|
+
quantity: z.number().positive({ message: 'validation.quantityPositive' }),
|
|
6
6
|
optionUUID: z.uuid().optional().nullable(),
|
|
7
7
|
});
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { MatchingConfigSchema, CopyAnalysisSchema } from '../../../schemas';
|
|
2
|
+
import { MatchingConfigSchema, CopyAnalysisSchema, ErrorMessageSchema } from '../../../schemas';
|
|
3
3
|
|
|
4
4
|
const AnalyzeCopyPreOrdersRequestSchema = z.object({
|
|
5
5
|
preOrderUUIDList: z.array(z.uuid()),
|
|
@@ -11,7 +11,7 @@ const AnalyzeCopyPreOrdersResponseSchema = z.object({
|
|
|
11
11
|
message: z.string().optional(),
|
|
12
12
|
data: z.object({
|
|
13
13
|
analyses: z.array(CopyAnalysisSchema),
|
|
14
|
-
errorList: z.array(
|
|
14
|
+
errorList: z.array(ErrorMessageSchema).optional(),
|
|
15
15
|
}),
|
|
16
16
|
});
|
|
17
17
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import {
|
|
3
|
+
ErrorMessageSchema,
|
|
3
4
|
MatchingConfigSchema,
|
|
4
5
|
PreOrderCollectionItemSchema,
|
|
5
6
|
PreOrderProductExtendedSchema,
|
|
@@ -31,7 +32,7 @@ const AnalyzeCreatePreOrdersFromStandingOrdersResponseSchema = z.object({
|
|
|
31
32
|
remainingQuantity: z.number(),
|
|
32
33
|
}),
|
|
33
34
|
),
|
|
34
|
-
warnings: z.record(z.string(), z.array(
|
|
35
|
+
warnings: z.record(z.string(), z.array(ErrorMessageSchema)),
|
|
35
36
|
}),
|
|
36
37
|
),
|
|
37
38
|
errorList: z
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { MatchingConfigSchema } from '../../../schemas/pre-order-product/pre-order-product.schema';
|
|
3
|
+
import { ErrorMessageSchema } from '../../../schemas/error-message.schema';
|
|
3
4
|
|
|
4
5
|
const GroupCopyPreOrdersToCollectionRequestSchema = z.object({
|
|
5
6
|
preOrderUUIDList: z.array(z.uuid()),
|
|
@@ -21,7 +22,7 @@ const GroupCopyPreOrdersToCollectionResponseSchema = z.object({
|
|
|
21
22
|
uuid: z.string(),
|
|
22
23
|
preOrderNum: z.number(),
|
|
23
24
|
}),
|
|
24
|
-
warnings: z.array(
|
|
25
|
+
warnings: z.array(ErrorMessageSchema),
|
|
25
26
|
}),
|
|
26
27
|
),
|
|
27
28
|
failed: z.array(
|
|
@@ -31,7 +32,7 @@ const GroupCopyPreOrdersToCollectionResponseSchema = z.object({
|
|
|
31
32
|
preOrderNum: z.number(),
|
|
32
33
|
clientName: z.string(),
|
|
33
34
|
}),
|
|
34
|
-
error: z.array(
|
|
35
|
+
error: z.array(ErrorMessageSchema),
|
|
35
36
|
}),
|
|
36
37
|
),
|
|
37
38
|
}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { MatchingConfigSchema, PreOrderSchema } from '../../../schemas';
|
|
2
|
+
import { ErrorMessageSchema, MatchingConfigSchema, PreOrderSchema } from '../../../schemas';
|
|
3
3
|
|
|
4
4
|
const GroupCreatePreOrdersFromStandingOrdersRequestSchema = z.object({
|
|
5
5
|
standingOrderUUIDs: z.uuid().array(),
|
|
@@ -14,7 +14,7 @@ const GroupCreatePreOrdersFromStandingOrdersResponseSchema = z.object({
|
|
|
14
14
|
.object({
|
|
15
15
|
standingOrderUUID: z.uuid(),
|
|
16
16
|
preOrders: PreOrderSchema.array(),
|
|
17
|
-
warnings: z.
|
|
17
|
+
warnings: z.array(ErrorMessageSchema),
|
|
18
18
|
})
|
|
19
19
|
.array(),
|
|
20
20
|
failed: z
|
package/commands/pre-order-collection-item/execute-pre-order-collection-item-update.command.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { ErrorMessageSchema } from '../../schemas/error-message.schema';
|
|
2
3
|
|
|
3
4
|
const OptionUpdateSchema = z.object({
|
|
4
5
|
title: z.string().nullable().optional(),
|
|
@@ -39,9 +40,8 @@ const UpdateBatchResponseSchema = z.object({
|
|
|
39
40
|
successCount: z.number(),
|
|
40
41
|
failedCount: z.number(),
|
|
41
42
|
errors: z.array(
|
|
42
|
-
|
|
43
|
+
ErrorMessageSchema.extend({
|
|
43
44
|
uuid: z.string(),
|
|
44
|
-
error: z.string(),
|
|
45
45
|
}),
|
|
46
46
|
),
|
|
47
47
|
}),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { ErrorMessageSchema } from '../../../schemas/error-message.schema';
|
|
2
3
|
|
|
3
4
|
const DeleteGroupProductRequestSchema = z.object({
|
|
4
5
|
productUUIDList: z.array(z.string()),
|
|
@@ -8,11 +9,9 @@ const DeleteGroupProductResponseSchema = z.object({
|
|
|
8
9
|
message: z.string().optional(),
|
|
9
10
|
data: z.object({
|
|
10
11
|
success: z.boolean(),
|
|
11
|
-
warnings:
|
|
12
|
-
.
|
|
13
|
-
|
|
14
|
-
message: z.string().optional(),
|
|
15
|
-
})
|
|
12
|
+
warnings: ErrorMessageSchema.extend({
|
|
13
|
+
uuid: z.string(),
|
|
14
|
+
})
|
|
16
15
|
.array()
|
|
17
16
|
.optional(),
|
|
18
17
|
}),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { SalesUnitEnum } from '../../../enum';
|
|
3
|
+
import { ErrorMessageSchema } from '../../../schemas/error-message.schema';
|
|
3
4
|
|
|
4
5
|
const UpdateGroupProductUpdateBatchRequestSchema = z.object({
|
|
5
6
|
productUUIDList: z.array(z.string()),
|
|
@@ -32,9 +33,8 @@ const UpdateGroupProductUpdateBatchResponseSchema = z.object({
|
|
|
32
33
|
failedCount: z.number().optional(),
|
|
33
34
|
errors: z
|
|
34
35
|
.array(
|
|
35
|
-
|
|
36
|
+
ErrorMessageSchema.extend({
|
|
36
37
|
productUUID: z.uuid(),
|
|
37
|
-
message: z.string(),
|
|
38
38
|
}),
|
|
39
39
|
)
|
|
40
40
|
.optional(),
|
|
@@ -7,11 +7,11 @@ const ExportSalesByClientRequestSchema = z
|
|
|
7
7
|
endDate: z.coerce.date(),
|
|
8
8
|
})
|
|
9
9
|
.refine(value => dateRangeCheck(value.startDate, value.endDate), {
|
|
10
|
-
message: '
|
|
10
|
+
message: 'validation.dateRange',
|
|
11
11
|
path: ['endDate', 'startDate'],
|
|
12
12
|
})
|
|
13
13
|
.refine(value => isStatementPeriodWithinLimit(value.startDate, value.endDate), {
|
|
14
|
-
message: '
|
|
14
|
+
message: 'validation.reportPeriodMax',
|
|
15
15
|
path: ['endDate', 'startDate'],
|
|
16
16
|
});
|
|
17
17
|
|
|
@@ -9,11 +9,11 @@ const ExportSalesByPositionRequestSchema = z
|
|
|
9
9
|
groupBy: z.nativeEnum(SalesByPositionGroupByEnum).default(SalesByPositionGroupByEnum.PRODUCT),
|
|
10
10
|
})
|
|
11
11
|
.refine(value => dateRangeCheck(value.startDate, value.endDate), {
|
|
12
|
-
message: '
|
|
12
|
+
message: 'validation.dateRange',
|
|
13
13
|
path: ['endDate', 'startDate'],
|
|
14
14
|
})
|
|
15
15
|
.refine(value => isStatementPeriodWithinLimit(value.startDate, value.endDate), {
|
|
16
|
-
message: '
|
|
16
|
+
message: 'validation.reportPeriodMax',
|
|
17
17
|
path: ['endDate', 'startDate'],
|
|
18
18
|
});
|
|
19
19
|
|
|
@@ -7,11 +7,11 @@ const GetDailyOrdersSummaryRequestSchema = z
|
|
|
7
7
|
endDate: z.coerce.date(),
|
|
8
8
|
})
|
|
9
9
|
.refine(value => dateRangeCheck(value.startDate, value.endDate), {
|
|
10
|
-
message: '
|
|
10
|
+
message: 'validation.dateRange',
|
|
11
11
|
path: ['endDate', 'startDate'],
|
|
12
12
|
})
|
|
13
13
|
.refine(value => isStatementPeriodWithinLimit(value.startDate, value.endDate), {
|
|
14
|
-
message: '
|
|
14
|
+
message: 'validation.reportPeriodMax',
|
|
15
15
|
path: ['endDate', 'startDate'],
|
|
16
16
|
});
|
|
17
17
|
|
|
@@ -18,7 +18,7 @@ const GetReportGroupByPositionRequestSchema = z
|
|
|
18
18
|
return true;
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
message: '
|
|
21
|
+
message: 'validation.dateRange',
|
|
22
22
|
path: ['endDate', 'startDate'],
|
|
23
23
|
},
|
|
24
24
|
);
|
|
@@ -45,7 +45,7 @@ const GetReportGroupByPositionResponseSchema = z.object({
|
|
|
45
45
|
middlePrice: z.number(),
|
|
46
46
|
grossProfit: z.number(),
|
|
47
47
|
marginality: z.number(),
|
|
48
|
-
})
|
|
48
|
+
}),
|
|
49
49
|
)
|
|
50
50
|
.optional(),
|
|
51
51
|
products: z
|
|
@@ -64,7 +64,7 @@ const GetReportGroupByPositionResponseSchema = z.object({
|
|
|
64
64
|
middlePrice: z.number(),
|
|
65
65
|
grossProfit: z.number(),
|
|
66
66
|
marginality: z.number(),
|
|
67
|
-
})
|
|
67
|
+
}),
|
|
68
68
|
)
|
|
69
69
|
.optional(),
|
|
70
70
|
}),
|
|
@@ -12,13 +12,15 @@ const CreateUserByClientIdRequestSchema = z.object({
|
|
|
12
12
|
roles: z.array(z.nativeEnum(UserRoleEnum)).optional().default([UserRoleEnum.BUYER]),
|
|
13
13
|
})
|
|
14
14
|
.refine(data => data.email || data.phone, {
|
|
15
|
-
message: '
|
|
15
|
+
message: 'validation.emailOrPhoneRequired',
|
|
16
16
|
}),
|
|
17
17
|
clientUuid: z.uuid(),
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
const CreateUserByClientIdResponseSchema = z.object({
|
|
21
21
|
message: z.string().optional(),
|
|
22
|
+
code: z.string().optional(),
|
|
23
|
+
i18nKey: z.string().optional(),
|
|
22
24
|
data: UserSchema,
|
|
23
25
|
});
|
|
24
26
|
|
|
@@ -4,7 +4,7 @@ import { UserRoleEnum } from '../../enum';
|
|
|
4
4
|
|
|
5
5
|
const UserRoles = z.nativeEnum(UserRoleEnum);
|
|
6
6
|
const AllowedRoles = UserRoles.refine(role => role !== UserRoleEnum.BUYER, {
|
|
7
|
-
message: '
|
|
7
|
+
message: 'validation.allowedRoles',
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
const CreateUserForCompanyRequestSchema = UserSchema.pick({
|
|
@@ -20,6 +20,8 @@ const CreateUserForCompanyRequestSchema = UserSchema.pick({
|
|
|
20
20
|
|
|
21
21
|
const CreateUserForCompanyResponseSchema = z.object({
|
|
22
22
|
message: z.string().optional(),
|
|
23
|
+
code: z.string().optional(),
|
|
24
|
+
i18nKey: z.string().optional(),
|
|
23
25
|
data: UserSchema,
|
|
24
26
|
});
|
|
25
27
|
|
|
@@ -7,13 +7,10 @@ const ExportOvertimeRequestSchema = z
|
|
|
7
7
|
endDate: z.coerce.date(),
|
|
8
8
|
userUUIDs: z.array(z.string().uuid()).optional(),
|
|
9
9
|
})
|
|
10
|
-
.refine(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
path: ['endDate', 'startDate'],
|
|
15
|
-
},
|
|
16
|
-
);
|
|
10
|
+
.refine(value => dateRangeCheck(value.startDate, value.endDate), {
|
|
11
|
+
message: 'validation.dateRange',
|
|
12
|
+
path: ['endDate', 'startDate'],
|
|
13
|
+
});
|
|
17
14
|
|
|
18
15
|
const ExportOvertimeResponseSchema = z.object({
|
|
19
16
|
data: z.object({
|
|
@@ -26,6 +26,59 @@ export const ErrorI18nKey = {
|
|
|
26
26
|
preOrderCollectionItemImportInvalidFileFormat: 'preOrderCollectionItemImport.invalidFileFormat',
|
|
27
27
|
preOrderCollectionItemImportMissingRequiredColumns: 'preOrderCollectionItemImport.missingRequiredColumns',
|
|
28
28
|
preOrderCollectionItemImportFailed: 'preOrderCollectionItemImport.failed',
|
|
29
|
+
|
|
30
|
+
// Bulk / group operations
|
|
31
|
+
bulkBatchTooLarge: 'bulk.batchTooLarge',
|
|
32
|
+
bulkProductNotFound: 'bulk.productNotFound',
|
|
33
|
+
bulkProductNotInConsignment: 'bulk.productNotInConsignment',
|
|
34
|
+
bulkProductUpdateFailed: 'bulk.productUpdateFailed',
|
|
35
|
+
bulkProductDeleteFailed: 'bulk.productDeleteFailed',
|
|
36
|
+
bulkProductInOrder: 'bulk.productInOrder',
|
|
37
|
+
bulkItemUpdateFailed: 'bulk.itemUpdateFailed',
|
|
38
|
+
bulkUuidNotProvided: 'bulk.uuidNotProvided',
|
|
39
|
+
|
|
40
|
+
// Pre-order → order conversion warnings
|
|
41
|
+
preOrderConvertProductNotFound: 'preOrderConvert.productNotFound',
|
|
42
|
+
preOrderConvertNotDistributed: 'preOrderConvert.notDistributed',
|
|
43
|
+
preOrderConvertAlreadyExists: 'preOrderConvert.alreadyExists',
|
|
44
|
+
|
|
45
|
+
// Category determination (import)
|
|
46
|
+
categoryNotDetermined: 'category.notDetermined',
|
|
47
|
+
|
|
48
|
+
// Standing-order import
|
|
49
|
+
standingOrderClientNotFound: 'standingOrderImport.clientNotFound',
|
|
50
|
+
standingOrderCategoryNotFound: 'standingOrderImport.categoryNotFound',
|
|
51
|
+
|
|
52
|
+
// Standing-order → pre-order conversion per-item warnings
|
|
53
|
+
soItemNotLinkedToCatalog: 'preOrderFromStandingOrder.itemNotLinkedToCatalog',
|
|
54
|
+
soItemNoMatches: 'preOrderFromStandingOrder.itemNoMatches',
|
|
55
|
+
soItemInsufficientQuantity: 'preOrderFromStandingOrder.itemInsufficientQuantity',
|
|
56
|
+
soItemPartiallyAllocated: 'preOrderFromStandingOrder.itemPartiallyAllocated',
|
|
57
|
+
soItemNotAddedInCollection: 'preOrderFromStandingOrder.itemNotAddedInCollection',
|
|
58
|
+
soProductNotCreated: 'preOrderFromStandingOrder.productNotCreated',
|
|
59
|
+
soCriticalError: 'preOrderFromStandingOrder.criticalError',
|
|
60
|
+
soNoPreOrdersCreated: 'preOrderFromStandingOrder.noPreOrdersCreated',
|
|
61
|
+
|
|
62
|
+
// Copy pre-order per-item warnings
|
|
63
|
+
preOrderCopyItemNoMatches: 'preOrderCopy.itemNoMatches',
|
|
64
|
+
preOrderCopyItemInsufficientQuantity: 'preOrderCopy.itemInsufficientQuantity',
|
|
65
|
+
preOrderCopySourceNotFoundOrEmpty: 'preOrderCopy.sourceNotFoundOrEmpty',
|
|
66
|
+
preOrderCopyProductCreateFailed: 'preOrderCopy.productCreateFailed',
|
|
67
|
+
|
|
68
|
+
// Auth
|
|
69
|
+
authTooManyFailedAttempts: 'auth.tooManyFailedAttempts',
|
|
70
|
+
|
|
71
|
+
// Order merge / move guards
|
|
72
|
+
mergeOrderTargetInSourceList: 'mergeOrder.targetInSourceList',
|
|
73
|
+
moveItemsSameOrder: 'moveItems.sameOrder',
|
|
74
|
+
|
|
75
|
+
// Invoice notification generation
|
|
76
|
+
invoiceNotificationInvalidType: 'invoiceNotification.invalidType',
|
|
77
|
+
invoiceNotificationOrderUuidMissing: 'invoiceNotification.orderUuidMissing',
|
|
78
|
+
|
|
79
|
+
// Neutral success
|
|
80
|
+
operationSuccess: 'common.operationSuccess',
|
|
81
|
+
accountDeletionRequestSubmitted: 'accountDeletionRequest.submitted',
|
|
29
82
|
} as const;
|
|
30
83
|
|
|
31
84
|
export type ErrorI18nKeyType = (typeof ErrorI18nKey)[keyof typeof ErrorI18nKey];
|