@floristcloud/api-lib 1.2.160 → 1.2.161
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/client/index.js +1 -0
- package/build/commands/client/webshop/get-client-me-webshop.query.js +8 -0
- package/build/commands/client/webshop/register-client-webshop.command.js +2 -16
- package/build/commands/client/webshop/update-client-for-client.command.js +2 -14
- package/build/commands/discount-rules/get-product-discount-price.query.js +2 -68
- package/build/commands/order/webshop/create-cart.command.js +2 -8
- package/build/commands/order/webshop/get-order-for-client.query.js +2 -8
- package/build/commands/order/webshop/get-order-list-for-client.query.js +2 -46
- package/build/commands/order/webshop/update-cart.command.js +2 -25
- package/build/commands/order-product/webshop/get-order-product-for-client-list.query.js +2 -8
- package/build/commands/pre-order/webshop/get-pre-order-list-webshop.command.js +2 -16
- package/build/commands/pre-order/webshop/get-pre-order-list-webshop.query.js +9 -0
- package/build/commands/pre-order/webshop/get-pre-order-webshop.query.js +8 -0
- package/build/commands/pre-order/webshop/index.js +2 -1
- package/build/commands/pre-order-collection-item/delete-group-pre-order-collection-item.command.js +3 -13
- package/build/commands/pre-order-collection-item/get-pre-order-collection-item-grouped-list-for-client.query.js +2 -18
- package/build/commands/pre-order-collection-item/get-pre-order-collection-item-list-for-client.query.js +2 -18
- package/build/commands/pre-order-product/create-pre-order-product-webshop.command.js +2 -7
- package/build/commands/pre-order-product/get-pre-order-product-extended-list-webshop.query.js +9 -0
- package/build/commands/pre-order-product/index.js +1 -0
- package/build/commands/pre-order-product/update-pre-order-product-webshop.command.js +2 -7
- package/build/commands/product/webshop/get-product-list-for-client.query.js +2 -31
- package/build/commands/transaction/webshop/get-transaction-list-for-client.query.js +2 -30
- package/build/commands/write-off/webshop/create-write-off-from-order-for-client.command.js +2 -14
- package/build/commands/write-off/webshop/get-write-off-list-by-order.query.js +2 -8
- package/build/constant/error.js +13 -0
- package/build/schemas/category/category-name.schema.js +6 -0
- package/build/schemas/category/index.js +23 -0
- package/build/schemas/client/client-base.schema.js +37 -0
- package/build/schemas/client/client-extended-for-client.schema.js +17 -0
- package/build/schemas/client/client-extended-list.schema.js +9 -0
- package/build/schemas/client/client-extended.schema.js +21 -0
- package/build/schemas/client/client-for-client.schema.js +30 -0
- package/build/schemas/client/client-name.schema.js +6 -0
- package/build/schemas/client/client.schema.js +6 -54
- package/build/schemas/client/get-client-me-webshop-response.schema.js +9 -0
- package/build/schemas/client/index.js +10 -0
- package/build/schemas/client/register-client-webshop-request.schema.js +13 -0
- package/build/schemas/client/register-client-webshop-response.schema.js +9 -0
- package/build/schemas/client/update-client-for-client-request.schema.js +11 -0
- package/build/schemas/client/update-client-for-client-response.schema.js +9 -0
- package/build/schemas/consignment/consignment-distribution-validation.schema.js +4 -4
- package/build/schemas/consignment/consignment.schema.js +2 -2
- package/build/schemas/discount-rules/discount-rules-data-for-client.schema.js +8 -0
- package/build/schemas/discount-rules/discount-rules-for-client.schema.js +11 -0
- package/build/schemas/discount-rules/discount-rules.schema.js +4 -4
- package/build/schemas/discount-rules/get-product-discount-price-request.schema.js +10 -0
- package/build/schemas/discount-rules/get-product-discount-price-response.schema.js +17 -0
- package/build/schemas/discount-rules/index.js +24 -0
- package/build/schemas/discount-rules/product-discount-price-data.schema.js +18 -0
- package/build/schemas/discount-rules/product-discount-price-item.schema.js +22 -0
- package/build/schemas/discount-rules/product-discount-price-multiplicity-option.schema.js +25 -0
- package/build/schemas/index.js +15 -41
- package/build/schemas/money-account/index.js +19 -0
- package/build/schemas/money-account/money-account-name.schema.js +6 -0
- package/build/schemas/order/create-cart-request.schema.js +5 -0
- package/build/schemas/order/create-cart-response.schema.js +9 -0
- package/build/schemas/order/get-order-for-client-list-request.schema.js +40 -0
- package/build/schemas/order/get-order-for-client-list-response.schema.js +9 -0
- package/build/schemas/order/get-order-for-client-request.schema.js +5 -0
- package/build/schemas/order/get-order-for-client-response.schema.js +9 -0
- package/build/schemas/order/index.js +30 -0
- package/build/schemas/order/order-base.schema.js +50 -0
- package/build/schemas/order/order-extended-for-client-list.schema.js +9 -0
- package/build/schemas/order/order-extended-for-client.schema.js +19 -0
- package/build/schemas/order/order-extended.schema.js +19 -0
- package/build/schemas/order/order-for-client.schema.js +36 -0
- package/build/schemas/order/order.schema.js +9 -81
- package/build/schemas/order/update-cart-delivery-request.schema.js +10 -0
- package/build/schemas/order/update-cart-request.schema.js +15 -0
- package/build/schemas/order/update-cart-response.schema.js +9 -0
- package/build/schemas/order-product/active-stepper-positions-for-order-response.schema.js +8 -0
- package/build/schemas/order-product/get-order-product-for-client-list-request.schema.js +5 -0
- package/build/schemas/order-product/get-order-product-for-client-list-response.schema.js +9 -0
- package/build/schemas/order-product/index.js +27 -0
- package/build/schemas/order-product/order-product-base.schema.js +27 -0
- package/build/schemas/order-product/order-product-extended-for-client-list.schema.js +9 -0
- package/build/schemas/order-product/order-product-extended-for-client.schema.js +10 -0
- package/build/schemas/order-product/order-product-extended.schema.js +12 -0
- package/build/schemas/order-product/order-product-for-client.schema.js +20 -0
- package/build/schemas/order-product/order-product-for-distribute.schema.js +15 -0
- package/build/schemas/order-product/order-product-list.schema.js +5 -6
- package/build/schemas/order-product/order-product-stepper-position.schema.js +13 -0
- package/build/schemas/order-product/order-product.schema.js +20 -70
- package/build/schemas/order-product/set-order-product-quantity-webshop-request.schema.js +7 -0
- package/build/schemas/order-product/set-order-product-quantity-webshop-response.schema.js +9 -0
- package/build/schemas/pagination-request.schema.js +9 -0
- package/build/schemas/pre-order/get-pre-order-list-webshop-request.schema.js +10 -0
- package/build/schemas/pre-order/get-pre-order-list-webshop-response.schema.js +8 -0
- package/build/schemas/pre-order/get-pre-order-webshop-response.schema.js +8 -0
- package/build/schemas/pre-order/index.js +25 -0
- package/build/schemas/pre-order/pre-order-copy.schema.js +4 -4
- package/build/schemas/pre-order/pre-order-extended-for-client-list.schema.js +9 -0
- package/build/schemas/pre-order/pre-order-extended-for-client.schema.js +15 -0
- package/build/schemas/pre-order/pre-order-for-client.schema.js +15 -0
- package/build/schemas/pre-order/pre-order-summary.schema.js +5 -0
- package/build/schemas/pre-order/pre-order.schema.js +3 -3
- package/build/schemas/pre-order-collection/index.js +18 -0
- package/build/schemas/pre-order-collection/pre-order-collection-summary-for-client.schema.js +10 -0
- package/build/schemas/pre-order-collection-item/create-pre-order-collection-item.schema.js +32 -0
- package/build/schemas/pre-order-collection-item/delete-group-pre-order-collection-item-request.schema.js +7 -0
- package/build/schemas/pre-order-collection-item/delete-group-pre-order-collection-item-response.schema.js +9 -0
- package/build/schemas/pre-order-collection-item/delete-group-pre-order-collection-item-result.schema.js +8 -0
- package/build/schemas/pre-order-collection-item/get-pre-order-collection-item-grouped-list-for-client-response.schema.js +9 -0
- package/build/schemas/pre-order-collection-item/get-pre-order-collection-item-list-for-client-response.schema.js +9 -0
- package/build/schemas/pre-order-collection-item/index.js +34 -0
- package/build/schemas/pre-order-collection-item/matching-product.schema.js +13 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-base.schema.js +36 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-catalog-filter-for-client-request.schema.js +15 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-catalog-for-client-list.schema.js +9 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-catalog-for-client.schema.js +11 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-catalog-grouped-for-client-list.schema.js +9 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-catalog-grouped-for-client.schema.js +9 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-category.schema.js +11 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-client-pre-order-product.schema.js +13 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-extended-list.schema.js +9 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-extended-with-clients-pre-order-product-list.schema.js +9 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-extended-with-clients-pre-order-product.schema.js +8 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-extended.schema.js +18 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-for-client.schema.js +34 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item-image.schema.js +7 -0
- package/build/schemas/pre-order-collection-item/pre-order-collection-item.schema.js +31 -150
- package/build/schemas/pre-order-collection-item/update-pre-order-collection-item.schema.js +35 -0
- package/build/schemas/pre-order-product/active-stepper-positions-response.schema.js +8 -0
- package/build/schemas/pre-order-product/create-pre-order-product-webshop-request.schema.js +16 -0
- package/build/schemas/pre-order-product/create-pre-order-product-webshop-response.schema.js +9 -0
- package/build/schemas/pre-order-product/create-pre-order-product.schema.js +18 -0
- package/build/schemas/pre-order-product/get-pre-order-product-extended-list-webshop-response.schema.js +9 -0
- package/build/schemas/pre-order-product/index.js +25 -0
- package/build/schemas/pre-order-product/matching-config.schema.js +12 -0
- package/build/schemas/pre-order-product/pre-order-product-base.schema.js +27 -0
- package/build/schemas/pre-order-product/pre-order-product-extended-for-client-list.schema.js +9 -0
- package/build/schemas/pre-order-product/pre-order-product-extended-for-client.schema.js +15 -0
- package/build/schemas/pre-order-product/pre-order-product-extended-list.schema.js +9 -0
- package/build/schemas/pre-order-product/pre-order-product-extended.schema.js +14 -0
- package/build/schemas/pre-order-product/pre-order-product-for-client.schema.js +24 -0
- package/build/schemas/pre-order-product/pre-order-product-list.schema.js +9 -0
- package/build/schemas/pre-order-product/pre-order-product-stepper-position.schema.js +14 -0
- package/build/schemas/pre-order-product/pre-order-product.schema.js +29 -126
- package/build/schemas/pre-order-product/set-pre-order-product-quantity-webshop-request.schema.js +7 -0
- package/build/schemas/pre-order-product/set-pre-order-product-quantity-webshop-response.schema.js +9 -0
- package/build/schemas/pre-order-product/update-pre-order-product-webshop-request.schema.js +16 -0
- package/build/schemas/pre-order-product/update-pre-order-product-webshop-response.schema.js +9 -0
- package/build/schemas/pre-order-product/update-pre-order-product.schema.js +24 -0
- package/build/schemas/product/get-product-list-for-client-request.schema.js +28 -0
- package/build/schemas/product/get-product-list-for-client-response.schema.js +9 -0
- package/build/schemas/product/index.js +31 -0
- package/build/schemas/product/product-base.schema.js +38 -0
- package/build/schemas/product/product-catalog-name.schema.js +10 -0
- package/build/schemas/product/product-consignment-for-client.schema.js +8 -0
- package/build/schemas/product/product-discount-price-for-client.schema.js +8 -0
- package/build/schemas/product/product-extended-for-admin-with-statistic.schema.js +8 -0
- package/build/schemas/product/product-extended-for-admin.schema.js +9 -0
- package/build/schemas/product/product-extended-for-client.schema.js +31 -0
- package/build/schemas/product/product-extended.schema.js +15 -0
- package/build/schemas/product/product-for-client.schema.js +25 -0
- package/build/schemas/product/product-image-for-client.schema.js +7 -0
- package/build/schemas/product/product-list-extended-for-client.schema.js +9 -0
- package/build/schemas/product/product-list.schema.js +5 -7
- package/build/schemas/product/product.schema.js +12 -135
- package/build/schemas/transaction/get-transaction-list-for-client-request.schema.js +27 -0
- package/build/schemas/transaction/get-transaction-list-for-client-response.schema.js +9 -0
- package/build/schemas/transaction/index.js +23 -0
- package/build/schemas/transaction/transaction-base.schema.js +24 -0
- package/build/schemas/transaction/transaction-extended-for-client-list.schema.js +9 -0
- package/build/schemas/transaction/transaction-extended-for-client.schema.js +12 -0
- package/build/schemas/transaction/transaction-extended.schema.js +12 -0
- package/build/schemas/transaction/transaction-for-client.schema.js +19 -0
- package/build/schemas/transaction/transaction-list.schema.js +5 -6
- package/build/schemas/transaction/transaction.schema.js +7 -35
- package/build/schemas/user/index.js +19 -0
- package/build/schemas/user/user-contact-for-client.schema.js +10 -0
- package/build/schemas/user/user-name.schema.js +6 -0
- package/build/schemas/write-off/create-write-off-from-order-for-client-request.schema.js +11 -0
- package/build/schemas/write-off/create-write-off-from-order-for-client-response.schema.js +9 -0
- package/build/schemas/write-off/get-write-off-list-by-order-for-client-request.schema.js +5 -0
- package/build/schemas/write-off/get-write-off-list-by-order-for-client-response.schema.js +9 -0
- package/build/schemas/write-off/index.js +27 -0
- package/build/schemas/write-off/write-off-for-client.schema.js +26 -0
- package/build/schemas/write-off/write-off-order-product-for-client.schema.js +8 -0
- package/build/schemas/write-off/write-off.schema.js +8 -8
- package/commands/client/index.ts +1 -0
- package/commands/client/webshop/get-client-me-webshop.query.ts +7 -0
- package/commands/client/webshop/register-client-webshop.command.ts +1 -16
- package/commands/client/webshop/update-client-for-client.command.ts +1 -14
- package/commands/discount-rules/get-product-discount-price.query.ts +1 -69
- package/commands/order/webshop/create-cart.command.ts +1 -8
- package/commands/order/webshop/get-order-for-client.query.ts +1 -8
- package/commands/order/webshop/get-order-list-for-client.query.ts +1 -49
- package/commands/order/webshop/update-cart.command.ts +1 -25
- package/commands/order-product/webshop/get-order-product-for-client-list.query.ts +1 -8
- package/commands/pre-order/webshop/get-pre-order-list-webshop.command.ts +1 -21
- package/commands/pre-order/webshop/get-pre-order-list-webshop.query.ts +10 -0
- package/commands/pre-order/webshop/get-pre-order-webshop.query.ts +7 -0
- package/commands/pre-order/webshop/index.ts +2 -1
- package/commands/pre-order-collection-item/delete-group-pre-order-collection-item.command.ts +1 -12
- package/commands/pre-order-collection-item/get-pre-order-collection-item-grouped-list-for-client.query.ts +5 -19
- package/commands/pre-order-collection-item/get-pre-order-collection-item-list-for-client.query.ts +5 -19
- package/commands/pre-order-product/create-pre-order-product-webshop.command.ts +2 -7
- package/commands/pre-order-product/get-pre-order-product-extended-list-webshop.query.ts +10 -0
- package/commands/pre-order-product/index.ts +1 -0
- package/commands/pre-order-product/update-pre-order-product-webshop.command.ts +2 -7
- package/commands/product/webshop/get-product-list-for-client.query.ts +1 -31
- package/commands/transaction/webshop/get-transaction-list-for-client.query.ts +1 -33
- package/commands/write-off/webshop/create-write-off-from-order-for-client.command.ts +1 -14
- package/commands/write-off/webshop/get-write-off-list-by-order.query.ts +1 -8
- package/constant/error.ts +13 -0
- package/package.json +1 -1
- package/schemas/category/category-name.schema.ts +4 -0
- package/schemas/category/index.ts +7 -0
- package/schemas/client/client-base.schema.ts +38 -0
- package/schemas/client/client-extended-for-client.schema.ts +15 -0
- package/schemas/client/client-extended-list.schema.ts +7 -0
- package/schemas/client/client-extended.schema.ts +20 -0
- package/schemas/client/client-for-client.schema.ts +28 -0
- package/schemas/client/client-name.schema.ts +4 -0
- package/schemas/client/client.schema.ts +3 -62
- package/schemas/client/get-client-me-webshop-response.schema.ts +7 -0
- package/schemas/client/index.ts +10 -0
- package/schemas/client/register-client-webshop-request.schema.ts +11 -0
- package/schemas/client/register-client-webshop-response.schema.ts +7 -0
- package/schemas/client/update-client-for-client-request.schema.ts +9 -0
- package/schemas/client/update-client-for-client-response.schema.ts +7 -0
- package/schemas/consignment/consignment-distribution-validation.schema.ts +2 -2
- package/schemas/consignment/consignment.schema.ts +1 -1
- package/schemas/discount-rules/discount-rules-data-for-client.schema.ts +6 -0
- package/schemas/discount-rules/discount-rules-for-client.schema.ts +9 -0
- package/schemas/discount-rules/discount-rules.schema.ts +2 -2
- package/schemas/discount-rules/get-product-discount-price-request.schema.ts +8 -0
- package/schemas/discount-rules/get-product-discount-price-response.schema.ts +15 -0
- package/schemas/discount-rules/index.ts +8 -0
- package/schemas/discount-rules/product-discount-price-data.schema.ts +16 -0
- package/schemas/discount-rules/product-discount-price-item.schema.ts +20 -0
- package/schemas/discount-rules/product-discount-price-multiplicity-option.schema.ts +23 -0
- package/schemas/index.ts +15 -41
- package/schemas/money-account/index.ts +3 -0
- package/schemas/money-account/money-account-name.schema.ts +4 -0
- package/schemas/order/create-cart-request.schema.ts +3 -0
- package/schemas/order/create-cart-response.schema.ts +7 -0
- package/schemas/order/get-order-for-client-list-request.schema.ts +41 -0
- package/schemas/order/get-order-for-client-list-response.schema.ts +7 -0
- package/schemas/order/get-order-for-client-request.schema.ts +3 -0
- package/schemas/order/get-order-for-client-response.schema.ts +7 -0
- package/schemas/order/index.ts +14 -0
- package/schemas/order/order-base.schema.ts +54 -0
- package/schemas/order/order-extended-for-client-list.schema.ts +7 -0
- package/schemas/order/order-extended-for-client.schema.ts +17 -0
- package/schemas/order/order-extended.schema.ts +17 -0
- package/schemas/order/order-for-client.schema.ts +34 -0
- package/schemas/order/order.schema.ts +4 -90
- package/schemas/order/update-cart-delivery-request.schema.ts +8 -0
- package/schemas/order/update-cart-request.schema.ts +13 -0
- package/schemas/order/update-cart-response.schema.ts +7 -0
- package/schemas/order-product/active-stepper-positions-for-order-response.schema.ts +6 -0
- package/schemas/order-product/get-order-product-for-client-list-request.schema.ts +3 -0
- package/schemas/order-product/get-order-product-for-client-list-response.schema.ts +7 -0
- package/schemas/order-product/index.ts +11 -0
- package/schemas/order-product/order-product-base.schema.ts +30 -0
- package/schemas/order-product/order-product-extended-for-client-list.schema.ts +7 -0
- package/schemas/order-product/order-product-extended-for-client.schema.ts +8 -0
- package/schemas/order-product/order-product-extended.schema.ts +10 -0
- package/schemas/order-product/order-product-for-client.schema.ts +18 -0
- package/schemas/order-product/order-product-for-distribute.schema.ts +13 -0
- package/schemas/order-product/order-product-list.schema.ts +5 -6
- package/schemas/order-product/order-product-stepper-position.schema.ts +11 -0
- package/schemas/order-product/order-product.schema.ts +12 -83
- package/schemas/order-product/set-order-product-quantity-webshop-request.schema.ts +5 -0
- package/schemas/order-product/set-order-product-quantity-webshop-response.schema.ts +7 -0
- package/schemas/pagination-request.schema.ts +7 -0
- package/schemas/pre-order/get-pre-order-list-webshop-request.schema.ts +8 -0
- package/schemas/pre-order/get-pre-order-list-webshop-response.schema.ts +6 -0
- package/schemas/pre-order/get-pre-order-webshop-response.schema.ts +6 -0
- package/schemas/pre-order/index.ts +9 -0
- package/schemas/pre-order/pre-order-copy.schema.ts +2 -2
- package/schemas/pre-order/pre-order-extended-for-client-list.schema.ts +7 -0
- package/schemas/pre-order/pre-order-extended-for-client.schema.ts +13 -0
- package/schemas/pre-order/pre-order-for-client.schema.ts +13 -0
- package/schemas/pre-order/pre-order-summary.schema.ts +3 -0
- package/schemas/pre-order/pre-order.schema.ts +1 -1
- package/schemas/pre-order-collection/index.ts +2 -0
- package/schemas/pre-order-collection/pre-order-collection-summary-for-client.schema.ts +8 -0
- package/schemas/pre-order-collection-item/create-pre-order-collection-item.schema.ts +30 -0
- package/schemas/pre-order-collection-item/delete-group-pre-order-collection-item-request.schema.ts +5 -0
- package/schemas/pre-order-collection-item/delete-group-pre-order-collection-item-response.schema.ts +7 -0
- package/schemas/pre-order-collection-item/delete-group-pre-order-collection-item-result.schema.ts +6 -0
- package/schemas/pre-order-collection-item/get-pre-order-collection-item-grouped-list-for-client-response.schema.ts +7 -0
- package/schemas/pre-order-collection-item/get-pre-order-collection-item-list-for-client-response.schema.ts +7 -0
- package/schemas/pre-order-collection-item/index.ts +18 -0
- package/schemas/pre-order-collection-item/matching-product.schema.ts +11 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-base.schema.ts +34 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-catalog-filter-for-client-request.schema.ts +13 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-catalog-for-client-list.schema.ts +7 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-catalog-for-client.schema.ts +9 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-catalog-grouped-for-client-list.schema.ts +7 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-catalog-grouped-for-client.schema.ts +7 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-category.schema.ts +9 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-client-pre-order-product.schema.ts +11 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-extended-list.schema.ts +7 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-extended-with-clients-pre-order-product-list.schema.ts +7 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-extended-with-clients-pre-order-product.schema.ts +6 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-extended.schema.ts +16 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-for-client.schema.ts +32 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item-image.schema.ts +5 -0
- package/schemas/pre-order-collection-item/pre-order-collection-item.schema.ts +25 -162
- package/schemas/pre-order-collection-item/update-pre-order-collection-item.schema.ts +33 -0
- package/schemas/pre-order-product/active-stepper-positions-response.schema.ts +6 -0
- package/schemas/pre-order-product/create-pre-order-product-webshop-request.schema.ts +14 -0
- package/schemas/pre-order-product/create-pre-order-product-webshop-response.schema.ts +7 -0
- package/schemas/pre-order-product/create-pre-order-product.schema.ts +16 -0
- package/schemas/pre-order-product/get-pre-order-product-extended-list-webshop-response.schema.ts +7 -0
- package/schemas/pre-order-product/index.ts +9 -0
- package/schemas/pre-order-product/matching-config.schema.ts +10 -0
- package/schemas/pre-order-product/pre-order-product-base.schema.ts +25 -0
- package/schemas/pre-order-product/pre-order-product-extended-for-client-list.schema.ts +7 -0
- package/schemas/pre-order-product/pre-order-product-extended-for-client.schema.ts +13 -0
- package/schemas/pre-order-product/pre-order-product-extended-list.schema.ts +7 -0
- package/schemas/pre-order-product/pre-order-product-extended.schema.ts +12 -0
- package/schemas/pre-order-product/pre-order-product-for-client.schema.ts +22 -0
- package/schemas/pre-order-product/pre-order-product-list.schema.ts +7 -0
- package/schemas/pre-order-product/pre-order-product-stepper-position.schema.ts +12 -0
- package/schemas/pre-order-product/pre-order-product.schema.ts +19 -138
- package/schemas/pre-order-product/set-pre-order-product-quantity-webshop-request.schema.ts +5 -0
- package/schemas/pre-order-product/set-pre-order-product-quantity-webshop-response.schema.ts +7 -0
- package/schemas/pre-order-product/update-pre-order-product-webshop-request.schema.ts +14 -0
- package/schemas/pre-order-product/update-pre-order-product-webshop-response.schema.ts +7 -0
- package/schemas/pre-order-product/update-pre-order-product.schema.ts +22 -0
- package/schemas/product/get-product-list-for-client-request.schema.ts +26 -0
- package/schemas/product/get-product-list-for-client-response.schema.ts +7 -0
- package/schemas/product/index.ts +15 -0
- package/schemas/product/product-base.schema.ts +39 -0
- package/schemas/product/product-catalog-name.schema.ts +8 -0
- package/schemas/product/product-consignment-for-client.schema.ts +6 -0
- package/schemas/product/product-discount-price-for-client.schema.ts +6 -0
- package/schemas/product/product-extended-for-admin-with-statistic.schema.ts +8 -0
- package/schemas/product/product-extended-for-admin.schema.ts +9 -0
- package/schemas/product/product-extended-for-client.schema.ts +31 -0
- package/schemas/product/product-extended.schema.ts +15 -0
- package/schemas/product/product-for-client.schema.ts +23 -0
- package/schemas/product/product-image-for-client.schema.ts +5 -0
- package/schemas/product/product-list-extended-for-client.schema.ts +7 -0
- package/schemas/product/product-list.schema.ts +2 -6
- package/schemas/product/product.schema.ts +6 -152
- package/schemas/transaction/get-transaction-list-for-client-request.schema.ts +28 -0
- package/schemas/transaction/get-transaction-list-for-client-response.schema.ts +7 -0
- package/schemas/transaction/index.ts +7 -0
- package/schemas/transaction/transaction-base.schema.ts +27 -0
- package/schemas/transaction/transaction-extended-for-client-list.schema.ts +7 -0
- package/schemas/transaction/transaction-extended-for-client.schema.ts +10 -0
- package/schemas/transaction/transaction-extended.schema.ts +10 -0
- package/schemas/transaction/transaction-for-client.schema.ts +17 -0
- package/schemas/transaction/transaction-list.schema.ts +5 -6
- package/schemas/transaction/transaction.schema.ts +6 -43
- package/schemas/user/index.ts +3 -0
- package/schemas/user/user-contact-for-client.schema.ts +8 -0
- package/schemas/user/user-name.schema.ts +4 -0
- package/schemas/write-off/create-write-off-from-order-for-client-request.schema.ts +9 -0
- package/schemas/write-off/create-write-off-from-order-for-client-response.schema.ts +7 -0
- package/schemas/write-off/get-write-off-list-by-order-for-client-request.schema.ts +3 -0
- package/schemas/write-off/get-write-off-list-by-order-for-client-response.schema.ts +7 -0
- package/schemas/write-off/index.ts +11 -0
- package/schemas/write-off/write-off-for-client.schema.ts +26 -0
- package/schemas/write-off/write-off-order-product-for-client.schema.ts +6 -0
- package/schemas/write-off/write-off.schema.ts +4 -4
|
@@ -1,73 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import { discountPriceOutcomeSchema } from '../../schemas';
|
|
4
|
-
import { MoneySchema } from '../../schemas/money.schema';
|
|
5
|
-
|
|
6
|
-
const GetProductDiscountPriceRequestSchema = z.object({
|
|
7
|
-
productUUID: z.uuid(),
|
|
8
|
-
clientUUID: z.preprocess(val => {
|
|
9
|
-
return val === 'null' ? null : val;
|
|
10
|
-
}, z.uuid().nullable().optional()),
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Цена товара по одному правилу — для показа вариантов.
|
|
15
|
-
*
|
|
16
|
-
* `discountValueData` описывает, чем правило обернулось для этого товара, а не как оно настроено:
|
|
17
|
-
* у правила от себестоимости это готовая цена, и самой наценки здесь нет.
|
|
18
|
-
*
|
|
19
|
-
* В списки попадают только варианты, которые действительно снижают цену: правило, оставляющее базу
|
|
20
|
-
* как есть, выбором не является.
|
|
21
|
-
*/
|
|
22
|
-
const ProductDiscountPriceItemSchema = z.object({
|
|
23
|
-
discountRulesUUID: z.string(),
|
|
24
|
-
type: z.nativeEnum(DiscountRulesTypeEnum),
|
|
25
|
-
discountValueData: discountPriceOutcomeSchema,
|
|
26
|
-
priceWithDiscount: MoneySchema,
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Готовые цены товара для клиента: то, что нужно при работе с товаром, а не при настройке правил.
|
|
31
|
-
*
|
|
32
|
-
* Считает бэк тем же движком, что и для витрины, — панель формулу скидок не повторяет и
|
|
33
|
-
* себестоимость не получает. Настройка правил живёт отдельно, в `GetDiscountRulesAllContractQuery`.
|
|
34
|
-
*
|
|
35
|
-
* `null` в ценах со скидкой означает «скидка неприменима», а не «ноль».
|
|
36
|
-
*/
|
|
37
|
-
const GetProductDiscountPriceResponseSchema = z.object({
|
|
38
|
-
message: z.string().optional(),
|
|
39
|
-
data: z.object({
|
|
40
|
-
productUUID: z.string(),
|
|
41
|
-
price: MoneySchema,
|
|
42
|
-
priceWithBestDiscount: MoneySchema.nullable(),
|
|
43
|
-
multiplicityOptions: z
|
|
44
|
-
.object({
|
|
45
|
-
uuid: z.string(),
|
|
46
|
-
optionPrice: MoneySchema.nullable(),
|
|
47
|
-
optionPriceWithDiscount: MoneySchema.nullable(),
|
|
48
|
-
isDiscountApplicable: z.boolean(),
|
|
49
|
-
/**
|
|
50
|
-
* Варианты по этой фасовке: те же правила, но посчитанные от её цены.
|
|
51
|
-
*
|
|
52
|
-
* Список свой у каждой кратности, потому что база у них разная — у правила нет
|
|
53
|
-
* одной цены на товар, пока не выбрана форма отгрузки. Пустой список означает
|
|
54
|
-
* «выбирать нечего»: скидки к этой кратности запрещены продавцом либо ни одно
|
|
55
|
-
* правило её цену не снижает.
|
|
56
|
-
*
|
|
57
|
-
* Порядок элементов не отсортирован по цене — он унаследован от сортировки правил
|
|
58
|
-
* товара, а база у фасовки другая. Лучшую цену берите из `optionPriceWithDiscount`,
|
|
59
|
-
* а не из первого элемента.
|
|
60
|
-
*/
|
|
61
|
-
discountDataList: ProductDiscountPriceItemSchema.array(),
|
|
62
|
-
})
|
|
63
|
-
.array(),
|
|
64
|
-
/**
|
|
65
|
-
* Варианты по базовой цене товара. Как и у фасовок, порядок не гарантирован: лучшую цену
|
|
66
|
-
* отдаёт `priceWithBestDiscount`.
|
|
67
|
-
*/
|
|
68
|
-
discountDataList: ProductDiscountPriceItemSchema.array(),
|
|
69
|
-
}),
|
|
70
|
-
});
|
|
2
|
+
import { GetProductDiscountPriceRequestSchema, GetProductDiscountPriceResponseSchema } from '../../schemas';
|
|
71
3
|
|
|
72
4
|
export namespace GetProductDiscountPriceContractQuery {
|
|
73
5
|
export const RequestSchema = GetProductDiscountPriceRequestSchema;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const CreateCartRequestSchema = z.object({});
|
|
5
|
-
|
|
6
|
-
const CreateCartResponseSchema = z.object({
|
|
7
|
-
message: z.string().optional(),
|
|
8
|
-
data: OrderForClientSchema,
|
|
9
|
-
});
|
|
2
|
+
import { CreateCartRequestSchema, CreateCartResponseSchema } from '../../../schemas';
|
|
10
3
|
|
|
11
4
|
export namespace CreateCartContractCommand {
|
|
12
5
|
export const RequestSchema = CreateCartRequestSchema;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const GetOrderForClientRequestSchema = z.object({});
|
|
5
|
-
|
|
6
|
-
const GetOrderForClientResponseSchema = z.object({
|
|
7
|
-
message: z.string().optional(),
|
|
8
|
-
data: OrderExtendedForClientSchema.nullable(),
|
|
9
|
-
});
|
|
2
|
+
import { GetOrderForClientRequestSchema, GetOrderForClientResponseSchema } from '../../../schemas';
|
|
10
3
|
|
|
11
4
|
export namespace GetOrderForClientContractQuery {
|
|
12
5
|
export const RequestSchema = GetOrderForClientRequestSchema;
|
|
@@ -1,53 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import { dateRangeCheck, setEndDay, setStartDay } from '../../../helpers/date.helper';
|
|
4
|
-
import { OrderStatusEnum } from '../../../enum/order-status.enum';
|
|
5
|
-
import { OrderWebshopAvailableStatusList } from '../../../enum';
|
|
6
|
-
|
|
7
|
-
const GetOrderForClientListRequestSchema = z
|
|
8
|
-
.object({
|
|
9
|
-
page: z.coerce.number().default(1),
|
|
10
|
-
count: z.coerce.number().default(10),
|
|
11
|
-
startDate: z.coerce
|
|
12
|
-
.date()
|
|
13
|
-
.optional()
|
|
14
|
-
.transform(val => (val ? setStartDay(val) : val)),
|
|
15
|
-
endDate: z.coerce
|
|
16
|
-
.date()
|
|
17
|
-
.optional()
|
|
18
|
-
.transform(val => (val ? setEndDay(val) : val)),
|
|
19
|
-
isPaid: z.coerce.boolean().optional(),
|
|
20
|
-
statuses: z
|
|
21
|
-
.nativeEnum(OrderStatusEnum)
|
|
22
|
-
.array()
|
|
23
|
-
.optional()
|
|
24
|
-
.transform(arr => (arr && arr.length === 0 ? OrderWebshopAvailableStatusList : (arr ?? OrderWebshopAvailableStatusList)))
|
|
25
|
-
.default(OrderWebshopAvailableStatusList)
|
|
26
|
-
.refine(arr => arr.every(s => OrderWebshopAvailableStatusList.includes(s)), {
|
|
27
|
-
message: 'validation.statusNotAllowedWebshop',
|
|
28
|
-
}),
|
|
29
|
-
})
|
|
30
|
-
.refine(
|
|
31
|
-
value => {
|
|
32
|
-
const { startDate, endDate } = value;
|
|
33
|
-
if (startDate && endDate) {
|
|
34
|
-
return dateRangeCheck(startDate, endDate);
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
message: 'validation.dateRange',
|
|
40
|
-
path: ['endDate', 'startDate'],
|
|
41
|
-
},
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const GetOrderForClientListResponseSchema = z.object({
|
|
45
|
-
message: z.string().optional(),
|
|
46
|
-
data: z.object({
|
|
47
|
-
orderList: OrderExtendedForClientSchema.array(),
|
|
48
|
-
total: z.number(),
|
|
49
|
-
}),
|
|
50
|
-
});
|
|
2
|
+
import { GetOrderForClientListRequestSchema, GetOrderForClientListResponseSchema } from '../../../schemas';
|
|
51
3
|
|
|
52
4
|
export namespace GetOrderForClientListContractQuery {
|
|
53
5
|
export const RequestSchema = GetOrderForClientListRequestSchema;
|
|
@@ -1,29 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const UpdateCartRequestSchema = z.object({
|
|
5
|
-
clientComment: z.string().nullable().optional().default(null),
|
|
6
|
-
branchUUID: z.uuid().optional().nullable().default(null),
|
|
7
|
-
// Дата выдачи/доставки заказа — одна для самовывоза и доставки. Относится к товару в наличии:
|
|
8
|
-
// заказы с товаром в пути после оформления получают дату прихода. Имеет приоритет над
|
|
9
|
-
// устаревшим `delivery.deliveryDate`.
|
|
10
|
-
plannedShipmentDate: CalendarDaySchema.nullable().optional(),
|
|
11
|
-
delivery: z
|
|
12
|
-
.object({
|
|
13
|
-
/** @deprecated Используйте `plannedShipmentDate` — единую дату для самовывоза и доставки. */
|
|
14
|
-
deliveryDate: z.coerce.date().optional().nullable().default(null),
|
|
15
|
-
address: z.string().nullable().optional().default(null),
|
|
16
|
-
time: z.string().nullable().optional().default(null),
|
|
17
|
-
})
|
|
18
|
-
.optional()
|
|
19
|
-
.nullable()
|
|
20
|
-
.default(null),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const UpdateCartResponseSchema = z.object({
|
|
24
|
-
message: z.string().optional(),
|
|
25
|
-
data: OrderForClientSchema,
|
|
26
|
-
});
|
|
2
|
+
import { UpdateCartRequestSchema, UpdateCartResponseSchema } from '../../../schemas';
|
|
27
3
|
|
|
28
4
|
export namespace UpdateCartContractCommand {
|
|
29
5
|
export const RequestSchema = UpdateCartRequestSchema;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const GetOrderProductForClientListRequestSchema = z.object({});
|
|
5
|
-
|
|
6
|
-
const GetOrderProductForClientListResponseSchema = z.object({
|
|
7
|
-
message: z.string().optional(),
|
|
8
|
-
data: OrderProductForClientListSchema,
|
|
9
|
-
});
|
|
2
|
+
import { GetOrderProductForClientListRequestSchema, GetOrderProductForClientListResponseSchema } from '../../../schemas';
|
|
10
3
|
|
|
11
4
|
export namespace GetOrderProductForClientListContractQuery {
|
|
12
5
|
export const RequestSchema = GetOrderProductForClientListRequestSchema;
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { PreOrderStatusEnum } from '../../../enum';
|
|
3
|
-
import { PreOrderListSchema } from '../../../schemas';
|
|
4
|
-
|
|
5
|
-
const GetPreOrderListWebshopRequestSchema = z.object({
|
|
6
|
-
page: z.coerce.number().optional().default(1),
|
|
7
|
-
count: z.coerce.number().optional().default(10),
|
|
8
|
-
statuses: z.array(z.nativeEnum(PreOrderStatusEnum)).optional(),
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
const GetPreOrderListResponseSchema = z.object({
|
|
12
|
-
data: PreOrderListSchema,
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export namespace GetPreOrderListWebshopContractCommand {
|
|
16
|
-
export const RequestSchema = GetPreOrderListWebshopRequestSchema;
|
|
17
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
18
|
-
|
|
19
|
-
export const ResponseSchema = GetPreOrderListResponseSchema;
|
|
20
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
21
|
-
}
|
|
1
|
+
export { GetPreOrderListWebshopContractCommand } from './get-pre-order-list-webshop.query';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GetPreOrderListWebshopRequestSchema, GetPreOrderListWebshopResponseSchema } from '../../../schemas';
|
|
3
|
+
|
|
4
|
+
export namespace GetPreOrderListWebshopContractCommand {
|
|
5
|
+
export const RequestSchema = GetPreOrderListWebshopRequestSchema;
|
|
6
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
7
|
+
|
|
8
|
+
export const ResponseSchema = GetPreOrderListWebshopResponseSchema;
|
|
9
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GetPreOrderWebshopResponseSchema } from '../../../schemas';
|
|
3
|
+
|
|
4
|
+
export namespace GetPreOrderWebshopContractQuery {
|
|
5
|
+
export const ResponseSchema = GetPreOrderWebshopResponseSchema;
|
|
6
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
7
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './update-pre-order-webshop.command';
|
|
2
2
|
export * from './create-pre-order-webshop.command';
|
|
3
|
-
export * from './get-pre-order-list-webshop.
|
|
3
|
+
export * from './get-pre-order-list-webshop.query';
|
|
4
4
|
export * from './delete-pre-order-webshop.command';
|
|
5
5
|
export * from './checkout-pre-order-webshop.command';
|
|
6
|
+
export * from './get-pre-order-webshop.query';
|
package/commands/pre-order-collection-item/delete-group-pre-order-collection-item.command.ts
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
const DeleteGroupPreOrderCollectionItemRequestSchema = z.object({
|
|
4
|
-
preOrderCollectionItemUUIDs: z.array(z.string()),
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
const DeleteGroupPreOrderCollectionItemResponseSchema = z.object({
|
|
8
|
-
message: z.string().optional(),
|
|
9
|
-
data: z.object({
|
|
10
|
-
success: z.boolean(),
|
|
11
|
-
missedItems: z.array(z.string()).optional(),
|
|
12
|
-
}),
|
|
13
|
-
});
|
|
2
|
+
import { DeleteGroupPreOrderCollectionItemRequestSchema, DeleteGroupPreOrderCollectionItemResponseSchema } from '../../schemas';
|
|
14
3
|
|
|
15
4
|
export namespace DeleteGroupPreOrderCollectionItemContractCommand {
|
|
16
5
|
export const RequestSchema = DeleteGroupPreOrderCollectionItemRequestSchema;
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
colors: z.array(z.string()).optional(),
|
|
7
|
-
preOrderCollectionsUUID: z.array(z.string()).optional(),
|
|
8
|
-
categoriesUUID: z.array(z.string()).optional(),
|
|
9
|
-
growers: z.array(z.string()).optional(),
|
|
10
|
-
countries: z.array(z.string()).optional(),
|
|
11
|
-
searchQuery: z.string().optional(),
|
|
12
|
-
page: z.coerce.number().optional().default(1),
|
|
13
|
-
count: z.coerce.number().optional().default(10),
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const GetPreOrderCollectionItemGroupedListForClientResponseSchema = z.object({
|
|
17
|
-
message: z.string().optional(),
|
|
18
|
-
data: PreOrderCollectionItemGroupedListSchema,
|
|
19
|
-
});
|
|
2
|
+
import {
|
|
3
|
+
PreOrderCollectionItemCatalogFilterForClientRequestSchema,
|
|
4
|
+
GetPreOrderCollectionItemGroupedListForClientResponseSchema,
|
|
5
|
+
} from '../../schemas';
|
|
20
6
|
|
|
21
7
|
export namespace GetPreOrderCollectionItemGroupedListForClientContractQuery {
|
|
22
|
-
export const RequestSchema =
|
|
8
|
+
export const RequestSchema = PreOrderCollectionItemCatalogFilterForClientRequestSchema;
|
|
23
9
|
export type Request = z.infer<typeof RequestSchema>;
|
|
24
10
|
|
|
25
11
|
export const ResponseSchema = GetPreOrderCollectionItemGroupedListForClientResponseSchema;
|
package/commands/pre-order-collection-item/get-pre-order-collection-item-list-for-client.query.ts
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
colors: z.array(z.string()).optional(),
|
|
7
|
-
preOrderCollectionsUUID: z.array(z.string()).optional(),
|
|
8
|
-
categoriesUUID: z.array(z.string()).optional(),
|
|
9
|
-
growers: z.array(z.string()).optional(),
|
|
10
|
-
countries: z.array(z.string()).optional(),
|
|
11
|
-
searchQuery: z.string().optional(),
|
|
12
|
-
page: z.coerce.number().optional().default(1),
|
|
13
|
-
count: z.coerce.number().optional().default(10),
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const GetPreOrderCollectionItemListForClientResponseSchema = z.object({
|
|
17
|
-
message: z.string().optional(),
|
|
18
|
-
data: PreOrderCollectionItemExtendedWithPreOrderCollectionListSchema,
|
|
19
|
-
});
|
|
2
|
+
import {
|
|
3
|
+
PreOrderCollectionItemCatalogFilterForClientRequestSchema,
|
|
4
|
+
GetPreOrderCollectionItemListForClientResponseSchema,
|
|
5
|
+
} from '../../schemas';
|
|
20
6
|
|
|
21
7
|
export namespace GetPreOrderCollectionItemListForClientContractQuery {
|
|
22
|
-
export const RequestSchema =
|
|
8
|
+
export const RequestSchema = PreOrderCollectionItemCatalogFilterForClientRequestSchema;
|
|
23
9
|
export type Request = z.infer<typeof RequestSchema>;
|
|
24
10
|
|
|
25
11
|
export const ResponseSchema = GetPreOrderCollectionItemListForClientResponseSchema;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const CreatePreOrderProductWebshopResponseSchema = z.object({
|
|
5
|
-
message: z.string().optional(),
|
|
6
|
-
data: PreOrderProductSchema,
|
|
7
|
-
});
|
|
2
|
+
import { CreatePreOrderProductWebshopRequestSchema, CreatePreOrderProductWebshopResponseSchema } from '../../schemas';
|
|
8
3
|
|
|
9
4
|
export namespace CreatePreOrderProductWebshopContractCommand {
|
|
10
|
-
export const RequestSchema =
|
|
5
|
+
export const RequestSchema = CreatePreOrderProductWebshopRequestSchema;
|
|
11
6
|
export type Request = z.infer<typeof RequestSchema>;
|
|
12
7
|
|
|
13
8
|
export const ResponseSchema = CreatePreOrderProductWebshopResponseSchema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PaginationRequestSchema, GetPreOrderProductExtendedListWebshopResponseSchema } from '../../schemas';
|
|
3
|
+
|
|
4
|
+
export namespace GetPreOrderProductExtendedListWebshopContractQuery {
|
|
5
|
+
export const RequestSchema = PaginationRequestSchema;
|
|
6
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
7
|
+
|
|
8
|
+
export const ResponseSchema = GetPreOrderProductExtendedListWebshopResponseSchema;
|
|
9
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
10
|
+
}
|
|
@@ -11,6 +11,7 @@ export * from './delete-pre-order-product-webshop.command';
|
|
|
11
11
|
export * from './update-pre-order-product-webshop.command';
|
|
12
12
|
export * from './get-pre-order-product-list.query';
|
|
13
13
|
export * from './get-pre-order-product-extended-list.query';
|
|
14
|
+
export * from './get-pre-order-product-extended-list-webshop.query';
|
|
14
15
|
export * from './get-active-stepper-positions.query';
|
|
15
16
|
export * from './create-manually-pre-order-product-for-standing-order.command';
|
|
16
17
|
export * from './get-pre-order-products-by-pre-order-list.command';
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const UpdatePreOrderProductWebshopResponseSchema = z.object({
|
|
5
|
-
message: z.string().optional(),
|
|
6
|
-
data: PreOrderProductSchema,
|
|
7
|
-
});
|
|
2
|
+
import { UpdatePreOrderProductWebshopRequestSchema, UpdatePreOrderProductWebshopResponseSchema } from '../../schemas';
|
|
8
3
|
|
|
9
4
|
export namespace UpdatePreOrderProductWebshopContractCommand {
|
|
10
|
-
export const RequestSchema =
|
|
5
|
+
export const RequestSchema = UpdatePreOrderProductWebshopRequestSchema;
|
|
11
6
|
export type Request = z.infer<typeof RequestSchema>;
|
|
12
7
|
|
|
13
8
|
export const ResponseSchema = UpdatePreOrderProductWebshopResponseSchema;
|
|
@@ -1,35 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import { ProductListExtendedForClientSchema } from '../../../schemas';
|
|
4
|
-
|
|
5
|
-
const GetProductListForClientRequestSchema = z.object({
|
|
6
|
-
page: z.string().transform(val => Number(val) || 1),
|
|
7
|
-
count: z.string().transform(val => Number(val) || 10),
|
|
8
|
-
stock: z
|
|
9
|
-
.string()
|
|
10
|
-
.transform(val => (val === 'true' ? true : val === 'false' ? false : undefined))
|
|
11
|
-
.optional(),
|
|
12
|
-
deliveryDates: z.coerce.date().array().optional(),
|
|
13
|
-
sizes: z.string().array().optional(),
|
|
14
|
-
colors: z.string().array().optional(),
|
|
15
|
-
growers: z.string().array().optional(),
|
|
16
|
-
countries: z.string().array().optional(),
|
|
17
|
-
categoryUUID: z.string().optional(),
|
|
18
|
-
typeUUID: z.string().optional(),
|
|
19
|
-
searchQuery: z.string().optional(),
|
|
20
|
-
marks: z.nativeEnum(ProductMarkEnum).array().optional(),
|
|
21
|
-
// Без `sortBy` порядок остаётся прежним — по категории, названию и размеру. Сортировка по цене
|
|
22
|
-
// идёт по базовому прайсу, скидки клиента её не двигают: см. ProductClientSortByEnum.
|
|
23
|
-
sortBy: z.nativeEnum(ProductClientSortByEnum).optional(),
|
|
24
|
-
// Без `.default()`: он уезжает в `_output`, а значит и в опубликованный `Request`, делая поле
|
|
25
|
-
// обязательным для клиентов. Отсутствующее направление билдер и так читает как ASC.
|
|
26
|
-
sortOrder: z.nativeEnum(OrderByEnum).optional(),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const GetProductListForClientResponseSchema = z.object({
|
|
30
|
-
message: z.string().optional(),
|
|
31
|
-
data: ProductListExtendedForClientSchema,
|
|
32
|
-
});
|
|
2
|
+
import { GetProductListForClientRequestSchema, GetProductListForClientResponseSchema } from '../../../schemas';
|
|
33
3
|
|
|
34
4
|
export namespace GetProductListForClientContractQuery {
|
|
35
5
|
export const RequestSchema = GetProductListForClientRequestSchema;
|
|
@@ -1,37 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import { dateRangeCheck } from '../../../helpers/date.helper';
|
|
4
|
-
import { TransactionTypeEnum } from '../../../enum';
|
|
5
|
-
|
|
6
|
-
const GetTransactionListForClientRequestSchema = z
|
|
7
|
-
.object({
|
|
8
|
-
page: z.coerce.number().optional().default(1),
|
|
9
|
-
count: z.coerce.number().optional().default(10),
|
|
10
|
-
startDate: z.coerce.date().optional(),
|
|
11
|
-
endDate: z.coerce.date().optional(),
|
|
12
|
-
transactionType: z.nativeEnum(TransactionTypeEnum).optional(),
|
|
13
|
-
moneyAccountUUID: z.string().optional(),
|
|
14
|
-
orderUUID: z.string().optional(),
|
|
15
|
-
searchQuery: z.string().optional(),
|
|
16
|
-
})
|
|
17
|
-
.refine(
|
|
18
|
-
value => {
|
|
19
|
-
const { startDate, endDate } = value;
|
|
20
|
-
if (startDate && endDate) {
|
|
21
|
-
return dateRangeCheck(startDate, endDate);
|
|
22
|
-
}
|
|
23
|
-
return true;
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
message: 'validation.dateRange',
|
|
27
|
-
path: ['endDate', 'startDate'],
|
|
28
|
-
},
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
const GetTransactionListForClientResponseSchema = z.object({
|
|
32
|
-
message: z.string().optional(),
|
|
33
|
-
data: TransactionListForClientSchema,
|
|
34
|
-
});
|
|
2
|
+
import { GetTransactionListForClientRequestSchema, GetTransactionListForClientResponseSchema } from '../../../schemas';
|
|
35
3
|
|
|
36
4
|
export namespace GetTransactionListForClientContractQuery {
|
|
37
5
|
export const RequestSchema = GetTransactionListForClientRequestSchema;
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const CreateWriteOffFromOrderForClientRequestSchema = z.object({
|
|
5
|
-
// Колонка `WriteOff.quantity` — Int: дробное значение доходило до Prisma и падало общей ошибкой.
|
|
6
|
-
quantity: z.coerce.number().int().positive(),
|
|
7
|
-
comment: z.string().nullable(),
|
|
8
|
-
productUUID: z.string(),
|
|
9
|
-
orderProductUUID: z.string(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const CreateWriteOffFromOrderForClientResponseSchema = z.object({
|
|
13
|
-
message: z.string().optional(),
|
|
14
|
-
data: WriteOffSchema.nullable(),
|
|
15
|
-
});
|
|
2
|
+
import { CreateWriteOffFromOrderForClientRequestSchema, CreateWriteOffFromOrderForClientResponseSchema } from '../../../schemas';
|
|
16
3
|
|
|
17
4
|
export namespace CreateWriteOffFromOrderForClientContractCommand {
|
|
18
5
|
export const RequestSchema = CreateWriteOffFromOrderForClientRequestSchema;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const GetWriteOffListByOrderForClientRequestSchema = z.object({});
|
|
5
|
-
|
|
6
|
-
const GetWriteOffListByOrderForClientResponseSchema = z.object({
|
|
7
|
-
message: z.string().optional(),
|
|
8
|
-
data: WriteOffSchema.array(),
|
|
9
|
-
});
|
|
2
|
+
import { GetWriteOffListByOrderForClientRequestSchema, GetWriteOffListByOrderForClientResponseSchema } from '../../../schemas';
|
|
10
3
|
|
|
11
4
|
export namespace GetWriteOffListByOrderForClientContractQuery {
|
|
12
5
|
export const RequestSchema = GetWriteOffListByOrderForClientRequestSchema;
|
package/constant/error.ts
CHANGED
|
@@ -405,6 +405,12 @@ export const ERRORS = {
|
|
|
405
405
|
message: 'An active write-off for this order product already exists',
|
|
406
406
|
httpCode: 409,
|
|
407
407
|
},
|
|
408
|
+
WRITE_OFF_ORDER_PRODUCT_MISMATCH: {
|
|
409
|
+
code: 'W019',
|
|
410
|
+
message: 'The order product does not belong to the order or has another product',
|
|
411
|
+
httpCode: 400,
|
|
412
|
+
},
|
|
413
|
+
WRITE_OFF_NOT_PENDING: { code: 'W020', message: 'Only a pending write-off can be deleted by the client', httpCode: 400 },
|
|
408
414
|
|
|
409
415
|
//ORDER
|
|
410
416
|
ORDER_NOT_CREATED: { code: 'O001', message: 'Failed to create order', httpCode: 500 },
|
|
@@ -629,6 +635,7 @@ export const ERRORS = {
|
|
|
629
635
|
message: 'Cannot guarantee exclusive price correction right now, try again later',
|
|
630
636
|
httpCode: 503,
|
|
631
637
|
},
|
|
638
|
+
ORDER_PRODUCT_CART_NOT_EDITABLE: { code: 'OP029', message: 'Only an open cart can be changed by the client', httpCode: 400 },
|
|
632
639
|
|
|
633
640
|
//TRANSACTION
|
|
634
641
|
TRANSACTION_NOT_CREATED: { code: 'TR001', message: 'Failed to transaction product', httpCode: 500 },
|
|
@@ -1240,6 +1247,11 @@ export const ERRORS = {
|
|
|
1240
1247
|
message: 'Pre-orders changed during the move, retry the operation',
|
|
1241
1248
|
httpCode: 409,
|
|
1242
1249
|
},
|
|
1250
|
+
PRE_ORDER_COLLECTION_ITEM_MULTIPLICITY_OPTION_NOT_FOUND: {
|
|
1251
|
+
code: 'POCI040',
|
|
1252
|
+
message: 'Multiplicity option of the pre order collection item not found',
|
|
1253
|
+
httpCode: 404,
|
|
1254
|
+
},
|
|
1243
1255
|
|
|
1244
1256
|
// EMPLOYEE SCHEDULE
|
|
1245
1257
|
EMPLOYEE_SCHEDULE_NOT_CREATED: { code: 'ES001', message: 'Failed to create employee schedule', httpCode: 500 },
|
|
@@ -1263,6 +1275,7 @@ export const ERRORS = {
|
|
|
1263
1275
|
message: 'Too many products for a single consignment discount operation',
|
|
1264
1276
|
httpCode: 400,
|
|
1265
1277
|
},
|
|
1278
|
+
DISCOUNT_RULES_NOT_FOUND: { code: 'DR010', message: 'Discount-rules not found', httpCode: 404 },
|
|
1266
1279
|
|
|
1267
1280
|
// ACTION LOG
|
|
1268
1281
|
ACTION_LOG_NOT_CREATED: { code: 'ALG001', message: 'Failed to create action-log', httpCode: 500 },
|
package/package.json
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './category-create.schema';
|
|
2
|
+
export * from './category-filter-value.schema';
|
|
3
|
+
export * from './category-update.schema';
|
|
4
|
+
export * from './category-list-filter.schema';
|
|
5
|
+
export * from './category-list.schema';
|
|
6
|
+
export * from './category.schema';
|
|
7
|
+
export * from './category-name.schema';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ClientStatusEnum } from '../../enum/client-status.enum';
|
|
3
|
+
import { ClientContractStatusEnum } from '../../enum/client-contract-status.enum';
|
|
4
|
+
import { ClientTypeEnum } from '../../enum/client-type.enum';
|
|
5
|
+
import { MoneySchema } from '../money.schema';
|
|
6
|
+
|
|
7
|
+
export const ClientSchema = z.object({
|
|
8
|
+
uuid: z.uuid(),
|
|
9
|
+
name: z.string(),
|
|
10
|
+
contactName: z.string().nullable(),
|
|
11
|
+
phone: z.string().nullable(),
|
|
12
|
+
email: z.string().nullable(),
|
|
13
|
+
status: z.nativeEnum(ClientStatusEnum),
|
|
14
|
+
isCommon: z.boolean(),
|
|
15
|
+
contractNumber: z.string().nullable(),
|
|
16
|
+
contractDate: z.date().nullable(),
|
|
17
|
+
contractStatus: z.nativeEnum(ClientContractStatusEnum),
|
|
18
|
+
address: z.string().nullable(),
|
|
19
|
+
city: z.string().nullable(),
|
|
20
|
+
code: z.string().nullable(),
|
|
21
|
+
group: z.string().nullable(),
|
|
22
|
+
marking: z.string().nullable(),
|
|
23
|
+
alwaysRequiresDelivery: z.boolean(),
|
|
24
|
+
additionalPhone: z.string().nullable(),
|
|
25
|
+
comment: z.string().nullable(),
|
|
26
|
+
paymentGraceDaysAfterCompletion: z.number().nullable(),
|
|
27
|
+
|
|
28
|
+
balance: MoneySchema,
|
|
29
|
+
|
|
30
|
+
deletedAt: z.date().nullable(),
|
|
31
|
+
createdAt: z.date(),
|
|
32
|
+
updatedAt: z.date(),
|
|
33
|
+
companyUUID: z.uuid(),
|
|
34
|
+
|
|
35
|
+
clientType: z.nativeEnum(ClientTypeEnum),
|
|
36
|
+
responsibleUserUUID: z.uuid().nullable(),
|
|
37
|
+
responsibleSince: z.date().nullable(),
|
|
38
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ClientForClientSchema } from './client-for-client.schema';
|
|
2
|
+
import { ClientIndividualProfileSchema } from './client-individual-profile.schema';
|
|
3
|
+
import { ClientLegalProfileSchema } from './client-legal-profile.schema';
|
|
4
|
+
import { UserContactForClientSchema } from '../user/user-contact-for-client.schema';
|
|
5
|
+
import { UserNameSchema } from '../user/user-name.schema';
|
|
6
|
+
import { DiscountRulesForClientSchema } from '../discount-rules/discount-rules-for-client.schema';
|
|
7
|
+
|
|
8
|
+
// Карточка клиента для `GET webshop/client/me`: менеджер — только имя, учётная запись — контакты входа.
|
|
9
|
+
export const ClientExtendedForClientSchema = ClientForClientSchema.extend({
|
|
10
|
+
user: UserContactForClientSchema.nullable(),
|
|
11
|
+
responsibleUser: UserNameSchema.nullable(),
|
|
12
|
+
clientIndividualProfile: ClientIndividualProfileSchema.nullable(),
|
|
13
|
+
clientLegalProfile: ClientLegalProfileSchema.nullable(),
|
|
14
|
+
discountRulesList: DiscountRulesForClientSchema.array(),
|
|
15
|
+
});
|