@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.
Files changed (197) hide show
  1. package/build/commands/auth/login-user.command.js +3 -3
  2. package/build/commands/auth/register-user.command.js +1 -1
  3. package/build/commands/auth/reset-password-by-security-code.command.js +1 -1
  4. package/build/commands/auth/reset-password-by-token.command.js +1 -1
  5. package/build/commands/auth/restore-password-by-security-code.command.js +1 -1
  6. package/build/commands/branch/delete-branch.command.js +1 -1
  7. package/build/commands/category/delete-category.command.js +1 -1
  8. package/build/commands/category/get-category-by-uuid.query.js +1 -1
  9. package/build/commands/category/get-category-list.query.js +1 -1
  10. package/build/commands/category/update-category-command.js +1 -1
  11. package/build/commands/category-alias/delete-category-alias.command.js +1 -1
  12. package/build/commands/category-alias/get-category-alias-by-uuid.query.js +1 -1
  13. package/build/commands/category-alias/update-category-alias.command.js +1 -1
  14. package/build/commands/client/create-client.command.js +1 -1
  15. package/build/commands/client/delete-client.command.js +1 -1
  16. package/build/commands/client/marking/get-client-marking-by-client-list.command.js +2 -2
  17. package/build/commands/client/profile/get-client-individual-profile.query.js +1 -1
  18. package/build/commands/client/update-client.command.js +2 -2
  19. package/build/commands/client/webshop/register-client-webshop.command.js +1 -1
  20. package/build/commands/client/webshop/update-client-for-client.command.js +1 -1
  21. package/build/commands/company/deleteCompany.command.js +1 -1
  22. package/build/commands/company/getCompany.query.js +1 -1
  23. package/build/commands/consignment/delete-consignment.command.js +1 -1
  24. package/build/commands/delivery-route/attach-order-list-to-delivery-route.command.js +1 -1
  25. package/build/commands/delivery-route/detach-order-list-to-delivery-route.command.js +1 -1
  26. package/build/commands/discount-rules/get-discount-rules-all.query.js +2 -2
  27. package/build/commands/message/get-context-unread-count.query.js +2 -2
  28. package/build/commands/message/get-contexts-with-unread.query.js +1 -1
  29. package/build/commands/message/list-context-messages.query.js +4 -4
  30. package/build/commands/message/mark-context-read.command.js +2 -2
  31. package/build/commands/message/send-context-message.command.js +2 -2
  32. package/build/commands/order/create-order.command.js +2 -2
  33. package/build/commands/order/update-order.command.js +2 -2
  34. package/build/commands/order/webshop/update-cart.command.js +1 -1
  35. package/build/commands/order-product/create-order-product.command.js +1 -1
  36. package/build/commands/order-product/group/update-group-order-product-order.command.js +1 -1
  37. package/build/commands/order-product/update-order-product.command.js +2 -2
  38. package/build/commands/order-product/webshop/create-order-product-for-client.command.js +1 -1
  39. package/build/commands/order-product/webshop/update-order-product-for-client.command.js +1 -1
  40. package/build/commands/package/reorder-packages.command.js +1 -1
  41. package/build/commands/pre-order/create-order-from-pre-order.command.js +1 -1
  42. package/build/commands/pre-order/group/analyze-copy-pre-orders.command.js +2 -2
  43. package/build/commands/pre-order/group/analyze-create-orders-from-pre-orders.command.js +2 -2
  44. package/build/commands/pre-order/group/analyze-create-pre-orders-from-standing-orders.command.js +2 -2
  45. package/build/commands/pre-order/group/group-copy-pre-orders-to-collection.command.js +2 -2
  46. package/build/commands/pre-order/group/group-create-orders-from-pre-orders.command.js +4 -4
  47. package/build/commands/pre-order/group/group-create-pre-orders-from-standing-orders.command.js +4 -4
  48. package/build/commands/pre-order-collection/match-images-for-collection.command.js +1 -1
  49. package/build/commands/pre-order-collection-item/multiplicity-option/reorder-pre-order-collection-item-multiplicity-options.command.js +1 -1
  50. package/build/commands/product/get-product-quantity-calculate.query.js +1 -1
  51. package/build/commands/product/group/update-group-product-update-batch.command.js +1 -1
  52. package/build/commands/product/multiplicity-option/reorder-product-multiplicity-options.command.js +1 -1
  53. package/build/commands/report/export-client-statement.query.js +1 -1
  54. package/build/commands/report/export-inventory-movement.query.js +1 -1
  55. package/build/commands/report/export-inventory-stock.query.js +1 -1
  56. package/build/commands/report/export-inventory-turnover.query.js +1 -1
  57. package/build/commands/report/get-report-group-by-position.query.js +1 -1
  58. package/build/commands/transaction/apply-prepayment-transaction.command.js +1 -1
  59. package/build/commands/type/delete-type.command.js +1 -1
  60. package/build/commands/type/get-type-by-uuid.query.js +1 -1
  61. package/build/commands/user/createUserByClientId.command.js +2 -2
  62. package/build/commands/user/update-user.command.js +1 -1
  63. package/build/enum/index.js +2 -0
  64. package/build/schemas/bank-payment/bank-payment.schema.js +4 -4
  65. package/build/schemas/branch/branch.schema.js +2 -2
  66. package/build/schemas/category/category.schema.js +1 -1
  67. package/build/schemas/category-alias/category-alias.schema.js +4 -4
  68. package/build/schemas/category-template/category-template.schema.js +1 -1
  69. package/build/schemas/client/client-debt.schema.js +1 -1
  70. package/build/schemas/client/client-individual-profile.schema.js +1 -1
  71. package/build/schemas/client/client-legal-profile.schema.js +1 -1
  72. package/build/schemas/client/client-marking.schema.js +1 -1
  73. package/build/schemas/client/client.schema.js +3 -3
  74. package/build/schemas/company/company.schema.js +1 -1
  75. package/build/schemas/consignment/consignment.schema.js +1 -1
  76. package/build/schemas/consignment-import-schema/consignment-import-schema.scheme.js +2 -2
  77. package/build/schemas/consignment-import-schema-relation/consignment-import-schema-relation.schema.js +2 -2
  78. package/build/schemas/delivery-route/delivery-route.schema.js +3 -3
  79. package/build/schemas/discount-rules/discount-rules.schema.js +4 -4
  80. package/build/schemas/domain/domain.schema.js +1 -1
  81. package/build/schemas/message/client-inbox-item.schema.js +1 -1
  82. package/build/schemas/message/context-inbox.schema.js +3 -3
  83. package/build/schemas/message/context-message.schema.js +5 -5
  84. package/build/schemas/money-account/money-account.schema.js +1 -1
  85. package/build/schemas/order/order.schema.js +5 -5
  86. package/build/schemas/order-delivery/order-delivery.schema.js +1 -1
  87. package/build/schemas/order-product/order-product-multiplicity-optiom.schema.js +1 -1
  88. package/build/schemas/order-product/order-product.schema.js +5 -5
  89. package/build/schemas/pre-order-product/pre-order-product.schema.js +3 -3
  90. package/build/schemas/product/product-multiplicity-option.schema.js +1 -1
  91. package/build/schemas/product/product.schema.js +4 -4
  92. package/build/schemas/product-configuration/product-configuration.schema.js +2 -2
  93. package/build/schemas/transaction/transaction.schema.js +2 -2
  94. package/build/schemas/type/type.schema.js +2 -2
  95. package/build/schemas/type/typeList.schema.js +1 -1
  96. package/build/schemas/user/user.schema.js +1 -1
  97. package/build/schemas/write-off/write-off-image.schema.js +2 -2
  98. package/build/schemas/write-off/write-off.schema.js +1 -1
  99. package/commands/auth/login-user.command.ts +3 -3
  100. package/commands/auth/register-user.command.ts +1 -1
  101. package/commands/auth/reset-password-by-security-code.command.ts +1 -1
  102. package/commands/auth/reset-password-by-token.command.ts +1 -1
  103. package/commands/auth/restore-password-by-security-code.command.ts +1 -1
  104. package/commands/branch/delete-branch.command.ts +1 -1
  105. package/commands/category/delete-category.command.ts +1 -1
  106. package/commands/category/get-category-by-uuid.query.ts +1 -1
  107. package/commands/category/get-category-list.query.ts +1 -1
  108. package/commands/category/update-category-command.ts +1 -1
  109. package/commands/category-alias/delete-category-alias.command.ts +1 -1
  110. package/commands/category-alias/get-category-alias-by-uuid.query.ts +1 -1
  111. package/commands/category-alias/update-category-alias.command.ts +1 -1
  112. package/commands/client/create-client.command.ts +1 -1
  113. package/commands/client/delete-client.command.ts +1 -1
  114. package/commands/client/marking/get-client-marking-by-client-list.command.ts +2 -2
  115. package/commands/client/profile/get-client-individual-profile.query.ts +1 -1
  116. package/commands/client/update-client.command.ts +2 -2
  117. package/commands/client/webshop/register-client-webshop.command.ts +1 -1
  118. package/commands/client/webshop/update-client-for-client.command.ts +1 -1
  119. package/commands/company/deleteCompany.command.ts +1 -1
  120. package/commands/company/getCompany.query.ts +1 -1
  121. package/commands/consignment/delete-consignment.command.ts +1 -1
  122. package/commands/delivery-route/attach-order-list-to-delivery-route.command.ts +1 -1
  123. package/commands/delivery-route/detach-order-list-to-delivery-route.command.ts +1 -1
  124. package/commands/discount-rules/get-discount-rules-all.query.ts +2 -2
  125. package/commands/message/get-context-unread-count.query.ts +2 -2
  126. package/commands/message/get-contexts-with-unread.query.ts +1 -1
  127. package/commands/message/list-context-messages.query.ts +4 -4
  128. package/commands/message/mark-context-read.command.ts +2 -2
  129. package/commands/message/send-context-message.command.ts +2 -2
  130. package/commands/order/create-order.command.ts +2 -2
  131. package/commands/order/update-order.command.ts +2 -2
  132. package/commands/order/webshop/update-cart.command.ts +1 -1
  133. package/commands/order-product/create-order-product.command.ts +1 -1
  134. package/commands/order-product/group/update-group-order-product-order.command.ts +1 -1
  135. package/commands/order-product/update-order-product.command.ts +2 -2
  136. package/commands/order-product/webshop/create-order-product-for-client.command.ts +1 -1
  137. package/commands/order-product/webshop/update-order-product-for-client.command.ts +1 -1
  138. package/commands/package/reorder-packages.command.ts +1 -1
  139. package/commands/pre-order/create-order-from-pre-order.command.ts +1 -1
  140. package/commands/pre-order/group/analyze-copy-pre-orders.command.ts +2 -2
  141. package/commands/pre-order/group/analyze-create-orders-from-pre-orders.command.ts +2 -2
  142. package/commands/pre-order/group/analyze-create-pre-orders-from-standing-orders.command.ts +2 -2
  143. package/commands/pre-order/group/group-copy-pre-orders-to-collection.command.ts +2 -2
  144. package/commands/pre-order/group/group-create-orders-from-pre-orders.command.ts +4 -4
  145. package/commands/pre-order/group/group-create-pre-orders-from-standing-orders.command.ts +4 -4
  146. package/commands/pre-order-collection/match-images-for-collection.command.ts +1 -1
  147. package/commands/pre-order-collection-item/multiplicity-option/reorder-pre-order-collection-item-multiplicity-options.command.ts +1 -1
  148. package/commands/product/get-product-quantity-calculate.query.ts +1 -1
  149. package/commands/product/group/update-group-product-update-batch.command.ts +1 -1
  150. package/commands/product/multiplicity-option/reorder-product-multiplicity-options.command.ts +1 -1
  151. package/commands/report/export-client-statement.query.ts +1 -1
  152. package/commands/report/export-inventory-movement.query.ts +1 -1
  153. package/commands/report/export-inventory-stock.query.ts +1 -1
  154. package/commands/report/export-inventory-turnover.query.ts +1 -1
  155. package/commands/report/get-report-group-by-position.query.ts +1 -1
  156. package/commands/transaction/apply-prepayment-transaction.command.ts +1 -1
  157. package/commands/type/delete-type.command.ts +1 -1
  158. package/commands/type/get-type-by-uuid.query.ts +1 -1
  159. package/commands/user/createUserByClientId.command.ts +2 -2
  160. package/commands/user/update-user.command.ts +1 -1
  161. package/enum/index.ts +2 -0
  162. package/package.json +1 -1
  163. package/schemas/bank-payment/bank-payment.schema.ts +4 -4
  164. package/schemas/branch/branch.schema.ts +2 -2
  165. package/schemas/category/category.schema.ts +1 -1
  166. package/schemas/category-alias/category-alias.schema.ts +4 -4
  167. package/schemas/category-template/category-template.schema.ts +1 -1
  168. package/schemas/client/client-debt.schema.ts +1 -1
  169. package/schemas/client/client-individual-profile.schema.ts +1 -1
  170. package/schemas/client/client-legal-profile.schema.ts +1 -1
  171. package/schemas/client/client-marking.schema.ts +1 -1
  172. package/schemas/client/client.schema.ts +3 -3
  173. package/schemas/company/company.schema.ts +1 -1
  174. package/schemas/consignment/consignment.schema.ts +1 -1
  175. package/schemas/consignment-import-schema/consignment-import-schema.scheme.ts +2 -2
  176. package/schemas/consignment-import-schema-relation/consignment-import-schema-relation.schema.ts +2 -2
  177. package/schemas/delivery-route/delivery-route.schema.ts +3 -3
  178. package/schemas/discount-rules/discount-rules.schema.ts +4 -4
  179. package/schemas/domain/domain.schema.ts +1 -1
  180. package/schemas/message/client-inbox-item.schema.ts +1 -1
  181. package/schemas/message/context-inbox.schema.ts +3 -3
  182. package/schemas/message/context-message.schema.ts +5 -5
  183. package/schemas/money-account/money-account.schema.ts +1 -1
  184. package/schemas/order/order.schema.ts +5 -5
  185. package/schemas/order-delivery/order-delivery.schema.ts +1 -1
  186. package/schemas/order-product/order-product-multiplicity-optiom.schema.ts +1 -1
  187. package/schemas/order-product/order-product.schema.ts +5 -5
  188. package/schemas/pre-order-product/pre-order-product.schema.ts +3 -3
  189. package/schemas/product/product-multiplicity-option.schema.ts +1 -1
  190. package/schemas/product/product.schema.ts +4 -4
  191. package/schemas/product-configuration/product-configuration.schema.ts +2 -2
  192. package/schemas/transaction/transaction.schema.ts +2 -2
  193. package/schemas/type/type.schema.ts +2 -2
  194. package/schemas/type/typeList.schema.ts +1 -1
  195. package/schemas/user/user.schema.ts +1 -1
  196. package/schemas/write-off/write-off-image.schema.ts +2 -2
  197. package/schemas/write-off/write-off.schema.ts +1 -1
