@djust-b2b/djust-front-sdk 3.0.0-beta.5 → 3.0.0-beta.7
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/README.md +50 -7
- package/dist/.tsbuildinfo +1 -0
- package/dist/.tsbuildinfo-esm +1 -0
- package/dist/client/create-client.d.ts +233 -0
- package/dist/client/create-client.d.ts.map +1 -0
- package/dist/client/index.d.ts +14 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/performance.d.ts +203 -0
- package/dist/client/performance.d.ts.map +1 -0
- package/dist/client/transport.d.ts +367 -0
- package/dist/client/transport.d.ts.map +1 -0
- package/dist/errors/base.d.ts +101 -0
- package/dist/errors/base.d.ts.map +1 -0
- package/dist/errors/classes/auth.error.d.ts +64 -0
- package/dist/errors/classes/auth.error.d.ts.map +1 -0
- package/dist/errors/classes/forbidden.error.d.ts +52 -0
- package/dist/errors/classes/forbidden.error.d.ts.map +1 -0
- package/dist/errors/classes/index.d.ts +17 -0
- package/dist/errors/classes/index.d.ts.map +1 -0
- package/dist/errors/classes/network.error.d.ts +63 -0
- package/dist/errors/classes/network.error.d.ts.map +1 -0
- package/dist/errors/classes/not-found.error.d.ts +58 -0
- package/dist/errors/classes/not-found.error.d.ts.map +1 -0
- package/dist/errors/classes/rate-limit.error.d.ts +49 -0
- package/dist/errors/classes/rate-limit.error.d.ts.map +1 -0
- package/dist/errors/classes/server.error.d.ts +63 -0
- package/dist/errors/classes/server.error.d.ts.map +1 -0
- package/dist/errors/classes/timeout.error.d.ts +64 -0
- package/dist/errors/classes/timeout.error.d.ts.map +1 -0
- package/dist/errors/classes/unexpected.error.d.ts +70 -0
- package/dist/errors/classes/unexpected.error.d.ts.map +1 -0
- package/dist/errors/classes/validation.error.d.ts +68 -0
- package/dist/errors/classes/validation.error.d.ts.map +1 -0
- package/dist/errors/codes.d.ts +111 -0
- package/dist/errors/codes.d.ts.map +1 -0
- package/dist/errors/compat.d.ts +99 -0
- package/dist/errors/compat.d.ts.map +1 -0
- package/dist/errors/factory.d.ts +33 -0
- package/dist/errors/factory.d.ts.map +1 -0
- package/dist/errors/guards.d.ts +142 -0
- package/dist/errors/guards.d.ts.map +1 -0
- package/dist/errors/index.d.ts +25 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/types.d.ts +100 -0
- package/dist/errors/types.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +42 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/parameters-validation.d.ts +3 -0
- package/dist/helpers/parameters-validation.d.ts.map +1 -0
- package/dist/helpers/utils.d.ts +5 -0
- package/dist/helpers/utils.d.ts.map +1 -0
- package/dist/index.cjs +182 -0
- package/dist/index.d.ts +265 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +11515 -0
- package/dist/interfaces/index.d.ts +31 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/models/address.d.ts +61 -0
- package/dist/interfaces/models/address.d.ts.map +1 -0
- package/dist/interfaces/models/attribute.d.ts +31 -0
- package/dist/interfaces/models/attribute.d.ts.map +1 -0
- package/dist/interfaces/models/auth.d.ts +37 -0
- package/dist/interfaces/models/auth.d.ts.map +1 -0
- package/dist/interfaces/models/cart.d.ts +64 -0
- package/dist/interfaces/models/cart.d.ts.map +1 -0
- package/dist/interfaces/models/common.d.ts +68 -0
- package/dist/interfaces/models/common.d.ts.map +1 -0
- package/dist/interfaces/models/custom-field.d.ts +57 -0
- package/dist/interfaces/models/custom-field.d.ts.map +1 -0
- package/dist/interfaces/models/customer-account.d.ts +52 -0
- package/dist/interfaces/models/customer-account.d.ts.map +1 -0
- package/dist/interfaces/models/customer-organisation.d.ts +14 -0
- package/dist/interfaces/models/customer-organisation.d.ts.map +1 -0
- package/dist/interfaces/models/customer-user.d.ts +114 -0
- package/dist/interfaces/models/customer-user.d.ts.map +1 -0
- package/dist/interfaces/models/incident.d.ts +37 -0
- package/dist/interfaces/models/incident.d.ts.map +1 -0
- package/dist/interfaces/models/navigation-category.d.ts +22 -0
- package/dist/interfaces/models/navigation-category.d.ts.map +1 -0
- package/dist/interfaces/models/offer.d.ts +151 -0
- package/dist/interfaces/models/offer.d.ts.map +1 -0
- package/dist/interfaces/models/order.d.ts +701 -0
- package/dist/interfaces/models/order.d.ts.map +1 -0
- package/dist/interfaces/models/payment.d.ts +20 -0
- package/dist/interfaces/models/payment.d.ts.map +1 -0
- package/dist/interfaces/models/price.d.ts +6 -0
- package/dist/interfaces/models/price.d.ts.map +1 -0
- package/dist/interfaces/models/product.d.ts +243 -0
- package/dist/interfaces/models/product.d.ts.map +1 -0
- package/dist/interfaces/models/quote.d.ts +77 -0
- package/dist/interfaces/models/quote.d.ts.map +1 -0
- package/dist/interfaces/models/searchProduct.d.ts +128 -0
- package/dist/interfaces/models/searchProduct.d.ts.map +1 -0
- package/dist/interfaces/models/supplier.d.ts +72 -0
- package/dist/interfaces/models/supplier.d.ts.map +1 -0
- package/dist/services/attributes/attributes.service.d.ts +18 -0
- package/dist/services/attributes/attributes.service.d.ts.map +1 -0
- package/dist/services/attributes/definitions.d.ts +28 -0
- package/dist/services/attributes/definitions.d.ts.map +1 -0
- package/dist/services/attributes/endpoints.d.ts +12 -0
- package/dist/services/attributes/endpoints.d.ts.map +1 -0
- package/dist/services/attributes/index.d.ts +33 -0
- package/dist/services/attributes/index.d.ts.map +1 -0
- package/dist/services/attributes/module.d.ts +11 -0
- package/dist/services/attributes/module.d.ts.map +1 -0
- package/dist/services/attributes/types.d.ts +35 -0
- package/dist/services/attributes/types.d.ts.map +1 -0
- package/dist/services/auth/__mocks__/auth.mocks.d.ts +249 -0
- package/dist/services/auth/__mocks__/auth.mocks.d.ts.map +1 -0
- package/dist/services/auth/auth.service.d.ts +286 -0
- package/dist/services/auth/auth.service.d.ts.map +1 -0
- package/dist/services/auth/definitions.d.ts +69 -0
- package/dist/services/auth/definitions.d.ts.map +1 -0
- package/dist/services/auth/definitions.requests.d.ts +25 -0
- package/dist/services/auth/definitions.requests.d.ts.map +1 -0
- package/dist/services/auth/endpoints.d.ts +30 -0
- package/dist/services/auth/endpoints.d.ts.map +1 -0
- package/dist/services/auth/index.d.ts +232 -0
- package/dist/services/auth/index.d.ts.map +1 -0
- package/dist/services/auth/module.d.ts +11 -0
- package/dist/services/auth/module.d.ts.map +1 -0
- package/dist/services/auth/types.d.ts +124 -0
- package/dist/services/auth/types.d.ts.map +1 -0
- package/dist/services/base.service.d.ts +81 -0
- package/dist/services/base.service.d.ts.map +1 -0
- package/dist/services/cart/cart.service.d.ts +443 -0
- package/dist/services/cart/cart.service.d.ts.map +1 -0
- package/dist/services/cart/definitions.d.ts +84 -0
- package/dist/services/cart/definitions.d.ts.map +1 -0
- package/dist/services/cart/endpoints.d.ts +24 -0
- package/dist/services/cart/endpoints.d.ts.map +1 -0
- package/dist/services/cart/index.d.ts +330 -0
- package/dist/services/cart/index.d.ts.map +1 -0
- package/dist/services/cart/module.d.ts +11 -0
- package/dist/services/cart/module.d.ts.map +1 -0
- package/dist/services/cart/types.d.ts +236 -0
- package/dist/services/cart/types.d.ts.map +1 -0
- package/dist/services/commercial-order/commercial-order.service.d.ts +432 -0
- package/dist/services/commercial-order/commercial-order.service.d.ts.map +1 -0
- package/dist/services/commercial-order/definitions.d.ts +169 -0
- package/dist/services/commercial-order/definitions.d.ts.map +1 -0
- package/dist/services/commercial-order/endpoints.d.ts +28 -0
- package/dist/services/commercial-order/endpoints.d.ts.map +1 -0
- package/dist/services/commercial-order/index.d.ts +710 -0
- package/dist/services/commercial-order/index.d.ts.map +1 -0
- package/dist/services/commercial-order/module.d.ts +11 -0
- package/dist/services/commercial-order/module.d.ts.map +1 -0
- package/dist/services/commercial-order/types.d.ts +243 -0
- package/dist/services/commercial-order/types.d.ts.map +1 -0
- package/dist/services/custom-field/custom-field.service.d.ts +23 -0
- package/dist/services/custom-field/custom-field.service.d.ts.map +1 -0
- package/dist/services/custom-field/definitions.d.ts +107 -0
- package/dist/services/custom-field/definitions.d.ts.map +1 -0
- package/dist/services/custom-field/endpoints.d.ts +13 -0
- package/dist/services/custom-field/endpoints.d.ts.map +1 -0
- package/dist/services/custom-field/index.d.ts +115 -0
- package/dist/services/custom-field/index.d.ts.map +1 -0
- package/dist/services/custom-field/module.d.ts +11 -0
- package/dist/services/custom-field/module.d.ts.map +1 -0
- package/dist/services/custom-field/types.d.ts +51 -0
- package/dist/services/custom-field/types.d.ts.map +1 -0
- package/dist/services/customer-account/customer-account.service.d.ts +387 -0
- package/dist/services/customer-account/customer-account.service.d.ts.map +1 -0
- package/dist/services/customer-account/definitions.d.ts +164 -0
- package/dist/services/customer-account/definitions.d.ts.map +1 -0
- package/dist/services/customer-account/endpoints.d.ts +25 -0
- package/dist/services/customer-account/endpoints.d.ts.map +1 -0
- package/dist/services/customer-account/index.d.ts +656 -0
- package/dist/services/customer-account/index.d.ts.map +1 -0
- package/dist/services/customer-account/module.d.ts +11 -0
- package/dist/services/customer-account/module.d.ts.map +1 -0
- package/dist/services/customer-account/types.d.ts +253 -0
- package/dist/services/customer-account/types.d.ts.map +1 -0
- package/dist/services/customer-user/customer-user.service.d.ts +280 -0
- package/dist/services/customer-user/customer-user.service.d.ts.map +1 -0
- package/dist/services/customer-user/definitions.d.ts +84 -0
- package/dist/services/customer-user/definitions.d.ts.map +1 -0
- package/dist/services/customer-user/endpoints.d.ts +19 -0
- package/dist/services/customer-user/endpoints.d.ts.map +1 -0
- package/dist/services/customer-user/index.d.ts +394 -0
- package/dist/services/customer-user/index.d.ts.map +1 -0
- package/dist/services/customer-user/module.d.ts +11 -0
- package/dist/services/customer-user/module.d.ts.map +1 -0
- package/dist/services/customer-user/types.d.ts +118 -0
- package/dist/services/customer-user/types.d.ts.map +1 -0
- package/dist/services/factory.d.ts +104 -0
- package/dist/services/factory.d.ts.map +1 -0
- package/dist/services/incident/definitions.d.ts +85 -0
- package/dist/services/incident/definitions.d.ts.map +1 -0
- package/dist/services/incident/endpoints.d.ts +17 -0
- package/dist/services/incident/endpoints.d.ts.map +1 -0
- package/dist/services/incident/incident.service.d.ts +24 -0
- package/dist/services/incident/incident.service.d.ts.map +1 -0
- package/dist/services/incident/index.d.ts +270 -0
- package/dist/services/incident/index.d.ts.map +1 -0
- package/dist/services/incident/module.d.ts +11 -0
- package/dist/services/incident/module.d.ts.map +1 -0
- package/dist/services/incident/types.d.ts +116 -0
- package/dist/services/incident/types.d.ts.map +1 -0
- package/dist/services/logistic-order/definitions.d.ts +293 -0
- package/dist/services/logistic-order/definitions.d.ts.map +1 -0
- package/dist/services/logistic-order/endpoints.d.ts +43 -0
- package/dist/services/logistic-order/endpoints.d.ts.map +1 -0
- package/dist/services/logistic-order/index.d.ts +1300 -0
- package/dist/services/logistic-order/index.d.ts.map +1 -0
- package/dist/services/logistic-order/logistic-order.service.d.ts +57 -0
- package/dist/services/logistic-order/logistic-order.service.d.ts.map +1 -0
- package/dist/services/logistic-order/module.d.ts +11 -0
- package/dist/services/logistic-order/module.d.ts.map +1 -0
- package/dist/services/logistic-order/types.d.ts +402 -0
- package/dist/services/logistic-order/types.d.ts.map +1 -0
- package/dist/services/module.d.ts +64 -0
- package/dist/services/module.d.ts.map +1 -0
- package/dist/services/navigation-category/definitions.d.ts +31 -0
- package/dist/services/navigation-category/definitions.d.ts.map +1 -0
- package/dist/services/navigation-category/endpoints.d.ts +15 -0
- package/dist/services/navigation-category/endpoints.d.ts.map +1 -0
- package/dist/services/navigation-category/index.d.ts +114 -0
- package/dist/services/navigation-category/index.d.ts.map +1 -0
- package/dist/services/navigation-category/module.d.ts +11 -0
- package/dist/services/navigation-category/module.d.ts.map +1 -0
- package/dist/services/navigation-category/navigation-category.service.d.ts +148 -0
- package/dist/services/navigation-category/navigation-category.service.d.ts.map +1 -0
- package/dist/services/navigation-category/types.d.ts +51 -0
- package/dist/services/navigation-category/types.d.ts.map +1 -0
- package/dist/services/offer-inventories/definitions.d.ts +73 -0
- package/dist/services/offer-inventories/definitions.d.ts.map +1 -0
- package/dist/services/offer-inventories/endpoints.d.ts +16 -0
- package/dist/services/offer-inventories/endpoints.d.ts.map +1 -0
- package/dist/services/offer-inventories/index.d.ts +120 -0
- package/dist/services/offer-inventories/index.d.ts.map +1 -0
- package/dist/services/offer-inventories/module.d.ts +11 -0
- package/dist/services/offer-inventories/module.d.ts.map +1 -0
- package/dist/services/offer-inventories/offer-inventories.service.d.ts +26 -0
- package/dist/services/offer-inventories/offer-inventories.service.d.ts.map +1 -0
- package/dist/services/offer-inventories/types.d.ts +85 -0
- package/dist/services/offer-inventories/types.d.ts.map +1 -0
- package/dist/services/offer-prices/__mocks__/offer-prices.mocks.d.ts +109 -0
- package/dist/services/offer-prices/__mocks__/offer-prices.mocks.d.ts.map +1 -0
- package/dist/services/offer-prices/definitions.d.ts +24 -0
- package/dist/services/offer-prices/definitions.d.ts.map +1 -0
- package/dist/services/offer-prices/endpoints.d.ts +12 -0
- package/dist/services/offer-prices/endpoints.d.ts.map +1 -0
- package/dist/services/offer-prices/index.d.ts +36 -0
- package/dist/services/offer-prices/index.d.ts.map +1 -0
- package/dist/services/offer-prices/module.d.ts +11 -0
- package/dist/services/offer-prices/module.d.ts.map +1 -0
- package/dist/services/offer-prices/offer-prices.service.d.ts +18 -0
- package/dist/services/offer-prices/offer-prices.service.d.ts.map +1 -0
- package/dist/services/offer-prices/types.d.ts +33 -0
- package/dist/services/offer-prices/types.d.ts.map +1 -0
- package/dist/services/operation/definitions.d.ts +280 -0
- package/dist/services/operation/definitions.d.ts.map +1 -0
- package/dist/services/operation/endpoints.d.ts +18 -0
- package/dist/services/operation/endpoints.d.ts.map +1 -0
- package/dist/services/operation/index.d.ts +520 -0
- package/dist/services/operation/index.d.ts.map +1 -0
- package/dist/services/operation/module.d.ts +11 -0
- package/dist/services/operation/module.d.ts.map +1 -0
- package/dist/services/operation/operation.service.d.ts +32 -0
- package/dist/services/operation/operation.service.d.ts.map +1 -0
- package/dist/services/operation/types.d.ts +174 -0
- package/dist/services/operation/types.d.ts.map +1 -0
- package/dist/services/payment/definitions.d.ts +79 -0
- package/dist/services/payment/definitions.d.ts.map +1 -0
- package/dist/services/payment/endpoints.d.ts +16 -0
- package/dist/services/payment/endpoints.d.ts.map +1 -0
- package/dist/services/payment/index.d.ts +150 -0
- package/dist/services/payment/index.d.ts.map +1 -0
- package/dist/services/payment/module.d.ts +11 -0
- package/dist/services/payment/module.d.ts.map +1 -0
- package/dist/services/payment/payment.service.d.ts +224 -0
- package/dist/services/payment/payment.service.d.ts.map +1 -0
- package/dist/services/payment/types.d.ts +93 -0
- package/dist/services/payment/types.d.ts.map +1 -0
- package/dist/services/product/definitions.d.ts +149 -0
- package/dist/services/product/definitions.d.ts.map +1 -0
- package/dist/services/product/endpoints.d.ts +40 -0
- package/dist/services/product/endpoints.d.ts.map +1 -0
- package/dist/services/product/index.d.ts +387 -0
- package/dist/services/product/index.d.ts.map +1 -0
- package/dist/services/product/module.d.ts +11 -0
- package/dist/services/product/module.d.ts.map +1 -0
- package/dist/services/product/product.service.d.ts +452 -0
- package/dist/services/product/product.service.d.ts.map +1 -0
- package/dist/services/product/types.d.ts +344 -0
- package/dist/services/product/types.d.ts.map +1 -0
- package/dist/services/product-variant/definitions.d.ts +172 -0
- package/dist/services/product-variant/definitions.d.ts.map +1 -0
- package/dist/services/product-variant/endpoints.d.ts +15 -0
- package/dist/services/product-variant/endpoints.d.ts.map +1 -0
- package/dist/services/product-variant/index.d.ts +123 -0
- package/dist/services/product-variant/index.d.ts.map +1 -0
- package/dist/services/product-variant/module.d.ts +11 -0
- package/dist/services/product-variant/module.d.ts.map +1 -0
- package/dist/services/product-variant/product-variant.service.d.ts +21 -0
- package/dist/services/product-variant/product-variant.service.d.ts.map +1 -0
- package/dist/services/product-variant/types.d.ts +73 -0
- package/dist/services/product-variant/types.d.ts.map +1 -0
- package/dist/services/quote/definitions.d.ts +100 -0
- package/dist/services/quote/definitions.d.ts.map +1 -0
- package/dist/services/quote/endpoints.d.ts +20 -0
- package/dist/services/quote/endpoints.d.ts.map +1 -0
- package/dist/services/quote/index.d.ts +377 -0
- package/dist/services/quote/index.d.ts.map +1 -0
- package/dist/services/quote/module.d.ts +11 -0
- package/dist/services/quote/module.d.ts.map +1 -0
- package/dist/services/quote/quote.service.d.ts +345 -0
- package/dist/services/quote/quote.service.d.ts.map +1 -0
- package/dist/services/quote/types.d.ts +158 -0
- package/dist/services/quote/types.d.ts.map +1 -0
- package/dist/services/supplier/__mocks__/supplier-mocks.d.ts +49 -0
- package/dist/services/supplier/__mocks__/supplier-mocks.d.ts.map +1 -0
- package/dist/services/supplier/definitions.d.ts +30 -0
- package/dist/services/supplier/definitions.d.ts.map +1 -0
- package/dist/services/supplier/endpoints.d.ts +14 -0
- package/dist/services/supplier/endpoints.d.ts.map +1 -0
- package/dist/services/supplier/index.d.ts +102 -0
- package/dist/services/supplier/index.d.ts.map +1 -0
- package/dist/services/supplier/module.d.ts +11 -0
- package/dist/services/supplier/module.d.ts.map +1 -0
- package/dist/services/supplier/supplier.service.d.ts +20 -0
- package/dist/services/supplier/supplier.service.d.ts.map +1 -0
- package/dist/services/supplier/types.d.ts +58 -0
- package/dist/services/supplier/types.d.ts.map +1 -0
- package/dist/services/types.d.ts +81 -0
- package/dist/services/types.d.ts.map +1 -0
- package/dist/settings/fetch-instance.d.ts +30 -0
- package/dist/settings/fetch-instance.d.ts.map +1 -0
- package/package.json +8 -6
- package/dist/djust-b2b-djust-front-sdk-3.0.0-beta.5.tgz +0 -0
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # Quote Service
|
|
3
|
+
*
|
|
4
|
+
* B2B quote request and negotiation management.
|
|
5
|
+
*
|
|
6
|
+
* ## Features
|
|
7
|
+
* - Master quote creation and management
|
|
8
|
+
* - Supplier quote workflows
|
|
9
|
+
* - Quote acceptance/decline process
|
|
10
|
+
* - Quote-to-order conversion
|
|
11
|
+
* - Quote messaging
|
|
12
|
+
*
|
|
13
|
+
* @module services/quote
|
|
14
|
+
* @since 2.17.0
|
|
15
|
+
*/
|
|
16
|
+
import { BaseService } from "../base.service";
|
|
17
|
+
import type { RequestContext } from "../../client/transport";
|
|
18
|
+
import type { GetMasterQuotesParams, CreateMasterQuoteParams, DeleteMasterQuoteParams, GetMasterQuoteParams, UpdateMasterQuoteParams, CreateSupplierQuotesParams, GetSupplierQuoteParams, AcceptSupplierQuoteParams, DeclineSupplierQuoteParams, UpdateSupplierQuoteCustomFieldsParams, PostMessageToSupplierQuoteParams, InitializeOrderFromSupplierQuoteParams, GetMasterQuotesResponse, CreateMasterQuoteResponse, GetMasterQuoteResponse, UpdateMasterQuoteResponse, CreateSupplierQuotesResponse, GetSupplierQuoteResponse, AcceptSupplierQuoteResponse, DeclineSupplierQuoteResponse, UpdateSupplierQuoteCustomFieldsResponse, PostMessageToSupplierQuoteResponse, InitializeOrderFromSupplierQuoteResponse } from "./types";
|
|
19
|
+
/**
|
|
20
|
+
* Service for B2B quote management.
|
|
21
|
+
*
|
|
22
|
+
* Enables full quote workflow:
|
|
23
|
+
* - Create quote requests with multiple products
|
|
24
|
+
* - Send to suppliers for pricing
|
|
25
|
+
* - Review, accept or decline quotes
|
|
26
|
+
* - Convert accepted quotes to orders
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* import { createDjustClient } from '@djust-b2b/djust-front-sdk';
|
|
31
|
+
*
|
|
32
|
+
* const client = createDjustClient({ baseUrl, clientId, apiKey });
|
|
33
|
+
*
|
|
34
|
+
* // Create a master quote
|
|
35
|
+
* const masterQuote = await client.quote.createMasterQuote({
|
|
36
|
+
* name: 'Q-2024-001',
|
|
37
|
+
* description: 'Office supplies for Q1',
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* // Send to suppliers
|
|
41
|
+
* await client.quote.createSupplierQuotes({
|
|
42
|
+
* masterQuoteId: masterQuote.id,
|
|
43
|
+
* createSupplierQuoteRequests: [...],
|
|
44
|
+
* supplierQuoteUrl: 'https://myapp.com/quotes',
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare class QuoteService extends BaseService {
|
|
49
|
+
readonly serviceName = "quote";
|
|
50
|
+
/**
|
|
51
|
+
* Get paginated list of master quotes.
|
|
52
|
+
*
|
|
53
|
+
* **Endpoint**: `GET /v1/shop/quotes [QUO-100]`
|
|
54
|
+
*
|
|
55
|
+
* | Parameter | Type | Required | Description |
|
|
56
|
+
* |-----------------------|------------------|----------|--------------------------|
|
|
57
|
+
* | `fromCustomerAccount` | `boolean` | No | Filter to current account|
|
|
58
|
+
* | `pageable` | `PageableParams` | No | Pagination settings |
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* const { content: quotes } = await client.quote.getMasterQuotes({
|
|
63
|
+
* pageable: { page: 0, size: 10 },
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* quotes.forEach(q => console.log(`${q.name}: ${q.status}`));
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @param params - Query parameters
|
|
70
|
+
* @param context - Optional SSR request context
|
|
71
|
+
* @returns Paginated quote list
|
|
72
|
+
*/
|
|
73
|
+
getMasterQuotes(params?: GetMasterQuotesParams, context?: RequestContext): Promise<GetMasterQuotesResponse>;
|
|
74
|
+
/**
|
|
75
|
+
* Create a new master quote.
|
|
76
|
+
*
|
|
77
|
+
* A master quote is the main quote request that can be sent to multiple suppliers.
|
|
78
|
+
*
|
|
79
|
+
* **Endpoint**: `POST /v1/shop/quotes [QUO-101]`
|
|
80
|
+
*
|
|
81
|
+
* | Parameter | Type | Required | Description |
|
|
82
|
+
* |---------------|----------|----------|--------------------------|
|
|
83
|
+
* | `name` | `string` | Yes | Quote reference name |
|
|
84
|
+
* | `description` | `string` | Yes | Quote description |
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* const quote = await client.quote.createMasterQuote({
|
|
89
|
+
* name: 'Q-2024-001',
|
|
90
|
+
* description: 'Request for office furniture',
|
|
91
|
+
* });
|
|
92
|
+
*
|
|
93
|
+
* console.log(`Quote created: ${quote.id}`);
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @param params - Quote creation data
|
|
97
|
+
* @param context - Optional SSR request context
|
|
98
|
+
* @throws {ValidationError} If required parameters are missing
|
|
99
|
+
* @returns Created master quote
|
|
100
|
+
*/
|
|
101
|
+
createMasterQuote(params: CreateMasterQuoteParams, context?: RequestContext): Promise<CreateMasterQuoteResponse>;
|
|
102
|
+
/**
|
|
103
|
+
* Delete a master quote.
|
|
104
|
+
*
|
|
105
|
+
* **Endpoint**: `DELETE /v1/shop/quotes/{quoteId} [QUO-102]`
|
|
106
|
+
*
|
|
107
|
+
* | Parameter | Type | Required | Description |
|
|
108
|
+
* |-----------------|----------|----------|--------------------------|
|
|
109
|
+
* | `masterQuoteId` | `string` | Yes | Quote ID to delete |
|
|
110
|
+
*
|
|
111
|
+
* @param params - Quote identification
|
|
112
|
+
* @param context - Optional SSR request context
|
|
113
|
+
* @throws {ValidationError} If masterQuoteId is missing
|
|
114
|
+
* @throws {NotFoundError} If quote doesn't exist
|
|
115
|
+
*/
|
|
116
|
+
deleteMasterQuote(params: DeleteMasterQuoteParams, context?: RequestContext): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Get master quote details.
|
|
119
|
+
*
|
|
120
|
+
* **Endpoint**: `GET /v1/shop/quotes/{quoteId} [QUO-103]`
|
|
121
|
+
*
|
|
122
|
+
* | Parameter | Type | Required | Description |
|
|
123
|
+
* |-----------------|----------|----------|--------------------------|
|
|
124
|
+
* | `masterQuoteId` | `string` | Yes | Quote ID |
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```typescript
|
|
128
|
+
* const quote = await client.quote.getMasterQuote({
|
|
129
|
+
* masterQuoteId: 'quote-123',
|
|
130
|
+
* });
|
|
131
|
+
*
|
|
132
|
+
* console.log(`${quote.name}: ${quote.status}`);
|
|
133
|
+
* console.log(`Items: ${quote.details.length}`);
|
|
134
|
+
* ```
|
|
135
|
+
*
|
|
136
|
+
* @param params - Quote identification
|
|
137
|
+
* @param context - Optional SSR request context
|
|
138
|
+
* @throws {ValidationError} If masterQuoteId is missing
|
|
139
|
+
* @throws {NotFoundError} If quote doesn't exist
|
|
140
|
+
* @returns Master quote with details
|
|
141
|
+
*/
|
|
142
|
+
getMasterQuote(params: GetMasterQuoteParams, context?: RequestContext): Promise<GetMasterQuoteResponse>;
|
|
143
|
+
/**
|
|
144
|
+
* Update a master quote (add/remove items, custom fields).
|
|
145
|
+
*
|
|
146
|
+
* **Endpoint**: `PUT /v1/shop/quotes/{quoteId} [QUO-104]`
|
|
147
|
+
*
|
|
148
|
+
* | Parameter | Type | Required | Description |
|
|
149
|
+
* |------------------------------|----------|----------|--------------------------|
|
|
150
|
+
* | `masterQuoteId` | `string` | Yes | Quote ID |
|
|
151
|
+
* | `masterQuoteDetailsToAdd` | `array` | No | Items to add |
|
|
152
|
+
* | `masterQuoteDetailsToRemove` | `array` | No | Item IDs to remove |
|
|
153
|
+
* | `customFieldValues` | `object` | No | Custom field updates |
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* await client.quote.updateMasterQuote({
|
|
158
|
+
* masterQuoteId: 'quote-123',
|
|
159
|
+
* masterQuoteDetailsToAdd: [
|
|
160
|
+
* { productVariantId: 'variant-1', quantity: 10 },
|
|
161
|
+
* ],
|
|
162
|
+
* });
|
|
163
|
+
* ```
|
|
164
|
+
*
|
|
165
|
+
* @param params - Update data
|
|
166
|
+
* @param context - Optional SSR request context
|
|
167
|
+
* @throws {ValidationError} If masterQuoteId is missing
|
|
168
|
+
* @returns Updated master quote
|
|
169
|
+
*/
|
|
170
|
+
updateMasterQuote(params: UpdateMasterQuoteParams, context?: RequestContext): Promise<UpdateMasterQuoteResponse>;
|
|
171
|
+
/**
|
|
172
|
+
* Send quote requests to suppliers.
|
|
173
|
+
*
|
|
174
|
+
* Creates supplier quote requests from a master quote or ad-hoc.
|
|
175
|
+
*
|
|
176
|
+
* **Endpoint**: `POST /v1/shop/supplier-quotes [QUO-200]`
|
|
177
|
+
*
|
|
178
|
+
* | Parameter | Type | Required | Description |
|
|
179
|
+
* |-----------------------------|----------|----------|--------------------------|
|
|
180
|
+
* | `createSupplierQuoteRequests`| `array` | Yes | Quote requests per supplier |
|
|
181
|
+
* | `supplierQuoteUrl` | `string` | Yes | Callback URL for suppliers |
|
|
182
|
+
* | `masterQuoteId` | `string` | No | Link to master quote |
|
|
183
|
+
* | `billingAddressId` | `string` | No | Billing address |
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* const supplierQuotes = await client.quote.createSupplierQuotes({
|
|
188
|
+
* masterQuoteId: 'quote-123',
|
|
189
|
+
* supplierQuoteUrl: 'https://myapp.com/supplier-quotes',
|
|
190
|
+
* createSupplierQuoteRequests: [
|
|
191
|
+
* {
|
|
192
|
+
* supplierId: 'supplier-1',
|
|
193
|
+
* shippingAddressId: 'addr-1',
|
|
194
|
+
* lines: [{ productVariantId: 'var-1', quantity: 100 }],
|
|
195
|
+
* },
|
|
196
|
+
* ],
|
|
197
|
+
* });
|
|
198
|
+
* ```
|
|
199
|
+
*
|
|
200
|
+
* @param params - Supplier quote creation data
|
|
201
|
+
* @param context - Optional SSR request context
|
|
202
|
+
* @throws {ValidationError} If required parameters are missing
|
|
203
|
+
* @returns Created supplier quotes
|
|
204
|
+
*/
|
|
205
|
+
createSupplierQuotes(params: CreateSupplierQuotesParams, context?: RequestContext): Promise<CreateSupplierQuotesResponse>;
|
|
206
|
+
/**
|
|
207
|
+
* Get supplier quote details.
|
|
208
|
+
*
|
|
209
|
+
* **Endpoint**: `GET /v1/shop/supplier-quotes/{quoteId} [QUO-201]`
|
|
210
|
+
*
|
|
211
|
+
* | Parameter | Type | Required | Description |
|
|
212
|
+
* |-------------------|----------|----------|--------------------------|
|
|
213
|
+
* | `supplierQuoteId` | `string` | Yes | Supplier quote ID |
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```typescript
|
|
217
|
+
* const quote = await client.quote.getSupplierQuote({
|
|
218
|
+
* supplierQuoteId: 'sq-123',
|
|
219
|
+
* });
|
|
220
|
+
*
|
|
221
|
+
* console.log(`Supplier: ${quote.supplierName}`);
|
|
222
|
+
* console.log(`Status: ${quote.status}`);
|
|
223
|
+
* console.log(`Total: ${quote.totalAmount}`);
|
|
224
|
+
* ```
|
|
225
|
+
*
|
|
226
|
+
* @param params - Quote identification
|
|
227
|
+
* @param context - Optional SSR request context
|
|
228
|
+
* @throws {ValidationError} If supplierQuoteId is missing
|
|
229
|
+
* @returns Supplier quote details
|
|
230
|
+
*/
|
|
231
|
+
getSupplierQuote(params: GetSupplierQuoteParams, context?: RequestContext): Promise<GetSupplierQuoteResponse>;
|
|
232
|
+
/**
|
|
233
|
+
* Accept a supplier quote.
|
|
234
|
+
*
|
|
235
|
+
* Marks the quote as accepted, ready for order creation.
|
|
236
|
+
*
|
|
237
|
+
* **Endpoint**: `PUT /v1/shop/supplier-quotes/{quoteId}/accept [QUO-202]`
|
|
238
|
+
*
|
|
239
|
+
* | Parameter | Type | Required | Description |
|
|
240
|
+
* |-------------------|----------|----------|--------------------------|
|
|
241
|
+
* | `supplierQuoteId` | `string` | Yes | Supplier quote ID |
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* const accepted = await client.quote.acceptSupplierQuote({
|
|
246
|
+
* supplierQuoteId: 'sq-123',
|
|
247
|
+
* });
|
|
248
|
+
*
|
|
249
|
+
* console.log(`Quote accepted: ${accepted.status}`);
|
|
250
|
+
* ```
|
|
251
|
+
*
|
|
252
|
+
* @param params - Quote identification
|
|
253
|
+
* @param context - Optional SSR request context
|
|
254
|
+
* @throws {ValidationError} If supplierQuoteId is missing
|
|
255
|
+
* @returns Accepted quote
|
|
256
|
+
*/
|
|
257
|
+
acceptSupplierQuote(params: AcceptSupplierQuoteParams, context?: RequestContext): Promise<AcceptSupplierQuoteResponse>;
|
|
258
|
+
/**
|
|
259
|
+
* Decline a supplier quote.
|
|
260
|
+
*
|
|
261
|
+
* **Endpoint**: `PUT /v1/shop/supplier-quotes/{quoteId}/decline [QUO-203]`
|
|
262
|
+
*
|
|
263
|
+
* | Parameter | Type | Required | Description |
|
|
264
|
+
* |-------------------|----------|----------|--------------------------|
|
|
265
|
+
* | `supplierQuoteId` | `string` | Yes | Supplier quote ID |
|
|
266
|
+
*
|
|
267
|
+
* @param params - Quote identification
|
|
268
|
+
* @param context - Optional SSR request context
|
|
269
|
+
* @throws {ValidationError} If supplierQuoteId is missing
|
|
270
|
+
* @returns Declined quote
|
|
271
|
+
*/
|
|
272
|
+
declineSupplierQuote(params: DeclineSupplierQuoteParams, context?: RequestContext): Promise<DeclineSupplierQuoteResponse>;
|
|
273
|
+
/**
|
|
274
|
+
* Update custom fields on a supplier quote.
|
|
275
|
+
*
|
|
276
|
+
* **Endpoint**: `PATCH /v1/shop/supplier-quotes/{quoteId}/custom-fields [QUO-204]`
|
|
277
|
+
*
|
|
278
|
+
* @param params - Custom field update data
|
|
279
|
+
* @param context - Optional SSR request context
|
|
280
|
+
* @throws {ValidationError} If supplierQuoteId is missing
|
|
281
|
+
* @returns Updated quote
|
|
282
|
+
*/
|
|
283
|
+
updateSupplierQuoteCustomFields(params: UpdateSupplierQuoteCustomFieldsParams, context?: RequestContext): Promise<UpdateSupplierQuoteCustomFieldsResponse>;
|
|
284
|
+
/**
|
|
285
|
+
* Post a message to a supplier quote thread.
|
|
286
|
+
*
|
|
287
|
+
* Enables communication between buyer and supplier.
|
|
288
|
+
*
|
|
289
|
+
* **Endpoint**: `POST /v1/shop/supplier-quotes/{quoteId}/messages [QUO-205]`
|
|
290
|
+
*
|
|
291
|
+
* | Parameter | Type | Required | Description |
|
|
292
|
+
* |-------------------|----------|----------|--------------------------|
|
|
293
|
+
* | `supplierQuoteId` | `string` | Yes | Supplier quote ID |
|
|
294
|
+
* | `message` | `string` | Yes | Message content |
|
|
295
|
+
* | `username` | `string` | Yes | Sender's name |
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* ```typescript
|
|
299
|
+
* await client.quote.postMessageToSupplierQuote({
|
|
300
|
+
* supplierQuoteId: 'sq-123',
|
|
301
|
+
* message: 'Can you provide faster delivery options?',
|
|
302
|
+
* username: 'John Doe',
|
|
303
|
+
* });
|
|
304
|
+
* ```
|
|
305
|
+
*
|
|
306
|
+
* @param params - Message data
|
|
307
|
+
* @param context - Optional SSR request context
|
|
308
|
+
* @throws {ValidationError} If required parameters are missing
|
|
309
|
+
* @returns Message confirmation
|
|
310
|
+
*/
|
|
311
|
+
postMessageToSupplierQuote(params: PostMessageToSupplierQuoteParams, context?: RequestContext): Promise<PostMessageToSupplierQuoteResponse>;
|
|
312
|
+
/**
|
|
313
|
+
* Convert an accepted supplier quote to an order.
|
|
314
|
+
*
|
|
315
|
+
* Creates a commercial order from the accepted quote.
|
|
316
|
+
*
|
|
317
|
+
* **Endpoint**: `POST /v1/shop/supplier-quotes/{quoteId}/initialize-orders [QUO-206]`
|
|
318
|
+
*
|
|
319
|
+
* | Parameter | Type | Required | Description |
|
|
320
|
+
* |---------------------------|----------|----------|--------------------------|
|
|
321
|
+
* | `supplierQuoteId` | `string` | Yes | Supplier quote ID |
|
|
322
|
+
* | `quoteLineIdsAndQuantities`| `array` | Yes | Lines to convert |
|
|
323
|
+
* | `nbPreviewLines` | `number` | No | Preview lines in response|
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* ```typescript
|
|
327
|
+
* const order = await client.quote.initializeOrderFromSupplierQuote({
|
|
328
|
+
* supplierQuoteId: 'sq-123',
|
|
329
|
+
* quoteLineIdsAndQuantities: [
|
|
330
|
+
* { quoteLineId: 'line-1', quantity: 50 },
|
|
331
|
+
* { quoteLineId: 'line-2', quantity: 100 },
|
|
332
|
+
* ],
|
|
333
|
+
* });
|
|
334
|
+
*
|
|
335
|
+
* console.log(`Order created: ${order.commercialOrderId}`);
|
|
336
|
+
* ```
|
|
337
|
+
*
|
|
338
|
+
* @param params - Order initialization data
|
|
339
|
+
* @param context - Optional SSR request context
|
|
340
|
+
* @throws {ValidationError} If required parameters are missing
|
|
341
|
+
* @returns Created order reference
|
|
342
|
+
*/
|
|
343
|
+
initializeOrderFromSupplierQuote(params: InitializeOrderFromSupplierQuoteParams, context?: RequestContext): Promise<InitializeOrderFromSupplierQuoteResponse>;
|
|
344
|
+
}
|
|
345
|
+
//# sourceMappingURL=quote.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.service.d.ts","sourceRoot":"","sources":["../../../src/services/quote/quote.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,qCAAqC,EACrC,gCAAgC,EAChC,sCAAsC,EACtC,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,yBAAyB,EACzB,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAC5B,uCAAuC,EACvC,kCAAkC,EAClC,wCAAwC,EACzC,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C,QAAQ,CAAC,WAAW,WAAW;IAM/B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,eAAe,CACnB,MAAM,GAAE,qBAA0B,EAClC,OAAO,CAAC,EAAE,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AAE,qCAAqC,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,uCAAuC,CAAC;IAkBnD;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,0BAA0B,CAC9B,MAAM,EAAE,gCAAgC,EACxC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,kCAAkC,CAAC;IAkB9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACG,gCAAgC,CACpC,MAAM,EAAE,sCAAsC,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,wCAAwC,CAAC;CAerD"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJUST SDK Quote Service - Types
|
|
3
|
+
* Type definitions for quote operations.
|
|
4
|
+
*
|
|
5
|
+
* @module services/quote/types
|
|
6
|
+
* @since 2.17.0
|
|
7
|
+
*/
|
|
8
|
+
import type { Pageable, PaginatedResponse } from "../types";
|
|
9
|
+
export type QuoteStatus = "DRAFT" | "PENDING" | "ACCEPTED" | "DECLINED" | "EXPIRED" | "CANCELLED";
|
|
10
|
+
export type IdType = "DJUST_ID" | "EXTERNAL_ID";
|
|
11
|
+
export interface GetMasterQuotesParams {
|
|
12
|
+
fromCustomerAccount?: boolean;
|
|
13
|
+
pageable?: Pageable;
|
|
14
|
+
}
|
|
15
|
+
export interface CreateMasterQuoteParams {
|
|
16
|
+
description: string;
|
|
17
|
+
name: string;
|
|
18
|
+
}
|
|
19
|
+
export interface DeleteMasterQuoteParams {
|
|
20
|
+
masterQuoteId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface GetMasterQuoteParams {
|
|
23
|
+
masterQuoteId: string;
|
|
24
|
+
}
|
|
25
|
+
export interface UpdateMasterQuoteParams {
|
|
26
|
+
masterQuoteId: string;
|
|
27
|
+
customFieldValues?: Array<{
|
|
28
|
+
customFieldId: string;
|
|
29
|
+
customFieldValue?: string;
|
|
30
|
+
}>;
|
|
31
|
+
masterQuoteDetailsToAdd?: Array<{
|
|
32
|
+
productVariantId: string;
|
|
33
|
+
quantity: number;
|
|
34
|
+
}>;
|
|
35
|
+
masterQuoteDetailsToRemove?: string[];
|
|
36
|
+
}
|
|
37
|
+
export interface CreateSupplierQuotesParams {
|
|
38
|
+
billingAddressId?: string;
|
|
39
|
+
createSupplierQuoteRequests: Array<{
|
|
40
|
+
createQuoteDeliveryLineRequests: Array<{
|
|
41
|
+
quantity: number;
|
|
42
|
+
shippingAddressId: string;
|
|
43
|
+
}>;
|
|
44
|
+
masterQuoteDetailId: string;
|
|
45
|
+
quantity: number;
|
|
46
|
+
supplierIds: string[];
|
|
47
|
+
}>;
|
|
48
|
+
masterQuoteId?: string;
|
|
49
|
+
supplierQuoteUrl: string;
|
|
50
|
+
}
|
|
51
|
+
export interface GetSupplierQuoteParams {
|
|
52
|
+
supplierQuoteId: string;
|
|
53
|
+
}
|
|
54
|
+
export interface AcceptSupplierQuoteParams {
|
|
55
|
+
supplierQuoteId: string;
|
|
56
|
+
}
|
|
57
|
+
export interface DeclineSupplierQuoteParams {
|
|
58
|
+
supplierQuoteId: string;
|
|
59
|
+
}
|
|
60
|
+
export interface UpdateSupplierQuoteCustomFieldsParams {
|
|
61
|
+
supplierQuoteId: string;
|
|
62
|
+
customFieldValues: Array<{
|
|
63
|
+
customFieldId: string;
|
|
64
|
+
customFieldValue?: string;
|
|
65
|
+
}>;
|
|
66
|
+
idType: IdType;
|
|
67
|
+
}
|
|
68
|
+
export interface PostMessageToSupplierQuoteParams {
|
|
69
|
+
supplierQuoteId: string;
|
|
70
|
+
message: string;
|
|
71
|
+
username: string;
|
|
72
|
+
}
|
|
73
|
+
export interface InitializeOrderFromSupplierQuoteParams {
|
|
74
|
+
supplierQuoteId: string;
|
|
75
|
+
nbPreviewLines?: number;
|
|
76
|
+
quoteLineIdsAndQuantities: Array<{
|
|
77
|
+
quoteLineId: string;
|
|
78
|
+
quantity: number;
|
|
79
|
+
}>;
|
|
80
|
+
}
|
|
81
|
+
export interface CustomFieldValue {
|
|
82
|
+
customFieldId: string;
|
|
83
|
+
customFieldValue?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface MasterQuoteDetail {
|
|
86
|
+
id: string;
|
|
87
|
+
productVariantId: string;
|
|
88
|
+
quantity: number;
|
|
89
|
+
productName?: string;
|
|
90
|
+
sku?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface MasterQuote {
|
|
93
|
+
id: string;
|
|
94
|
+
name: string;
|
|
95
|
+
description: string;
|
|
96
|
+
status: QuoteStatus;
|
|
97
|
+
details: MasterQuoteDetail[];
|
|
98
|
+
customFieldValues: CustomFieldValue[];
|
|
99
|
+
createdAt: string;
|
|
100
|
+
updatedAt: string;
|
|
101
|
+
}
|
|
102
|
+
export interface SupplierQuoteLine {
|
|
103
|
+
id: string;
|
|
104
|
+
productVariantId: string;
|
|
105
|
+
quantity: number;
|
|
106
|
+
unitPrice: number;
|
|
107
|
+
totalPrice: number;
|
|
108
|
+
currency: string;
|
|
109
|
+
productName?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface QuoteMessage {
|
|
112
|
+
id: string;
|
|
113
|
+
message: string;
|
|
114
|
+
username: string;
|
|
115
|
+
createdAt: string;
|
|
116
|
+
}
|
|
117
|
+
export interface SupplierQuote {
|
|
118
|
+
id: string;
|
|
119
|
+
masterQuoteId?: string;
|
|
120
|
+
supplierId: string;
|
|
121
|
+
supplierName: string;
|
|
122
|
+
status: QuoteStatus;
|
|
123
|
+
lines: SupplierQuoteLine[];
|
|
124
|
+
messages: QuoteMessage[];
|
|
125
|
+
billingAddressId?: string;
|
|
126
|
+
customFieldValues: CustomFieldValue[];
|
|
127
|
+
totalPrice: number;
|
|
128
|
+
currency: string;
|
|
129
|
+
createdAt: string;
|
|
130
|
+
updatedAt: string;
|
|
131
|
+
expiresAt?: string;
|
|
132
|
+
}
|
|
133
|
+
export interface GetMasterQuotesResponse extends PaginatedResponse<MasterQuote> {
|
|
134
|
+
}
|
|
135
|
+
export interface CreateMasterQuoteResponse extends MasterQuote {
|
|
136
|
+
}
|
|
137
|
+
export interface GetMasterQuoteResponse extends MasterQuote {
|
|
138
|
+
}
|
|
139
|
+
export interface UpdateMasterQuoteResponse extends MasterQuote {
|
|
140
|
+
}
|
|
141
|
+
export interface CreateSupplierQuotesResponse {
|
|
142
|
+
supplierQuotes: SupplierQuote[];
|
|
143
|
+
}
|
|
144
|
+
export interface GetSupplierQuoteResponse extends SupplierQuote {
|
|
145
|
+
}
|
|
146
|
+
export interface AcceptSupplierQuoteResponse extends SupplierQuote {
|
|
147
|
+
}
|
|
148
|
+
export interface DeclineSupplierQuoteResponse extends SupplierQuote {
|
|
149
|
+
}
|
|
150
|
+
export interface UpdateSupplierQuoteCustomFieldsResponse extends SupplierQuote {
|
|
151
|
+
}
|
|
152
|
+
export interface PostMessageToSupplierQuoteResponse extends QuoteMessage {
|
|
153
|
+
}
|
|
154
|
+
export interface InitializeOrderFromSupplierQuoteResponse {
|
|
155
|
+
commercialOrderId: string;
|
|
156
|
+
businessId: string;
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/quote/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAM5D,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,SAAS,GACT,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,CAAC;AAEhB,MAAM,MAAM,MAAM,GAAG,UAAU,GAAG,aAAa,CAAC;AAMhD,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAA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E,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { SupplierDto, SupplierEvaluationDto, SupplierIdType } from "../../../interfaces/models/supplier";
|
|
2
|
+
import { PageableParameters } from "../../../interfaces/models/common";
|
|
3
|
+
export declare const mockSuppliers: SupplierDto[];
|
|
4
|
+
export declare const mockSupplierEvaluations: SupplierEvaluationDto[];
|
|
5
|
+
export declare const mockPageable: PageableParameters;
|
|
6
|
+
export declare const mockPageableWithSort: PageableParameters;
|
|
7
|
+
export declare const mockGetSuppliersParams: {
|
|
8
|
+
pageable: PageableParameters;
|
|
9
|
+
supplierStatus: string;
|
|
10
|
+
supplierIds: string[];
|
|
11
|
+
idType: SupplierIdType;
|
|
12
|
+
};
|
|
13
|
+
export declare const mockGetSupplierParams: {
|
|
14
|
+
supplierId: string;
|
|
15
|
+
idType: SupplierIdType;
|
|
16
|
+
};
|
|
17
|
+
export declare const mockGetSupplierEvaluationsParams: {
|
|
18
|
+
supplierId: string;
|
|
19
|
+
idType: SupplierIdType;
|
|
20
|
+
pageable: PageableParameters;
|
|
21
|
+
};
|
|
22
|
+
export declare const mockErrorResponse: {
|
|
23
|
+
message: string;
|
|
24
|
+
status: number;
|
|
25
|
+
};
|
|
26
|
+
export declare const mockNotFoundError: {
|
|
27
|
+
message: string;
|
|
28
|
+
status: number;
|
|
29
|
+
};
|
|
30
|
+
export declare const mockValidationError: {
|
|
31
|
+
message: string;
|
|
32
|
+
status: number;
|
|
33
|
+
};
|
|
34
|
+
export declare const mockEnhancedFetchSuccess: {
|
|
35
|
+
data: SupplierDto[];
|
|
36
|
+
headers: Headers;
|
|
37
|
+
status: number;
|
|
38
|
+
};
|
|
39
|
+
export declare const mockEnhancedFetchSupplierSuccess: {
|
|
40
|
+
data: SupplierDto;
|
|
41
|
+
headers: Headers;
|
|
42
|
+
status: number;
|
|
43
|
+
};
|
|
44
|
+
export declare const mockEnhancedFetchEvaluationsSuccess: {
|
|
45
|
+
data: SupplierEvaluationDto[];
|
|
46
|
+
headers: Headers;
|
|
47
|
+
status: number;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=supplier-mocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supplier-mocks.d.ts","sourceRoot":"","sources":["../../../../src/services/supplier/__mocks__/supplier-mocks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,cAAc,EACf,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAGvE,eAAO,MAAM,aAAa,EAAE,WAAW,EA4EtC,CAAC;AAGF,eAAO,MAAM,uBAAuB,EAAE,qBAAqB,EA4B1D,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,kBAI1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,kBAIlC,CAAC;AAGF,eAAO,MAAM,sBAAsB;;;;YAIX,cAAc;CACrC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;YAEV,cAAc;CACrC,CAAC;AAEF,eAAO,MAAM,gCAAgC;;YAErB,cAAc;;CAErC,CAAC;AAGF,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC;AAGF,eAAO,MAAM,wBAAwB;;;;CAIpC,CAAC;AAEF,eAAO,MAAM,gCAAgC;;;;CAI5C,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;CAI/C,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SupplierDto, SupplierEvaluationDto, SupplierIdType } from "../../interfaces/models/supplier";
|
|
2
|
+
import { PageableParameters } from "../../interfaces/models/common";
|
|
3
|
+
/**
|
|
4
|
+
* Request parameters type definitions
|
|
5
|
+
*/
|
|
6
|
+
export interface GetSuppliersParameters {
|
|
7
|
+
pageable: PageableParameters;
|
|
8
|
+
supplierStatus?: string;
|
|
9
|
+
supplierIds?: string[];
|
|
10
|
+
idType?: SupplierIdType;
|
|
11
|
+
}
|
|
12
|
+
export interface GetSupplierParameters {
|
|
13
|
+
supplierId: string;
|
|
14
|
+
idType: SupplierIdType;
|
|
15
|
+
}
|
|
16
|
+
export interface GetSupplierEvaluationsParameters {
|
|
17
|
+
supplierId: string;
|
|
18
|
+
idType: SupplierIdType;
|
|
19
|
+
pageable: PageableParameters;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Response type definitions
|
|
23
|
+
*/
|
|
24
|
+
export interface GetSuppliersResponse extends Array<SupplierDto> {
|
|
25
|
+
}
|
|
26
|
+
export interface GetSupplierResponse extends SupplierDto {
|
|
27
|
+
}
|
|
28
|
+
export interface GetSupplierEvaluationsResponse extends Array<SupplierEvaluationDto> {
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/services/supplier/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,cAAc,EACf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE;;GAEG;AAEH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,WAAW,gCAAgC;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED;;GAEG;AAEH,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,WAAW,CAAC;CAAG;AAEnE,MAAM,WAAW,mBAAoB,SAAQ,WAAW;CAAG;AAE3D,MAAM,WAAW,8BACf,SAAQ,KAAK,CAAC,qBAAqB,CAAC;CAAG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJUST SDK Supplier Service - Endpoints
|
|
3
|
+
* API endpoint constants for supplier operations.
|
|
4
|
+
*
|
|
5
|
+
* @module services/supplier/endpoints
|
|
6
|
+
* @since 2.17.0
|
|
7
|
+
*/
|
|
8
|
+
export declare const SupplierEndpoints: {
|
|
9
|
+
readonly SUPPLIERS: "/v1/shop/suppliers";
|
|
10
|
+
readonly SUPPLIER: "/v1/shop/suppliers/{supplierId}";
|
|
11
|
+
readonly EVALUATIONS: "/v1/shop/suppliers/{supplierId}/evaluations";
|
|
12
|
+
};
|
|
13
|
+
export type SupplierEndpoint = (typeof SupplierEndpoints)[keyof typeof SupplierEndpoints];
|
|
14
|
+
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../src/services/supplier/endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,iBAAiB;;;;CAIpB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC"}
|