@floristcloud/api-lib 1.0.19 → 1.0.21
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/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/login-user.command.js +3 -3
- package/build/commands/auth/register-user.command.js +1 -1
- package/build/commands/auth/reset-password-by-security-code.command.js +1 -1
- package/build/commands/auth/reset-password-by-token.command.js +1 -1
- package/build/commands/auth/restore-password-by-security-code.command.js +1 -1
- package/build/commands/bank-payment/get-bank-payment-list.query.js +1 -1
- package/build/commands/bank-payment/update-bank-payment-status.query.js +1 -1
- package/build/commands/branch/delete-branch.command.js +1 -1
- package/build/commands/category/delete-category.command.js +1 -1
- package/build/commands/category/get-category-by-uuid.query.js +1 -1
- package/build/commands/category/get-category-list.query.js +3 -3
- package/build/commands/category/update-category-command.js +2 -2
- package/build/commands/category-alias/delete-category-alias.command.js +1 -1
- package/build/commands/category-alias/get-category-alias-by-uuid.query.js +1 -1
- package/build/commands/category-alias/update-category-alias.command.js +1 -1
- package/build/commands/client/create-client.command.js +3 -3
- package/build/commands/client/delete-client.command.js +1 -1
- package/build/commands/client/get-client-list.query.js +2 -2
- package/build/commands/client/marking/get-client-marking-by-client-list.command.js +2 -2
- package/build/commands/client/profile/get-client-individual-profile.query.js +1 -1
- package/build/commands/client/update-client.command.js +4 -4
- package/build/commands/client/webshop/register-client-webshop.command.js +2 -2
- package/build/commands/client/webshop/update-client-for-client.command.js +1 -1
- package/build/commands/company/deleteCompany.command.js +1 -1
- package/build/commands/company/getCompany.query.js +1 -1
- package/build/commands/consignment/create-consignment.command.js +1 -1
- package/build/commands/consignment/delete-consignment.command.js +1 -1
- package/build/commands/consignment/update-consignment.command.js +1 -1
- package/build/commands/consignment/upsert-access-clients-consignment.command.js +1 -1
- package/build/commands/delivery-route/attach-order-list-to-delivery-route.command.js +1 -1
- package/build/commands/delivery-route/detach-order-list-to-delivery-route.command.js +1 -1
- package/build/commands/delivery-route/get-delivery-route-list.query.js +1 -1
- package/build/commands/discount-rules/get-discount-rules-all.query.js +2 -2
- package/build/commands/message/get-context-unread-count.query.js +3 -3
- package/build/commands/message/get-contexts-with-unread.query.js +2 -2
- package/build/commands/message/list-context-messages.query.js +5 -5
- package/build/commands/message/mark-context-read.command.js +3 -3
- package/build/commands/message/send-context-message.command.js +3 -3
- package/build/commands/order/create-order.command.js +3 -3
- package/build/commands/order/get-order-list.query.js +2 -2
- package/build/commands/order/group/update-group-order-status.command.js +1 -1
- package/build/commands/order/group/update-group-order-type.command.js +1 -1
- package/build/commands/order/update-order.command.js +4 -4
- package/build/commands/order/webshop/update-cart.command.js +1 -1
- package/build/commands/order-delivery/update-order-delivery.command.js +1 -1
- package/build/commands/order-product/create-order-product.command.js +1 -1
- package/build/commands/order-product/group/update-group-order-product-order.command.js +1 -1
- package/build/commands/order-product/update-order-product.command.js +2 -2
- package/build/commands/order-product/webshop/create-order-product-for-client.command.js +1 -1
- package/build/commands/order-product/webshop/update-order-product-for-client.command.js +1 -1
- package/build/commands/package/get-package-filters-values.query.js +2 -2
- package/build/commands/package/reorder-packages.command.js +1 -1
- package/build/commands/pre-order/create-order-from-pre-order.command.js +1 -1
- package/build/commands/pre-order/get-pre-order-list.query.js +1 -1
- package/build/commands/pre-order/group/analyze-copy-pre-orders.command.js +2 -2
- package/build/commands/pre-order/group/analyze-create-orders-from-pre-orders.command.js +2 -2
- package/build/commands/pre-order/group/analyze-create-pre-orders-from-standing-orders.command.js +2 -2
- package/build/commands/pre-order/group/group-copy-pre-orders-to-collection.command.js +2 -2
- package/build/commands/pre-order/group/group-create-orders-from-pre-orders.command.js +4 -4
- package/build/commands/pre-order/group/group-create-pre-orders-from-standing-orders.command.js +4 -4
- package/build/commands/pre-order/webshop/get-pre-order-list-webshop.command.js +1 -1
- package/build/commands/pre-order-collection/get-pre-order-collection-list.query.js +1 -1
- package/build/commands/pre-order-collection/match-images-for-collection.command.js +1 -1
- package/build/commands/pre-order-collection-item/export-pre-order-collection-item-with-clients-vertical.query.js +1 -1
- package/build/commands/pre-order-collection-item/get-pre-order-collection-item-extended-with-clients-pre-order-product-list.query.js +1 -1
- package/build/commands/pre-order-collection-item/multiplicity-option/reorder-pre-order-collection-item-multiplicity-options.command.js +1 -1
- package/build/commands/product/get-product-quantity-calculate.query.js +1 -1
- package/build/commands/product/group/update-group-product-update-batch.command.js +1 -1
- package/build/commands/product/multiplicity-option/reorder-product-multiplicity-options.command.js +1 -1
- package/build/commands/product-configuration/get-product-configuration-list.query.js +1 -1
- package/build/commands/product-image/get-product-image-list.query.js +1 -1
- package/build/commands/report/export-client-statement.query.js +1 -1
- package/build/commands/report/export-inventory-movement.query.js +3 -3
- package/build/commands/report/export-inventory-stock.query.js +1 -1
- package/build/commands/report/export-inventory-turnover.query.js +1 -1
- package/build/commands/report/export-sales-revenue.query.js +1 -1
- package/build/commands/transaction/apply-prepayment-transaction.command.js +1 -1
- package/build/commands/transaction/export-transactions.command.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/type/delete-type.command.js +1 -1
- package/build/commands/type/get-type-by-uuid.query.js +1 -1
- package/build/commands/type/get-type-list.query.js +1 -1
- package/build/commands/user/createUserByClientId.command.js +3 -3
- package/build/commands/user/createUserForCompany.command.js +1 -1
- package/build/commands/user/get-user-list.query.js +2 -2
- package/build/commands/user/update-user.command.js +1 -1
- package/build/commands/wrire-off-archive/create-wrire-off-archive.command.js +1 -1
- package/build/commands/wrire-off-archive/info-wrire-off-archive.command.js +1 -1
- package/build/commands/write-off/get-write-off-list.query.js +1 -1
- package/build/constant/error.js +12 -0
- package/build/enum/index.js +2 -0
- package/build/schemas/action-log/action-log.schema.js +1 -1
- package/build/schemas/action-log/order-update-action-log.schema.js +2 -2
- package/build/schemas/action-log/transaction-info.schema.js +1 -1
- package/build/schemas/bank-payment/bank-payment.schema.js +6 -6
- package/build/schemas/branch/branch.schema.js +2 -2
- package/build/schemas/category/category.schema.js +2 -2
- package/build/schemas/category-alias/category-alias.schema.js +4 -4
- package/build/schemas/category-template/category-template.schema.js +2 -2
- package/build/schemas/client/client-debt.schema.js +1 -1
- package/build/schemas/client/client-individual-profile.schema.js +1 -1
- package/build/schemas/client/client-legal-profile.schema.js +2 -2
- package/build/schemas/client/client-marking.schema.js +1 -1
- package/build/schemas/client/client.schema.js +5 -5
- package/build/schemas/company/company.schema.js +2 -2
- package/build/schemas/consignment/consignment-distribution-validation.schema.js +2 -2
- package/build/schemas/consignment/consignment.schema.js +3 -3
- package/build/schemas/consignment-import-schema/consignment-import-schema.scheme.js +2 -2
- package/build/schemas/consignment-import-schema-relation/consignment-import-schema-relation.schema.js +3 -3
- package/build/schemas/delivery-route/delivery-route.schema.js +6 -6
- package/build/schemas/domain/domain.schema.js +1 -1
- package/build/schemas/message/client-inbox-item.schema.js +1 -1
- package/build/schemas/message/context-inbox.schema.js +4 -4
- package/build/schemas/message/context-message.schema.js +6 -6
- package/build/schemas/money-account/money-account.schema.js +3 -3
- package/build/schemas/order/order.schema.js +7 -7
- package/build/schemas/order-delivery/order-delivery.schema.js +2 -2
- package/build/schemas/order-product/order-product-multiplicity-optiom.schema.js +1 -1
- package/build/schemas/order-product/order-product.schema.js +5 -5
- package/build/schemas/package/package.schema.js +3 -3
- package/build/schemas/pre-order/pre-order.schema.js +2 -2
- package/build/schemas/pre-order-collection/pre-order-collection.schema.js +3 -3
- package/build/schemas/pre-order-collection-item/pre-order-collection-item.schema.js +3 -3
- package/build/schemas/pre-order-product/pre-order-product.schema.js +3 -3
- package/build/schemas/product/product-multiplicity-option.schema.js +1 -1
- package/build/schemas/product/product.schema.js +5 -5
- package/build/schemas/product-configuration/product-configuration.schema.js +3 -3
- package/build/schemas/product-in-package/product-in-package.schema.js +1 -1
- package/build/schemas/report/client-statement.schema.js +2 -2
- package/build/schemas/settings/settings.schema.js +18 -18
- package/build/schemas/transaction/transaction.schema.js +3 -3
- package/build/schemas/type/type.schema.js +2 -2
- package/build/schemas/type/typeList.schema.js +1 -1
- package/build/schemas/user/user.schema.js +5 -5
- package/build/schemas/write-off/write-off-image.schema.js +2 -2
- package/build/schemas/write-off/write-off.schema.js +2 -2
- 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/login-user.command.ts +3 -3
- package/commands/auth/register-user.command.ts +1 -1
- package/commands/auth/reset-password-by-security-code.command.ts +1 -1
- package/commands/auth/reset-password-by-token.command.ts +1 -1
- package/commands/auth/restore-password-by-security-code.command.ts +1 -1
- package/commands/bank-payment/get-bank-payment-list.query.ts +1 -1
- package/commands/bank-payment/update-bank-payment-status.query.ts +1 -1
- package/commands/branch/delete-branch.command.ts +1 -1
- package/commands/category/delete-category.command.ts +1 -1
- package/commands/category/get-category-by-uuid.query.ts +1 -1
- package/commands/category/get-category-list.query.ts +3 -3
- package/commands/category/update-category-command.ts +2 -2
- package/commands/category-alias/delete-category-alias.command.ts +1 -1
- package/commands/category-alias/get-category-alias-by-uuid.query.ts +1 -1
- package/commands/category-alias/update-category-alias.command.ts +1 -1
- package/commands/client/create-client.command.ts +3 -3
- package/commands/client/delete-client.command.ts +1 -1
- package/commands/client/get-client-list.query.ts +2 -2
- package/commands/client/marking/get-client-marking-by-client-list.command.ts +2 -2
- package/commands/client/profile/get-client-individual-profile.query.ts +1 -1
- package/commands/client/update-client.command.ts +4 -4
- package/commands/client/webshop/register-client-webshop.command.ts +2 -2
- package/commands/client/webshop/update-client-for-client.command.ts +1 -1
- package/commands/company/deleteCompany.command.ts +1 -1
- package/commands/company/getCompany.query.ts +1 -1
- package/commands/consignment/create-consignment.command.ts +1 -1
- package/commands/consignment/delete-consignment.command.ts +1 -1
- package/commands/consignment/update-consignment.command.ts +1 -1
- package/commands/consignment/upsert-access-clients-consignment.command.ts +1 -1
- package/commands/delivery-route/attach-order-list-to-delivery-route.command.ts +1 -1
- package/commands/delivery-route/detach-order-list-to-delivery-route.command.ts +1 -1
- package/commands/delivery-route/get-delivery-route-list.query.ts +1 -1
- package/commands/discount-rules/get-discount-rules-all.query.ts +2 -2
- package/commands/message/get-context-unread-count.query.ts +3 -3
- package/commands/message/get-contexts-with-unread.query.ts +2 -2
- package/commands/message/list-context-messages.query.ts +5 -5
- package/commands/message/mark-context-read.command.ts +3 -3
- package/commands/message/send-context-message.command.ts +3 -3
- package/commands/order/create-order.command.ts +3 -3
- package/commands/order/get-order-list.query.ts +2 -2
- package/commands/order/group/update-group-order-status.command.ts +1 -1
- package/commands/order/group/update-group-order-type.command.ts +1 -1
- package/commands/order/update-order.command.ts +4 -4
- package/commands/order/webshop/update-cart.command.ts +1 -1
- package/commands/order-delivery/update-order-delivery.command.ts +1 -1
- package/commands/order-product/create-order-product.command.ts +1 -1
- package/commands/order-product/group/update-group-order-product-order.command.ts +1 -1
- package/commands/order-product/update-order-product.command.ts +2 -2
- package/commands/order-product/webshop/create-order-product-for-client.command.ts +1 -1
- package/commands/order-product/webshop/update-order-product-for-client.command.ts +1 -1
- package/commands/package/get-package-filters-values.query.ts +2 -2
- package/commands/package/reorder-packages.command.ts +1 -1
- package/commands/pre-order/create-order-from-pre-order.command.ts +1 -1
- package/commands/pre-order/get-pre-order-list.query.ts +1 -1
- package/commands/pre-order/group/analyze-copy-pre-orders.command.ts +2 -2
- package/commands/pre-order/group/analyze-create-orders-from-pre-orders.command.ts +2 -2
- package/commands/pre-order/group/analyze-create-pre-orders-from-standing-orders.command.ts +2 -2
- package/commands/pre-order/group/group-copy-pre-orders-to-collection.command.ts +2 -2
- package/commands/pre-order/group/group-create-orders-from-pre-orders.command.ts +4 -4
- package/commands/pre-order/group/group-create-pre-orders-from-standing-orders.command.ts +4 -4
- package/commands/pre-order/webshop/get-pre-order-list-webshop.command.ts +1 -1
- package/commands/pre-order-collection/get-pre-order-collection-list.query.ts +1 -1
- package/commands/pre-order-collection/match-images-for-collection.command.ts +1 -1
- package/commands/pre-order-collection-item/export-pre-order-collection-item-with-clients-vertical.query.ts +1 -1
- package/commands/pre-order-collection-item/get-pre-order-collection-item-extended-with-clients-pre-order-product-list.query.ts +1 -1
- package/commands/pre-order-collection-item/multiplicity-option/reorder-pre-order-collection-item-multiplicity-options.command.ts +1 -1
- package/commands/product/get-product-quantity-calculate.query.ts +1 -1
- package/commands/product/group/update-group-product-update-batch.command.ts +1 -1
- package/commands/product/multiplicity-option/reorder-product-multiplicity-options.command.ts +1 -1
- package/commands/product-configuration/get-product-configuration-list.query.ts +1 -1
- package/commands/product-image/get-product-image-list.query.ts +1 -1
- package/commands/report/export-client-statement.query.ts +1 -1
- package/commands/report/export-inventory-movement.query.ts +3 -3
- package/commands/report/export-inventory-stock.query.ts +1 -1
- package/commands/report/export-inventory-turnover.query.ts +1 -1
- package/commands/report/export-sales-revenue.query.ts +1 -1
- package/commands/transaction/apply-prepayment-transaction.command.ts +1 -1
- package/commands/transaction/export-transactions.command.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/type/delete-type.command.ts +1 -1
- package/commands/type/get-type-by-uuid.query.ts +1 -1
- package/commands/type/get-type-list.query.ts +1 -1
- package/commands/user/createUserByClientId.command.ts +3 -3
- package/commands/user/createUserForCompany.command.ts +1 -1
- package/commands/user/get-user-list.query.ts +2 -2
- package/commands/user/update-user.command.ts +1 -1
- package/commands/wrire-off-archive/create-wrire-off-archive.command.ts +1 -1
- package/commands/wrire-off-archive/info-wrire-off-archive.command.ts +1 -1
- package/commands/write-off/get-write-off-list.query.ts +1 -1
- package/constant/error.ts +12 -0
- package/enum/index.ts +2 -0
- package/package.json +1 -1
- package/schemas/action-log/action-log.schema.ts +1 -1
- package/schemas/action-log/order-update-action-log.schema.ts +2 -2
- package/schemas/action-log/transaction-info.schema.ts +1 -1
- package/schemas/bank-payment/bank-payment.schema.ts +6 -6
- package/schemas/branch/branch.schema.ts +2 -2
- package/schemas/category/category.schema.ts +2 -2
- package/schemas/category-alias/category-alias.schema.ts +4 -4
- package/schemas/category-template/category-template.schema.ts +2 -2
- package/schemas/client/client-debt.schema.ts +1 -1
- package/schemas/client/client-individual-profile.schema.ts +1 -1
- package/schemas/client/client-legal-profile.schema.ts +2 -2
- package/schemas/client/client-marking.schema.ts +1 -1
- package/schemas/client/client.schema.ts +5 -5
- package/schemas/company/company.schema.ts +2 -2
- package/schemas/consignment/consignment-distribution-validation.schema.ts +2 -2
- package/schemas/consignment/consignment.schema.ts +3 -3
- package/schemas/consignment-import-schema/consignment-import-schema.scheme.ts +2 -2
- package/schemas/consignment-import-schema-relation/consignment-import-schema-relation.schema.ts +3 -3
- package/schemas/delivery-route/delivery-route.schema.ts +6 -6
- package/schemas/domain/domain.schema.ts +1 -1
- package/schemas/message/client-inbox-item.schema.ts +1 -1
- package/schemas/message/context-inbox.schema.ts +4 -4
- package/schemas/message/context-message.schema.ts +6 -6
- package/schemas/money-account/money-account.schema.ts +3 -3
- package/schemas/order/order.schema.ts +7 -7
- package/schemas/order-delivery/order-delivery.schema.ts +2 -2
- package/schemas/order-product/order-product-multiplicity-optiom.schema.ts +1 -1
- package/schemas/order-product/order-product.schema.ts +5 -5
- package/schemas/package/package.schema.ts +3 -3
- package/schemas/pre-order/pre-order.schema.ts +2 -2
- package/schemas/pre-order-collection/pre-order-collection.schema.ts +3 -3
- package/schemas/pre-order-collection-item/pre-order-collection-item.schema.ts +3 -3
- package/schemas/pre-order-product/pre-order-product.schema.ts +3 -3
- package/schemas/product/product-multiplicity-option.schema.ts +1 -1
- package/schemas/product/product.schema.ts +5 -5
- package/schemas/product-configuration/product-configuration.schema.ts +3 -3
- package/schemas/product-in-package/product-in-package.schema.ts +1 -1
- package/schemas/report/client-statement.schema.ts +2 -2
- package/schemas/settings/settings.schema.ts +18 -18
- package/schemas/transaction/transaction.schema.ts +3 -3
- package/schemas/type/type.schema.ts +2 -2
- package/schemas/type/typeList.schema.ts +1 -1
- package/schemas/user/user.schema.ts +5 -5
- package/schemas/write-off/write-off-image.schema.ts +2 -2
- package/schemas/write-off/write-off.schema.ts +2 -2
|
@@ -7,14 +7,14 @@ const CreateUserByClientIdRequestSchema = z.object({
|
|
|
7
7
|
.object({
|
|
8
8
|
password: z.string(),
|
|
9
9
|
name: z.string(),
|
|
10
|
-
email: z.
|
|
10
|
+
email: z.email().toLowerCase().nullable().optional(),
|
|
11
11
|
phone: z.string().nullable().optional(),
|
|
12
|
-
roles: z.array(z.
|
|
12
|
+
roles: z.array(z.enum(UserRoleEnum)).optional().default([UserRoleEnum.BUYER]),
|
|
13
13
|
})
|
|
14
14
|
.refine(data => data.email || data.phone, {
|
|
15
15
|
message: 'Either email or phone must be provided',
|
|
16
16
|
}),
|
|
17
|
-
clientUuid: z.
|
|
17
|
+
clientUuid: z.uuid(),
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
const CreateUserByClientIdResponseSchema = z.object({
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { UserSchema } from '../../schemas';
|
|
3
3
|
import { UserRoleEnum } from '../../enum';
|
|
4
4
|
|
|
5
|
-
const UserRoles = z.
|
|
5
|
+
const UserRoles = z.enum(UserRoleEnum);
|
|
6
6
|
const AllowedRoles = UserRoles.refine(role => role !== UserRoleEnum.BUYER, {
|
|
7
7
|
message: 'Allowed roles are: Admin, Manager, Employee',
|
|
8
8
|
});
|
|
@@ -7,8 +7,8 @@ const GetUserListRequestSchema = z.object({
|
|
|
7
7
|
page: z.coerce.number().optional().default(1),
|
|
8
8
|
count: z.coerce.number().optional().default(10),
|
|
9
9
|
searchQuery: z.string().optional().nullable().default(null),
|
|
10
|
-
orderBy: z.
|
|
11
|
-
roles: z.array(z.
|
|
10
|
+
orderBy: z.enum(OrderByEnum).default(OrderByEnum.ASC),
|
|
11
|
+
roles: z.array(z.enum(UserRoleEnum)).optional().nullable().default(null),
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
const GetUserListResponseSchema = z.object({
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { UserSchema } from '../../schemas';
|
|
3
3
|
|
|
4
4
|
const UpdateUserRequestSchema = z.object({
|
|
5
|
-
email: z.
|
|
5
|
+
email: z.email().toLowerCase().nullable().optional(),
|
|
6
6
|
name: z.string().optional(),
|
|
7
7
|
phone: z.string().nullable().optional(),
|
|
8
8
|
});
|
|
@@ -7,7 +7,7 @@ const CreateWriteOffArchiveResponseSchema = z.object({
|
|
|
7
7
|
message: z.string().optional(),
|
|
8
8
|
data: z
|
|
9
9
|
.object({
|
|
10
|
-
status: z.
|
|
10
|
+
status: z.enum(ConsignmentWriteOffArchivesStatusEnum),
|
|
11
11
|
url: z.string().nullable().optional(),
|
|
12
12
|
})
|
|
13
13
|
.nullable(),
|
|
@@ -7,7 +7,7 @@ const InfoWriteOffArchiveResponseSchema = z.object({
|
|
|
7
7
|
message: z.string().optional(),
|
|
8
8
|
data: z
|
|
9
9
|
.object({
|
|
10
|
-
status: z.
|
|
10
|
+
status: z.enum(ConsignmentWriteOffArchivesStatusEnum),
|
|
11
11
|
url: z.string().nullable().optional(),
|
|
12
12
|
})
|
|
13
13
|
.nullable(),
|
|
@@ -10,7 +10,7 @@ const GetWriteOffListRequestSchema = z.object({
|
|
|
10
10
|
clientUUID: z.string().optional(),
|
|
11
11
|
searchQuery: z.string().optional(),
|
|
12
12
|
responsibleUserUUID: z.string().optional(),
|
|
13
|
-
status: z.
|
|
13
|
+
status: z.enum(WriteOffStatusEnum).optional(),
|
|
14
14
|
page: z.coerce.number().optional().default(1),
|
|
15
15
|
count: z.coerce.number().optional().default(10),
|
|
16
16
|
});
|
package/constant/error.ts
CHANGED
|
@@ -205,6 +205,8 @@ export const ERRORS = {
|
|
|
205
205
|
httpCode: 400,
|
|
206
206
|
},
|
|
207
207
|
PRODUCT_MULTIPLICITY_OPTION_NOT_FOUND: { code: 'P017', message: 'Product multiplicity option not found', httpCode: 404 },
|
|
208
|
+
PRODUCT_MULTIPLICITY_OPTION_USED_IN_ORDER: { code: 'P018', message: 'Product multiplicity option used in order', httpCode: 400 },
|
|
209
|
+
PRODUCT_MULTIPLICITY_OPTION_NOT_DELETED: { code: 'P019', message: 'Failed to delete product multiplicity option', httpCode: 500 },
|
|
208
210
|
|
|
209
211
|
// PRODUCT CONFIGURATION
|
|
210
212
|
PRODUCT_CONFIGURATION_NOT_CREATED: { code: 'PCFG001', message: 'Failed to create product configuration', httpCode: 500 },
|
|
@@ -715,6 +717,16 @@ export const ERRORS = {
|
|
|
715
717
|
httpCode: 400,
|
|
716
718
|
},
|
|
717
719
|
PRE_ORDER_COLLECTION_ITEM_EXPORT_FAILED: { code: 'POCI017', message: 'Failed to export pre order collection item', httpCode: 500 },
|
|
720
|
+
PRE_ORDER_COLLECTION_ITEM_MULTIPLICITY_OPTION_USED_IN_PRE_ORDER: {
|
|
721
|
+
code: 'POCI018',
|
|
722
|
+
message: 'Multiplicity option used in pre order',
|
|
723
|
+
httpCode: 400,
|
|
724
|
+
},
|
|
725
|
+
PRE_ORDER_COLLECTION_ITEM_MULTIPLICITY_OPTION_NOT_DELETED: {
|
|
726
|
+
code: 'POCI019',
|
|
727
|
+
message: 'Failed to delete multiplicity option',
|
|
728
|
+
httpCode: 500,
|
|
729
|
+
},
|
|
718
730
|
|
|
719
731
|
// EMPLOYEE SCHEDULE
|
|
720
732
|
EMPLOYEE_SCHEDULE_NOT_CREATED: { code: 'ES001', message: 'Failed to create employee schedule', httpCode: 500 },
|
package/enum/index.ts
CHANGED
|
@@ -26,6 +26,8 @@ export * from './discount-rules-type.enum';
|
|
|
26
26
|
export * from './discount-rules-mode-type.enum';
|
|
27
27
|
export * from './order-distribute-status-list';
|
|
28
28
|
export * from './order-active-status-list';
|
|
29
|
+
export * from './client-status.enum';
|
|
30
|
+
export * from './client-type.enum';
|
|
29
31
|
export * from './consignment-distribution-validation-status.enum';
|
|
30
32
|
export * from './consignment-distribution-validation-type.enum';
|
|
31
33
|
export * from './consignment-access-client-status.enum';
|
package/package.json
CHANGED
|
@@ -96,7 +96,7 @@ export const ActionLogSchema = z.discriminatedUnion('actionType', [
|
|
|
96
96
|
]);
|
|
97
97
|
|
|
98
98
|
export const CreateActionLogSchema = z.object({
|
|
99
|
-
actionType: z.
|
|
99
|
+
actionType: z.enum(ActionLogTypeEnum),
|
|
100
100
|
entityUUID: z.string(),
|
|
101
101
|
});
|
|
102
102
|
|
|
@@ -2,6 +2,6 @@ import { z } from 'zod';
|
|
|
2
2
|
import { OrderStatusEnum } from '../../enum';
|
|
3
3
|
|
|
4
4
|
export const OrderUpdateActionLogSchema = z.object({
|
|
5
|
-
oldStatus: z.
|
|
6
|
-
newStatus: z.
|
|
5
|
+
oldStatus: z.enum(OrderStatusEnum),
|
|
6
|
+
newStatus: z.enum(OrderStatusEnum),
|
|
7
7
|
});
|
|
@@ -3,22 +3,22 @@ import { BankProviderEnum } from '../../enum/bank-provider.enum';
|
|
|
3
3
|
import { BankPaymentEventStatusEnum } from '../../enum/bank-payment-event-status.enum';
|
|
4
4
|
|
|
5
5
|
export const BankPaymentSchema = z.object({
|
|
6
|
-
uuid: z.
|
|
7
|
-
provider: z.
|
|
6
|
+
uuid: z.uuid(),
|
|
7
|
+
provider: z.enum(BankProviderEnum),
|
|
8
8
|
externalEventId: z.string(),
|
|
9
9
|
accountNumber: z.string(),
|
|
10
10
|
amount: z.coerce.number(),
|
|
11
11
|
currency: z.string(),
|
|
12
12
|
purpose: z.string(),
|
|
13
|
-
status: z.
|
|
13
|
+
status: z.enum(BankPaymentEventStatusEnum),
|
|
14
14
|
docNumber: z.string().nullable(),
|
|
15
15
|
clientName: z.string().nullable(),
|
|
16
16
|
clientInn: z.string().nullable(),
|
|
17
17
|
valueDate: z.coerce.date(),
|
|
18
|
-
clientUUID: z.
|
|
19
|
-
moneyAccountUUID: z.
|
|
18
|
+
clientUUID: z.uuid().nullable(),
|
|
19
|
+
moneyAccountUUID: z.uuid().nullable(),
|
|
20
20
|
moneyAccountName: z.string().nullable(),
|
|
21
21
|
payload: z.unknown(),
|
|
22
|
-
appliedTransactionUUID: z.
|
|
22
|
+
appliedTransactionUUID: z.uuid().nullable(),
|
|
23
23
|
receivedAt: z.coerce.date(),
|
|
24
24
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
export const BranchSchema = z.object({
|
|
4
|
-
uuid: z.
|
|
4
|
+
uuid: z.uuid(),
|
|
5
5
|
name: z.string(),
|
|
6
6
|
contactName: z.string().nullable(),
|
|
7
7
|
contactPhone: z.string().nullable(),
|
|
@@ -9,7 +9,7 @@ export const BranchSchema = z.object({
|
|
|
9
9
|
city: z.string().nullable(),
|
|
10
10
|
region: z.string().nullable(),
|
|
11
11
|
country: z.string().nullable(),
|
|
12
|
-
clientId: z.
|
|
12
|
+
clientId: z.uuid(),
|
|
13
13
|
createdAt: z.date(),
|
|
14
14
|
updatedAt: z.date(),
|
|
15
15
|
});
|
|
@@ -3,12 +3,12 @@ import { CategoryStatusEnum } from '../../enum/category-status.enum';
|
|
|
3
3
|
import { TypeSchema } from '../type/type.schema';
|
|
4
4
|
|
|
5
5
|
export const CategorySchema = z.object({
|
|
6
|
-
uuid: z.
|
|
6
|
+
uuid: z.uuid(),
|
|
7
7
|
name: z.string(),
|
|
8
8
|
multiplicity: z.number().nullable(),
|
|
9
9
|
isSizeSeparate: z.boolean(),
|
|
10
10
|
isSaveCategoryName: z.boolean(),
|
|
11
|
-
status: z.
|
|
11
|
+
status: z.enum(CategoryStatusEnum),
|
|
12
12
|
createdAt: z.date(),
|
|
13
13
|
updatedAt: z.date(),
|
|
14
14
|
deletedAt: z.date().nullable(),
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
export const CategoryAliasSchema = z.object({
|
|
4
|
-
uuid: z.
|
|
4
|
+
uuid: z.uuid(),
|
|
5
5
|
name: z.string(),
|
|
6
|
-
companyUUID: z.
|
|
7
|
-
categoryUUID: z.
|
|
6
|
+
companyUUID: z.uuid(),
|
|
7
|
+
categoryUUID: z.uuid(),
|
|
8
8
|
deletedAt: z.date().nullable(),
|
|
9
9
|
createdAt: z.date(),
|
|
10
10
|
updatedAt: z.date(),
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
export const AliasInListSchema = z.object({
|
|
14
|
-
uuid: z.
|
|
14
|
+
uuid: z.uuid(),
|
|
15
15
|
name: z.string(),
|
|
16
16
|
});
|
|
@@ -7,11 +7,11 @@ export const CategoryTemplateTypeSchema = z.object({
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
export const CategoryTemplateSchema = z.object({
|
|
10
|
-
uuid: z.
|
|
10
|
+
uuid: z.uuid(),
|
|
11
11
|
name: z.string(),
|
|
12
12
|
alias: z.string().array(),
|
|
13
13
|
type: CategoryTemplateTypeSchema,
|
|
14
|
-
language: z.
|
|
14
|
+
language: z.enum(LanguageEnum),
|
|
15
15
|
deletedAt: z.date().nullable(),
|
|
16
16
|
createdAt: z.date(),
|
|
17
17
|
updatedAt: z.date(),
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { ClientLegalTypeEnum } from '../../enum';
|
|
3
3
|
|
|
4
4
|
export const ClientLegalProfileSchema = z.object({
|
|
5
|
-
uuid: z.
|
|
5
|
+
uuid: z.uuid(),
|
|
6
6
|
fullCompanyName: z.string().nullable(),
|
|
7
7
|
taxId: z.string().nullable(),
|
|
8
8
|
ogrn: z.string().nullable(),
|
|
@@ -17,7 +17,7 @@ export const ClientLegalProfileSchema = z.object({
|
|
|
17
17
|
edoUsage: z.boolean(),
|
|
18
18
|
edoId: z.string().nullable(),
|
|
19
19
|
address: z.string().nullable(),
|
|
20
|
-
legalType: z.
|
|
20
|
+
legalType: z.enum(ClientLegalTypeEnum),
|
|
21
21
|
createdAt: z.date(),
|
|
22
22
|
updatedAt: z.date(),
|
|
23
23
|
});
|
|
@@ -8,12 +8,12 @@ import { DiscountRulesSchema } from '../discount-rules/discount-rules.schema';
|
|
|
8
8
|
import { ClientMarkingSchema } from './client-marking.schema';
|
|
9
9
|
|
|
10
10
|
export const ClientSchema = z.object({
|
|
11
|
-
uuid: z.
|
|
11
|
+
uuid: z.uuid(),
|
|
12
12
|
name: z.string(),
|
|
13
13
|
contactName: z.string().nullable(),
|
|
14
14
|
phone: z.string().nullable(),
|
|
15
15
|
email: z.string().nullable(),
|
|
16
|
-
status: z.
|
|
16
|
+
status: z.enum(ClientStatusEnum),
|
|
17
17
|
isCommon: z.boolean(),
|
|
18
18
|
contractNumber: z.string().nullable(),
|
|
19
19
|
contractDate: z.date().nullable(),
|
|
@@ -31,10 +31,10 @@ export const ClientSchema = z.object({
|
|
|
31
31
|
deletedAt: z.date().nullable(),
|
|
32
32
|
createdAt: z.date(),
|
|
33
33
|
updatedAt: z.date(),
|
|
34
|
-
companyUUID: z.
|
|
34
|
+
companyUUID: z.uuid(),
|
|
35
35
|
|
|
36
|
-
clientType: z.
|
|
37
|
-
responsibleUserUUID: z.
|
|
36
|
+
clientType: z.enum(ClientTypeEnum),
|
|
37
|
+
responsibleUserUUID: z.uuid().nullable(),
|
|
38
38
|
responsibleSince: z.date().nullable(),
|
|
39
39
|
});
|
|
40
40
|
|
|
@@ -2,10 +2,10 @@ import { z } from 'zod';
|
|
|
2
2
|
import { CompanyStatusEnum } from '../../enum/companyStatus.enum';
|
|
3
3
|
|
|
4
4
|
export const CompanySchema = z.object({
|
|
5
|
-
uuid: z.
|
|
5
|
+
uuid: z.uuid(),
|
|
6
6
|
name: z.string(),
|
|
7
7
|
alias: z.string(),
|
|
8
|
-
status: z.
|
|
8
|
+
status: z.enum(CompanyStatusEnum),
|
|
9
9
|
deletedAt: z.date().nullable(),
|
|
10
10
|
createdAt: z.date(),
|
|
11
11
|
updatedAt: z.date(),
|
|
@@ -6,14 +6,14 @@ import { OrderProductExtendedSchema } from '../order-product/order-product.schem
|
|
|
6
6
|
export const ValidationProductSchema = z.object({
|
|
7
7
|
type: z.literal(ConsignmentDistributionValidationTypeEnum.PACKAGE),
|
|
8
8
|
product: ProductSchema,
|
|
9
|
-
status: z.
|
|
9
|
+
status: z.enum(ConsignmentDistributionValidationStatusEnum),
|
|
10
10
|
quantity: z.number(),
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
export const ValidationDistributionSchema = z.object({
|
|
14
14
|
type: z.literal(ConsignmentDistributionValidationTypeEnum.DISTRIBUTION),
|
|
15
15
|
orderProduct: OrderProductExtendedSchema,
|
|
16
|
-
status: z.
|
|
16
|
+
status: z.enum(ConsignmentDistributionValidationStatusEnum),
|
|
17
17
|
quantity: z.number(),
|
|
18
18
|
});
|
|
19
19
|
|
|
@@ -3,7 +3,7 @@ import { ConsignmentImportSchemaRelationEntityPropertyEnum, ConsignmentStatusEnu
|
|
|
3
3
|
import { ClientSchema } from '../client';
|
|
4
4
|
|
|
5
5
|
export const ConsignmentSchema = z.object({
|
|
6
|
-
uuid: z.
|
|
6
|
+
uuid: z.uuid(),
|
|
7
7
|
deliveryDate: z.date(),
|
|
8
8
|
id: z.number(),
|
|
9
9
|
deliveryTime: z.string().nullable(),
|
|
@@ -11,7 +11,7 @@ export const ConsignmentSchema = z.object({
|
|
|
11
11
|
description: z.string().nullable(),
|
|
12
12
|
label: z.string().nullable(),
|
|
13
13
|
isInStock: z.boolean(),
|
|
14
|
-
status: z.
|
|
14
|
+
status: z.enum(ConsignmentStatusEnum),
|
|
15
15
|
url: z.string().nullable(),
|
|
16
16
|
isWithSync: z.boolean(),
|
|
17
17
|
createdAt: z.date(),
|
|
@@ -44,7 +44,7 @@ export const ConsignmentWithStatisticSchema = ConsignmentSchema.extend({
|
|
|
44
44
|
|
|
45
45
|
export const ProductErrorTypeSchema = z.object({
|
|
46
46
|
row: z.number().optional(),
|
|
47
|
-
path: z.
|
|
47
|
+
path: z.enum(ConsignmentImportSchemaRelationEntityPropertyEnum).optional(),
|
|
48
48
|
type: z.union([z.literal(ConsingmentImportErrorsEnum.REQUIRED), z.literal(ConsingmentImportErrorsEnum.INVALID_VALUE)]),
|
|
49
49
|
});
|
|
50
50
|
|
|
@@ -2,10 +2,10 @@ import { z } from 'zod';
|
|
|
2
2
|
import { ConsignmentImportSchemaRelationSchema } from '../consignment-import-schema-relation/consignment-import-schema-relation.schema';
|
|
3
3
|
|
|
4
4
|
export const ConsignmentImportSchema = z.object({
|
|
5
|
-
uuid: z.
|
|
5
|
+
uuid: z.uuid(),
|
|
6
6
|
name: z.string(),
|
|
7
7
|
isDefault: z.boolean(),
|
|
8
|
-
companyUUID: z.
|
|
8
|
+
companyUUID: z.uuid(),
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
export const ConsignmentImportSchemaExtendedSchema = ConsignmentImportSchema.merge(
|
package/schemas/consignment-import-schema-relation/consignment-import-schema-relation.schema.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { z } from 'zod';
|
|
|
2
2
|
import { ConsignmentImportSchemaRelationEntityPropertyEnum } from '../../enum';
|
|
3
3
|
|
|
4
4
|
export const ConsignmentImportSchemaRelationSchema = z.object({
|
|
5
|
-
uuid: z.
|
|
6
|
-
entityProperty: z.
|
|
5
|
+
uuid: z.uuid(),
|
|
6
|
+
entityProperty: z.enum(ConsignmentImportSchemaRelationEntityPropertyEnum),
|
|
7
7
|
externalName: z.string(),
|
|
8
8
|
isRequire: z.boolean(),
|
|
9
|
-
consignmentImportSchemaUUID: z.
|
|
9
|
+
consignmentImportSchemaUUID: z.uuid(),
|
|
10
10
|
});
|
|
@@ -2,12 +2,12 @@ import { z } from 'zod';
|
|
|
2
2
|
import { DeliveryRouteStatusEnum, OrderDeliveryStatusEnum, OrderStatusEnum } from '../../enum';
|
|
3
3
|
|
|
4
4
|
export const DeliveryRouteSchema = z.object({
|
|
5
|
-
uuid: z.
|
|
5
|
+
uuid: z.uuid(),
|
|
6
6
|
routeName: z.string().nullable(),
|
|
7
7
|
driverName: z.string().nullable(),
|
|
8
8
|
driverPhone: z.string().nullable(),
|
|
9
9
|
comment: z.string().nullable(),
|
|
10
|
-
status: z.
|
|
10
|
+
status: z.enum(DeliveryRouteStatusEnum),
|
|
11
11
|
date: z.coerce.date(),
|
|
12
12
|
createdAt: z.coerce.date(),
|
|
13
13
|
updatedAt: z.coerce.date(),
|
|
@@ -30,9 +30,9 @@ export const UpdateDeliveryRouteSchema = DeliveryRouteSchema.omit({
|
|
|
30
30
|
export const DeliveryRouteWithOrdersSchema = DeliveryRouteSchema.extend({
|
|
31
31
|
orders: z.array(
|
|
32
32
|
z.object({
|
|
33
|
-
uuid: z.
|
|
33
|
+
uuid: z.uuid(),
|
|
34
34
|
orderNumber: z.number(),
|
|
35
|
-
orderStatus: z.
|
|
35
|
+
orderStatus: z.enum(OrderStatusEnum),
|
|
36
36
|
orderCreatedAt: z.coerce.date(),
|
|
37
37
|
totalCost: z.number(),
|
|
38
38
|
clientName: z.string(),
|
|
@@ -41,8 +41,8 @@ export const DeliveryRouteWithOrdersSchema = DeliveryRouteSchema.extend({
|
|
|
41
41
|
clientPhone: z.string().nullable(),
|
|
42
42
|
clientCode: z.string().nullable(),
|
|
43
43
|
clientGroup: z.string().nullable(),
|
|
44
|
-
orderDeliveryUUID: z.
|
|
45
|
-
orderDeliveryStatus: z.
|
|
44
|
+
orderDeliveryUUID: z.uuid().nullable(),
|
|
45
|
+
orderDeliveryStatus: z.enum(OrderDeliveryStatusEnum).nullable(),
|
|
46
46
|
deliveryAddress: z.string().nullable(),
|
|
47
47
|
deliveryComment: z.string().nullable(),
|
|
48
48
|
consignmentDates: z.array(z.coerce.date()),
|
|
@@ -2,16 +2,16 @@ import { z } from 'zod';
|
|
|
2
2
|
import { ContextMessageContextTypeEnum } from '../../enum/context-message-context-type.enum';
|
|
3
3
|
|
|
4
4
|
export const ContextInboxItemSchema = z.object({
|
|
5
|
-
contextType: z.
|
|
6
|
-
contextUUID: z.
|
|
7
|
-
subjectUUID: z.
|
|
5
|
+
contextType: z.enum(ContextMessageContextTypeEnum),
|
|
6
|
+
contextUUID: z.uuid(),
|
|
7
|
+
subjectUUID: z.uuid().nullable().optional(),
|
|
8
8
|
lastMessageAt: z.date(),
|
|
9
9
|
lastMessagePreview: z.string().nullable(),
|
|
10
10
|
lastMessageIsFromClient: z.boolean(),
|
|
11
11
|
unreadCount: z.number(),
|
|
12
12
|
|
|
13
13
|
orderId: z.number().nullable().optional(),
|
|
14
|
-
orderUUID: z.
|
|
14
|
+
orderUUID: z.uuid().nullable().optional(),
|
|
15
15
|
clientName: z.string().nullable().optional(),
|
|
16
16
|
productName: z.string().nullable().optional(),
|
|
17
17
|
});
|
|
@@ -2,14 +2,14 @@ import { z } from 'zod';
|
|
|
2
2
|
import { ContextMessageContextTypeEnum } from '../../enum/context-message-context-type.enum';
|
|
3
3
|
|
|
4
4
|
export const ContextMessageSchema = z.object({
|
|
5
|
-
uuid: z.
|
|
6
|
-
contextType: z.
|
|
7
|
-
contextUUID: z.
|
|
8
|
-
subjectUUID: z.
|
|
5
|
+
uuid: z.uuid(),
|
|
6
|
+
contextType: z.enum(ContextMessageContextTypeEnum),
|
|
7
|
+
contextUUID: z.uuid(),
|
|
8
|
+
subjectUUID: z.uuid().nullable().optional(),
|
|
9
9
|
|
|
10
10
|
isFromClient: z.boolean(),
|
|
11
|
-
authorUserUUID: z.
|
|
12
|
-
authorClientUUID: z.
|
|
11
|
+
authorUserUUID: z.uuid().nullable(),
|
|
12
|
+
authorClientUUID: z.uuid().nullable(),
|
|
13
13
|
|
|
14
14
|
text: z.string(),
|
|
15
15
|
payload: z.any().nullable().optional(),
|
|
@@ -3,11 +3,11 @@ import { MoneyAccountStatusEnum } from '../../enum/money-account-status.enum';
|
|
|
3
3
|
import { UserRoleEnum } from '../../enum';
|
|
4
4
|
|
|
5
5
|
export const MoneyAccountSchema = z.object({
|
|
6
|
-
uuid: z.
|
|
6
|
+
uuid: z.uuid(),
|
|
7
7
|
name: z.string(),
|
|
8
8
|
companyUUID: z.string(),
|
|
9
|
-
roles: z.
|
|
10
|
-
status: z.
|
|
9
|
+
roles: z.enum(UserRoleEnum).array(),
|
|
10
|
+
status: z.enum(MoneyAccountStatusEnum),
|
|
11
11
|
createdAt: z.date(),
|
|
12
12
|
updatedAt: z.date(),
|
|
13
13
|
deletedAt: z.date().nullable(),
|
|
@@ -6,11 +6,11 @@ import { OrderDeliverySchema } from '../order-delivery/order-delivery.schema';
|
|
|
6
6
|
import { DeliveryRouteSchema } from '../delivery-route/delivery-route.schema';
|
|
7
7
|
|
|
8
8
|
export const OrderSchema = z.object({
|
|
9
|
-
uuid: z.
|
|
9
|
+
uuid: z.uuid(),
|
|
10
10
|
orderNumber: z.number(),
|
|
11
|
-
clientUUID: z.
|
|
12
|
-
branchUUID: z.
|
|
13
|
-
creatorUserUUID: z.
|
|
11
|
+
clientUUID: z.uuid(),
|
|
12
|
+
branchUUID: z.uuid().nullable(),
|
|
13
|
+
creatorUserUUID: z.uuid(),
|
|
14
14
|
|
|
15
15
|
isSync: z.boolean(),
|
|
16
16
|
totalCost: z.number(),
|
|
@@ -23,8 +23,8 @@ export const OrderSchema = z.object({
|
|
|
23
23
|
discountAmount: z.number(),
|
|
24
24
|
discount: z.number().nullable(),
|
|
25
25
|
|
|
26
|
-
status: z.
|
|
27
|
-
type: z.
|
|
26
|
+
status: z.enum(OrderStatusEnum),
|
|
27
|
+
type: z.enum(OrderTypeEnum),
|
|
28
28
|
isPaid: z.boolean(),
|
|
29
29
|
|
|
30
30
|
comment: z.string().nullable(),
|
|
@@ -34,7 +34,7 @@ export const OrderSchema = z.object({
|
|
|
34
34
|
totalQuantity: z.number(),
|
|
35
35
|
totalProductNumber: z.number(),
|
|
36
36
|
invoiceSendAt: z.date().nullable(),
|
|
37
|
-
deliveryRouteUUID: z.
|
|
37
|
+
deliveryRouteUUID: z.uuid().nullable(),
|
|
38
38
|
|
|
39
39
|
completedAt: z.date().nullable(),
|
|
40
40
|
paymentDueAt: z.date().nullable(),
|
|
@@ -2,11 +2,11 @@ import { z } from 'zod';
|
|
|
2
2
|
import { OrderDeliveryStatusEnum } from '../../enum';
|
|
3
3
|
|
|
4
4
|
export const OrderDeliverySchema = z.object({
|
|
5
|
-
uuid: z.
|
|
5
|
+
uuid: z.uuid(),
|
|
6
6
|
city: z.string().nullable(),
|
|
7
7
|
deliveryDate: z.coerce.date().nullable(),
|
|
8
8
|
address: z.string().nullable(),
|
|
9
9
|
time: z.string().nullable(),
|
|
10
10
|
comment: z.string().nullable(),
|
|
11
|
-
orderDeliveryStatus: z.
|
|
11
|
+
orderDeliveryStatus: z.enum(OrderDeliveryStatusEnum),
|
|
12
12
|
});
|
|
@@ -7,10 +7,10 @@ import { DistributionSchema } from '../distribution/distribution.schema';
|
|
|
7
7
|
import { OrderProductMultiplicityOptionSchema } from './order-product-multiplicity-optiom.schema';
|
|
8
8
|
|
|
9
9
|
export const OrderProductSchema = z.object({
|
|
10
|
-
uuid: z.
|
|
11
|
-
productUUID: z.
|
|
12
|
-
orderUUID: z.
|
|
13
|
-
multiplicityOptionUUID: z.
|
|
10
|
+
uuid: z.uuid(),
|
|
11
|
+
productUUID: z.uuid(),
|
|
12
|
+
orderUUID: z.uuid(),
|
|
13
|
+
multiplicityOptionUUID: z.uuid().nullable().optional(),
|
|
14
14
|
|
|
15
15
|
quantity: z.number(),
|
|
16
16
|
price: z.number(),
|
|
@@ -47,7 +47,7 @@ export const OrderProductExtendedSchema = OrderProductSchema.extend({
|
|
|
47
47
|
|
|
48
48
|
export const OrderProductForClientExtendedSchema = OrderProductForClientSchema.extend({
|
|
49
49
|
product: ProductExtendedForClientSchema,
|
|
50
|
-
multiplicityOptionUUID: z.
|
|
50
|
+
multiplicityOptionUUID: z.uuid().nullable().optional(),
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
export const OrderProductForDistributeSchema = OrderProductSchema.extend({
|