@floristcloud/api-lib 1.0.20 → 1.0.22
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/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/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 +1 -1
- package/build/commands/category/update-category-command.js +1 -1
- 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 +1 -1
- package/build/commands/client/delete-client.command.js +1 -1
- 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 +2 -2
- package/build/commands/client/webshop/register-client-webshop.command.js +1 -1
- 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/delete-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/discount-rules/get-discount-rules-all.query.js +2 -2
- package/build/commands/message/get-context-unread-count.query.js +2 -2
- package/build/commands/message/get-contexts-with-unread.query.js +1 -1
- package/build/commands/message/list-context-messages.query.js +4 -4
- package/build/commands/message/mark-context-read.command.js +2 -2
- package/build/commands/message/send-context-message.command.js +2 -2
- package/build/commands/order/create-order.command.js +2 -2
- package/build/commands/order/update-order.command.js +2 -2
- package/build/commands/order/webshop/update-cart.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/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/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-collection/match-images-for-collection.command.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/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-stock.query.js +1 -1
- package/build/commands/report/export-inventory-turnover.query.js +1 -1
- package/build/commands/report/get-report-group-by-position.query.js +1 -1
- package/build/commands/transaction/apply-prepayment-transaction.command.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/user/createUserByClientId.command.js +2 -2
- package/build/commands/user/update-user.command.js +1 -1
- package/build/enum/index.js +2 -0
- package/build/schemas/bank-payment/bank-payment.schema.js +4 -4
- package/build/schemas/branch/branch.schema.js +2 -2
- package/build/schemas/category/category.schema.js +1 -1
- package/build/schemas/category-alias/category-alias.schema.js +4 -4
- package/build/schemas/category-template/category-template.schema.js +1 -1
- 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 +1 -1
- package/build/schemas/client/client-marking.schema.js +1 -1
- package/build/schemas/client/client.schema.js +3 -3
- package/build/schemas/company/company.schema.js +1 -1
- package/build/schemas/consignment/consignment.schema.js +1 -1
- 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 +2 -2
- package/build/schemas/delivery-route/delivery-route.schema.js +3 -3
- package/build/schemas/discount-rules/discount-rules.schema.js +4 -4
- 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 +3 -3
- package/build/schemas/message/context-message.schema.js +5 -5
- package/build/schemas/money-account/money-account.schema.js +1 -1
- package/build/schemas/order/order.schema.js +5 -5
- package/build/schemas/order-delivery/order-delivery.schema.js +1 -1
- 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/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 +4 -4
- package/build/schemas/product-configuration/product-configuration.schema.js +2 -2
- package/build/schemas/transaction/transaction.schema.js +2 -2
- 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 +1 -1
- package/build/schemas/write-off/write-off-image.schema.js +2 -2
- package/build/schemas/write-off/write-off.schema.js +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/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 +1 -1
- package/commands/category/update-category-command.ts +1 -1
- 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 +1 -1
- package/commands/client/delete-client.command.ts +1 -1
- 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 +2 -2
- package/commands/client/webshop/register-client-webshop.command.ts +1 -1
- 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/delete-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/discount-rules/get-discount-rules-all.query.ts +2 -2
- package/commands/message/get-context-unread-count.query.ts +2 -2
- package/commands/message/get-contexts-with-unread.query.ts +1 -1
- package/commands/message/list-context-messages.query.ts +4 -4
- package/commands/message/mark-context-read.command.ts +2 -2
- package/commands/message/send-context-message.command.ts +2 -2
- package/commands/order/create-order.command.ts +2 -2
- package/commands/order/update-order.command.ts +2 -2
- package/commands/order/webshop/update-cart.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/reorder-packages.command.ts +1 -1
- package/commands/pre-order/create-order-from-pre-order.command.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-collection/match-images-for-collection.command.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/report/export-client-statement.query.ts +1 -1
- package/commands/report/export-inventory-movement.query.ts +1 -1
- package/commands/report/export-inventory-stock.query.ts +1 -1
- package/commands/report/export-inventory-turnover.query.ts +1 -1
- package/commands/report/get-report-group-by-position.query.ts +1 -1
- package/commands/transaction/apply-prepayment-transaction.command.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/user/createUserByClientId.command.ts +2 -2
- package/commands/user/update-user.command.ts +1 -1
- package/enum/index.ts +2 -0
- package/package.json +1 -1
- package/schemas/bank-payment/bank-payment.schema.ts +4 -4
- package/schemas/branch/branch.schema.ts +2 -2
- package/schemas/category/category.schema.ts +1 -1
- package/schemas/category-alias/category-alias.schema.ts +4 -4
- package/schemas/category-template/category-template.schema.ts +1 -1
- 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 +1 -1
- package/schemas/client/client-marking.schema.ts +1 -1
- package/schemas/client/client.schema.ts +3 -3
- package/schemas/company/company.schema.ts +1 -1
- package/schemas/consignment/consignment.schema.ts +1 -1
- package/schemas/consignment-import-schema/consignment-import-schema.scheme.ts +2 -2
- package/schemas/consignment-import-schema-relation/consignment-import-schema-relation.schema.ts +2 -2
- package/schemas/delivery-route/delivery-route.schema.ts +3 -3
- package/schemas/discount-rules/discount-rules.schema.ts +4 -4
- 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 +3 -3
- package/schemas/message/context-message.schema.ts +5 -5
- package/schemas/money-account/money-account.schema.ts +1 -1
- package/schemas/order/order.schema.ts +5 -5
- package/schemas/order-delivery/order-delivery.schema.ts +1 -1
- package/schemas/order-product/order-product-multiplicity-optiom.schema.ts +1 -1
- package/schemas/order-product/order-product.schema.ts +5 -5
- 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 +4 -4
- package/schemas/product-configuration/product-configuration.schema.ts +2 -2
- package/schemas/transaction/transaction.schema.ts +2 -2
- package/schemas/type/type.schema.ts +2 -2
- package/schemas/type/typeList.schema.ts +1 -1
- package/schemas/user/user.schema.ts +1 -1
- package/schemas/write-off/write-off-image.schema.ts +2 -2
- package/schemas/write-off/write-off.schema.ts +1 -1
|
@@ -6,7 +6,7 @@ const ExportInventoryMovementRequestSchema = z
|
|
|
6
6
|
.object({
|
|
7
7
|
startDate: z.coerce.date().optional(),
|
|
8
8
|
endDate: z.coerce.date().optional(),
|
|
9
|
-
categoryUUID: z.
|
|
9
|
+
categoryUUID: z.uuid().optional(), // Фильтр по категории
|
|
10
10
|
detailed: z.coerce.boolean().optional().default(false), // Флаг для детализации
|
|
11
11
|
})
|
|
12
12
|
.refine(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
const ExportInventoryStockRequestSchema = z.object({
|
|
4
|
-
categoryUUID: z.
|
|
4
|
+
categoryUUID: z.uuid().optional(), // Фильтр по категории
|
|
5
5
|
detailed: z.coerce.boolean().optional().default(false), // Флаг для детализации (группировка по name, size, grower)
|
|
6
6
|
});
|
|
7
7
|
|
|
@@ -5,7 +5,7 @@ const ExportInventoryTurnoverRequestSchema = z
|
|
|
5
5
|
.object({
|
|
6
6
|
startDate: z.coerce.date().optional(),
|
|
7
7
|
endDate: z.coerce.date().optional(),
|
|
8
|
-
categoryUUID: z.
|
|
8
|
+
categoryUUID: z.uuid().optional(), // Фильтр по категории
|
|
9
9
|
detailed: z.coerce.boolean().optional().default(false), // Флаг для детализации
|
|
10
10
|
})
|
|
11
11
|
.refine(
|
|
@@ -4,7 +4,7 @@ import { dateRangeCheck, setEndDay, setStartDay } from '../../helpers/date.helpe
|
|
|
4
4
|
|
|
5
5
|
const GetReportGroupByPositionRequestSchema = z
|
|
6
6
|
.object({
|
|
7
|
-
type: z.
|
|
7
|
+
type: z.nativeEnum(PositionReportTypeEnum).default(PositionReportTypeEnum.PRODUCT),
|
|
8
8
|
categoryUUID: z.string().optional(),
|
|
9
9
|
startDate: z.coerce.date().transform(val => (val ? setStartDay(val) : val)),
|
|
10
10
|
endDate: z.coerce.date().transform(val => (val ? setEndDay(val) : val)),
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { TransactionSchema } from '../../schemas';
|
|
3
3
|
|
|
4
4
|
const ApplyPrepaymentTransactionRequestSchema = z.object({
|
|
5
|
-
orderUUID: z.
|
|
5
|
+
orderUUID: z.uuid().optional(),
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
const ApplyPrepaymentTransactionResponseSchema = z.object({
|
|
@@ -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
12
|
roles: z.array(z.nativeEnum(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
|
|
|
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
|
});
|
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
|
@@ -3,7 +3,7 @@ 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.
|
|
6
|
+
uuid: z.uuid(),
|
|
7
7
|
provider: z.nativeEnum(BankProviderEnum),
|
|
8
8
|
externalEventId: z.string(),
|
|
9
9
|
accountNumber: z.string(),
|
|
@@ -15,10 +15,10 @@ export const BankPaymentSchema = z.object({
|
|
|
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,7 +3,7 @@ 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(),
|
|
@@ -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
|
});
|
|
@@ -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(),
|
|
@@ -8,7 +8,7 @@ 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(),
|
|
@@ -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
36
|
clientType: z.nativeEnum(ClientTypeEnum),
|
|
37
|
-
responsibleUserUUID: z.
|
|
37
|
+
responsibleUserUUID: z.uuid().nullable(),
|
|
38
38
|
responsibleSince: z.date().nullable(),
|
|
39
39
|
});
|
|
40
40
|
|
|
@@ -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(),
|
|
@@ -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.
|
|
5
|
+
uuid: z.uuid(),
|
|
6
6
|
entityProperty: z.nativeEnum(ConsignmentImportSchemaRelationEntityPropertyEnum),
|
|
7
7
|
externalName: z.string(),
|
|
8
8
|
isRequire: z.boolean(),
|
|
9
|
-
consignmentImportSchemaUUID: z.
|
|
9
|
+
consignmentImportSchemaUUID: z.uuid(),
|
|
10
10
|
});
|
|
@@ -2,7 +2,7 @@ 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(),
|
|
@@ -30,7 +30,7 @@ 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
35
|
orderStatus: z.nativeEnum(OrderStatusEnum),
|
|
36
36
|
orderCreatedAt: z.coerce.date(),
|
|
@@ -41,7 +41,7 @@ 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.
|
|
44
|
+
orderDeliveryUUID: z.uuid().nullable(),
|
|
45
45
|
orderDeliveryStatus: z.nativeEnum(OrderDeliveryStatusEnum).nullable(),
|
|
46
46
|
deliveryAddress: z.string().nullable(),
|
|
47
47
|
deliveryComment: z.string().nullable(),
|
|
@@ -58,10 +58,10 @@ export const DiscountRulesTypeSchema = z.discriminatedUnion('type', [
|
|
|
58
58
|
export const DiscountRulesBaseSchema = z.object({
|
|
59
59
|
uuid: z.string(),
|
|
60
60
|
companyUUID: z.string(),
|
|
61
|
-
type: z.
|
|
62
|
-
defaultApplyProduct: z.
|
|
63
|
-
defaultApplyClient: z.
|
|
64
|
-
status: z.
|
|
61
|
+
type: z.nativeEnum(DiscountRulesTypeEnum),
|
|
62
|
+
defaultApplyProduct: z.nativeEnum(DiscountRulesApplyTypeEnum),
|
|
63
|
+
defaultApplyClient: z.nativeEnum(DiscountRulesApplyTypeEnum),
|
|
64
|
+
status: z.nativeEnum(DiscountRulesStatusEnum),
|
|
65
65
|
createdAt: z.coerce.date(),
|
|
66
66
|
updatedAt: z.coerce.date(),
|
|
67
67
|
});
|
|
@@ -3,15 +3,15 @@ import { ContextMessageContextTypeEnum } from '../../enum/context-message-contex
|
|
|
3
3
|
|
|
4
4
|
export const ContextInboxItemSchema = z.object({
|
|
5
5
|
contextType: z.nativeEnum(ContextMessageContextTypeEnum),
|
|
6
|
-
contextUUID: z.
|
|
7
|
-
subjectUUID: z.
|
|
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.
|
|
5
|
+
uuid: z.uuid(),
|
|
6
6
|
contextType: z.nativeEnum(ContextMessageContextTypeEnum),
|
|
7
|
-
contextUUID: z.
|
|
8
|
-
subjectUUID: z.
|
|
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,7 +3,7 @@ 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
9
|
roles: z.nativeEnum(UserRoleEnum).array(),
|
|
@@ -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(),
|
|
@@ -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,7 +2,7 @@ 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(),
|
|
@@ -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({
|
|
@@ -14,7 +14,7 @@ export const PreOrderProductSchema = z.object({
|
|
|
14
14
|
uuid: z.string(),
|
|
15
15
|
preOrderCollectionItemUUID: z.string().nullable(),
|
|
16
16
|
preOrderUUID: z.string(),
|
|
17
|
-
multiplicityOptionUUID: z.
|
|
17
|
+
multiplicityOptionUUID: z.uuid().nullable().optional(),
|
|
18
18
|
quantity: z.number(),
|
|
19
19
|
comment: z.string().nullable(),
|
|
20
20
|
tag: z.string().nullable(),
|
|
@@ -39,7 +39,7 @@ export const PreOrderProductExtendedSchema = PreOrderProductSchema.extend({
|
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
export const CreatePreOrderProductSchema = PreOrderProductSchema.omit({ uuid: true, preOrderUUID: true }).extend({
|
|
42
|
-
multiplicityOptionUUID: z.
|
|
42
|
+
multiplicityOptionUUID: z.uuid().nullable().optional(),
|
|
43
43
|
categoryUUID: z.string().nullable().optional(),
|
|
44
44
|
name: z.string().nullable().optional(),
|
|
45
45
|
grower: z.string().nullable().optional(),
|
|
@@ -55,7 +55,7 @@ export const UpdatePreOrderProductSchema = PreOrderProductSchema.omit({
|
|
|
55
55
|
preOrderUUID: true,
|
|
56
56
|
})
|
|
57
57
|
.extend({
|
|
58
|
-
multiplicityOptionUUID: z.
|
|
58
|
+
multiplicityOptionUUID: z.uuid().nullable().optional(),
|
|
59
59
|
categoryUUID: z.string().nullable().optional(),
|
|
60
60
|
name: z.string().nullable().optional(),
|
|
61
61
|
grower: z.string().nullable().optional(),
|
|
@@ -8,10 +8,10 @@ import { discountRulesModeSchema } from '../discount-rules/discount-rules.schema
|
|
|
8
8
|
import { ProductMultiplicityOptionSchema } from '../..';
|
|
9
9
|
|
|
10
10
|
export const ProductSchema = z.object({
|
|
11
|
-
uuid: z.
|
|
11
|
+
uuid: z.uuid(),
|
|
12
12
|
dataSyncId: z.string().nullable(),
|
|
13
|
-
consignmentUUID: z.
|
|
14
|
-
categoryUUID: z.
|
|
13
|
+
consignmentUUID: z.uuid(),
|
|
14
|
+
categoryUUID: z.uuid().nullable(),
|
|
15
15
|
name: z.string(),
|
|
16
16
|
|
|
17
17
|
balance: z.number(),
|
|
@@ -52,7 +52,7 @@ export const ProductExtendedSchema = ProductSchema.merge(
|
|
|
52
52
|
);
|
|
53
53
|
|
|
54
54
|
export const ProductForClientSchema = z.object({
|
|
55
|
-
uuid: z.
|
|
55
|
+
uuid: z.uuid(),
|
|
56
56
|
name: z.string(),
|
|
57
57
|
balance: z.number(),
|
|
58
58
|
price: z.number(),
|
|
@@ -2,8 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
import { CountryCodeEnum } from '../../enum';
|
|
3
3
|
|
|
4
4
|
export const ProductConfigurationSchema = z.object({
|
|
5
|
-
uuid: z.
|
|
6
|
-
categoryUUID: z.
|
|
5
|
+
uuid: z.uuid(),
|
|
6
|
+
categoryUUID: z.uuid(),
|
|
7
7
|
country: z.nativeEnum(CountryCodeEnum).nullable(),
|
|
8
8
|
grower: z.string().nullable(),
|
|
9
9
|
size: z.coerce.number().nullable(),
|
|
@@ -5,8 +5,8 @@ import { ClientSchema } from '../client';
|
|
|
5
5
|
import { OrderForClientSchema, OrderSchema } from '../order/order.schema';
|
|
6
6
|
|
|
7
7
|
export const TransactionSchema = z.object({
|
|
8
|
-
uuid: z.
|
|
9
|
-
moneyAccountUUID: z.
|
|
8
|
+
uuid: z.uuid(),
|
|
9
|
+
moneyAccountUUID: z.uuid(),
|
|
10
10
|
|
|
11
11
|
amount: z.number(),
|
|
12
12
|
comment: z.string(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
export const TypeSchema = z.object({
|
|
4
|
-
uuid: z.
|
|
4
|
+
uuid: z.uuid(),
|
|
5
5
|
name: z.string(),
|
|
6
6
|
rank: z.number(),
|
|
7
7
|
deletedAt: z.date().nullable(),
|
|
@@ -10,7 +10,7 @@ export const TypeSchema = z.object({
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
export const TypeInCategorySchema = z.object({
|
|
13
|
-
uuid: z.
|
|
13
|
+
uuid: z.uuid(),
|
|
14
14
|
name: z.string(),
|
|
15
15
|
rank: z.number(),
|
|
16
16
|
});
|