@@ -31,7 +31,7 @@ const UpdateGroupProductUpdateBatchResponseSchema = z.object({
31
31
  errors: z
32
32
  .array(
33
33
  z.object({
34
- productUUID: z.string().uuid(),
34
+ productUUID: z.uuid(),
35
35
  message: z.string(),
36
36
  }),
37
37
  )
@@ -4,7 +4,7 @@ const ReorderProductMultiplicityOptionsRequestSchema = z.object({
4
4
  items: z
5
5
  .array(
6
6
  z.object({
7
- optionUUID: z.string().uuid(),
7
+ optionUUID: z.uuid(),
8
8
  rank: z.coerce.number().int().min(0),
9
9
  }),
10
10
  )
@@ -6,7 +6,7 @@ const ExportClientStatementRequestSchema = z
6
6
  .object({
7
7
  startDate: z.coerce.date().optional(),
8
8
  endDate: z.coerce.date().optional(),
9
- clientUUID: z.string().uuid(),
9
+ clientUUID: z.uuid(),
10
10
  })
11
11
  .refine(
12
12
  value => {
@@ -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.string().uuid().optional(), // Фильтр по категории
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.string().uuid().optional(), // Фильтр по категории
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.string().uuid().optional(), // Фильтр по категории
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.enum(PositionReportTypeEnum).default(PositionReportTypeEnum.PRODUCT),
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.string().uuid().optional(),
5
+ orderUUID: z.uuid().optional(),
6
6
  });
7
7
 
8
8
  const ApplyPrepaymentTransactionResponseSchema = z.object({
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { DeleteDataResponseSchema } from '../../schemas/delete-data-response.schema';
3
3
 
4
4
  const DeleteTypeRequestSchema = z.object({
5
- uuid: z.string().uuid(),
5
+ uuid: z.uuid(),
6
6
  });
7
7
 
8
8
  const DeleteTypeResponseSchema = z.object({
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { TypeSchema } from '../../schemas/type/type.schema';
3
3
 
4
4
  const GetTypeByUUIDRequestSchema = z.object({
5
- uuid: z.string().uuid(),
5
+ uuid: z.uuid(),
6
6
  });
7
7
 
8
8
  const GetTypeByUUIDResponseSchema = 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.string().email().toLowerCase().nullable().optional(),
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.string().uuid(),
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.string().email().toLowerCase().nullable().optional(),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -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.string().uuid(),
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.string().uuid().nullable(),
19
- moneyAccountUUID: z.string().uuid().nullable(),
18
+ clientUUID: z.uuid().nullable(),
19
+ moneyAccountUUID: z.uuid().nullable(),
20
20
  moneyAccountName: z.string().nullable(),
21
21
  payload: z.unknown(),
22
- appliedTransactionUUID: z.string().uuid().nullable(),
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.string().uuid(),
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.string().uuid(),
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.string().uuid(),
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.string().uuid(),
4
+ uuid: z.uuid(),
5
5
  name: z.string(),
6
- companyUUID: z.string().uuid(),
7
- categoryUUID: z.string().uuid(),
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.string().uuid(),
14
+ uuid: z.uuid(),
15
15
  name: z.string(),
16
16
  });
@@ -7,7 +7,7 @@ export const CategoryTemplateTypeSchema = z.object({
7
7
  });
8
8
 
9
9
  export const CategoryTemplateSchema = z.object({
10
- uuid: z.string().uuid(),
10
+ uuid: z.uuid(),
11
11
  name: z.string(),
12
12
  alias: z.string().array(),
13
13
  type: CategoryTemplateTypeSchema,
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  export const ClientDebtItemSchema = z.object({
4
- clientUUID: z.string().uuid(),
4
+ clientUUID: z.uuid(),
5
5
  name: z.string(),
6
6
  code: z.string().nullable(),
7
7
  group: z.string().nullable(),
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  export const ClientIndividualProfileSchema = z.object({
4
- uuid: z.string().uuid(),
4
+ uuid: z.uuid(),
5
5
  firstName: z.string().nullable(),
6
6
  lastName: z.string().nullable(),
7
7
  middleName: z.string().nullable(),
@@ -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.string().uuid(),
5
+ uuid: z.uuid(),
6
6
  fullCompanyName: z.string().nullable(),
7
7
  taxId: z.string().nullable(),
8
8
  ogrn: z.string().nullable(),
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  export const ClientMarkingSchema = z.object({
4
- uuid: z.string().uuid(),
4
+ uuid: z.uuid(),
5
5
  name: z.string(),
6
6
  });
@@ -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.string().uuid(),
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.string().uuid(),
34
+ companyUUID: z.uuid(),
35
35
 
36
36
  clientType: z.nativeEnum(ClientTypeEnum),
37
- responsibleUserUUID: z.string().uuid().nullable(),
37
+ responsibleUserUUID: z.uuid().nullable(),
38
38
  responsibleSince: z.date().nullable(),
39
39
  });
40
40
 
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { CompanyStatusEnum } from '../../enum/companyStatus.enum';
3
3
 
4
4
  export const CompanySchema = z.object({
5
- uuid: z.string().uuid(),
5
+ uuid: z.uuid(),
6
6
  name: z.string(),
7
7
  alias: z.string(),
8
8
  status: z.nativeEnum(CompanyStatusEnum),
@@ -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.string().uuid(),
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.string().uuid(),
5
+ uuid: z.uuid(),
6
6
  name: z.string(),
7
7
  isDefault: z.boolean(),
8
- companyUUID: z.string().uuid(),
8
+ companyUUID: z.uuid(),
9
9
  });
10
10
 
11
11
  export const ConsignmentImportSchemaExtendedSchema = ConsignmentImportSchema.merge(
@@ -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.string().uuid(),
5
+ uuid: z.uuid(),
6
6
  entityProperty: z.nativeEnum(ConsignmentImportSchemaRelationEntityPropertyEnum),
7
7
  externalName: z.string(),
8
8
  isRequire: z.boolean(),
9
- consignmentImportSchemaUUID: z.string().uuid(),
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.string().uuid(),
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.string().uuid(),
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.string().uuid().nullable(),
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.enum(DiscountRulesTypeEnum),
62
- defaultApplyProduct: z.enum(DiscountRulesApplyTypeEnum),
63
- defaultApplyClient: z.enum(DiscountRulesApplyTypeEnum),
64
- status: z.enum(DiscountRulesStatusEnum),
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
  });
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  export const DomainSchema = z.object({
4
- uuid: z.string().uuid(),
4
+ uuid: z.uuid(),
5
5
  name: z.string(),
6
6
  companyId: z.string(),
7
7
  createdAt: z.date(),
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  export const ClientInboxItemSchema = z.object({
4
- clientUUID: z.string().uuid(),
4
+ clientUUID: z.uuid(),
5
5
  clientName: z.string(),
6
6
  clientCode: z.string().nullable(),
7
7
  clientGroup: z.string().nullable(),
@@ -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.string().uuid(),
7
- subjectUUID: z.string().uuid().nullable().optional(),
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.string().uuid().nullable().optional(),
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.string().uuid(),
5
+ uuid: z.uuid(),
6
6
  contextType: z.nativeEnum(ContextMessageContextTypeEnum),
7
- contextUUID: z.string().uuid(),
8
- subjectUUID: z.string().uuid().nullable().optional(),
7
+ contextUUID: z.uuid(),
8
+ subjectUUID: z.uuid().nullable().optional(),
9
9
 
10
10
  isFromClient: z.boolean(),
11
- authorUserUUID: z.string().uuid().nullable(),
12
- authorClientUUID: z.string().uuid().nullable(),
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.string().uuid(),
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.string().uuid(),
9
+ uuid: z.uuid(),
10
10
  orderNumber: z.number(),
11
- clientUUID: z.string().uuid(),
12
- branchUUID: z.string().uuid().nullable(),
13
- creatorUserUUID: z.string().uuid(),
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.string().uuid().nullable(),
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.string().uuid(),
5
+ uuid: z.uuid(),
6
6
  city: z.string().nullable(),
7
7
  deliveryDate: z.coerce.date().nullable(),
8
8
  address: z.string().nullable(),
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  export const OrderProductMultiplicityOptionSchema = z.object({
4
- uuid: z.string().uuid(),
4
+ uuid: z.uuid(),
5
5
  title: z.string().nullable(),
6
6
  optionMultiplicity: z.coerce.number(),
7
7
  optionPrice: z.coerce.number().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.string().uuid(),
11
- productUUID: z.string().uuid(),
12
- orderUUID: z.string().uuid(),
13
- multiplicityOptionUUID: z.string().uuid().nullable().optional(),
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.string().uuid().nullable().optional(),
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.string().uuid().nullable().optional(),
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.string().uuid().nullable().optional(),
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.string().uuid().nullable().optional(),
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(),
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  export const ProductMultiplicityOptionSchema = z.object({
4
- uuid: z.string().uuid(),
4
+ uuid: z.uuid(),
5
5
  title: z.string().nullable(),
6
6
  optionMultiplicity: z.number(),
7
7
  optionPrice: z.number().nullable(),
@@ -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.string().uuid(),
11
+ uuid: z.uuid(),
12
12
  dataSyncId: z.string().nullable(),
13
- consignmentUUID: z.string().uuid(),
14
- categoryUUID: z.string().uuid().nullable(),
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.string().uuid(),
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.string().uuid(),
6
- categoryUUID: z.string().uuid(),
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.string().uuid(),
9
- moneyAccountUUID: z.string().uuid(),
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.string().uuid(),
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.string().uuid(),
13
+ uuid: z.uuid(),
14
14
  name: z.string(),
15
15
  rank: z.number(),
16
16
  });
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  export const TypeListSchema = z.object({
4
- uuid: z.string().uuid(),
4
+ uuid: z.uuid(),
5
5
  name: z.string(),
6
6
  rank: z.number(),
7
7
  });