@djust-b2b/djust-front-sdk 1.12.0 → 1.13.0
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/lib/index.d.ts +6 -4
- package/lib/interfaces/models/offer.d.ts +1 -1
- package/lib/interfaces/models/quote.d.ts +13 -1
- package/lib/services/auth/index.d.ts +119 -4
- package/lib/services/auth/index.js +119 -4
- package/lib/services/customer-user/definitions.d.ts +0 -3
- package/lib/services/customer-user/index.d.ts +263 -14
- package/lib/services/customer-user/index.js +264 -20
- package/lib/services/quote/definitions.d.ts +25 -1
- package/lib/services/quote/index.d.ts +349 -10
- package/lib/services/quote/index.js +382 -11
- package/lib/services/supplier/definitions.d.ts +3 -0
- package/lib/services/supplier/index.d.ts +92 -4
- package/lib/services/supplier/index.js +96 -5
- package/package.json +1 -1
|
@@ -1,37 +1,376 @@
|
|
|
1
|
-
import { CreateMasterQuoteParameters, CreateMasterQuoteResponse, CreateSupplierQuotesParameters, CreateSupplierQuotesResponse, DeclineSupplierQuoteParameters, DeclineSupplierQuoteResponse, DeleteMasterQuoteParameters, GetMasterQuoteParameters, GetMasterQuoteResponse, GetMasterQuotesParameters, GetMasterQuotesResponse, GetSupplierQuoteParameters, GetSupplierQuoteResponse, PostMessageToSupplierQuoteParameters, PostMessageToSupplierQuoteResponse, UpdateMasterQuoteParameters, UpdateMasterQuoteResponse } from "./definitions";
|
|
1
|
+
import { AcceptSupplierQuoteParameters, AcceptSupplierQuoteResponse, CreateMasterQuoteParameters, CreateMasterQuoteResponse, CreateSupplierQuotesParameters, CreateSupplierQuotesResponse, DeclineSupplierQuoteParameters, DeclineSupplierQuoteResponse, DeleteMasterQuoteParameters, GetMasterQuoteParameters, GetMasterQuoteResponse, GetMasterQuotesParameters, GetMasterQuotesResponse, GetSupplierQuoteParameters, GetSupplierQuoteResponse, PostMessageToSupplierQuoteParameters, PostMessageToSupplierQuoteResponse, UpdateMasterQuoteParameters, UpdateMasterQuoteResponse, UpdateSupplierQuoteCustomFieldsParameters, UpdateSupplierQuoteCustomFieldsResponse, InitializeOrderFromSupplierQuoteParameters, InitializeOrderFromSupplierQuoteResponse } from "./definitions";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* 📄 Fetches a paginated list of master quotes.
|
|
4
|
+
*
|
|
5
|
+
* This function retrieves master quotes with optional filters for customer accounts and pagination parameters.
|
|
6
|
+
* If no parameters are provided, it fetches the default paginated list of master quotes.
|
|
7
|
+
*
|
|
8
|
+
* 🛠 **Endpoint**: `GET /v1/shop/master-quotes`
|
|
9
|
+
*
|
|
10
|
+
* | Parameter | Type | Required | Description |
|
|
11
|
+
* |----------------------|-------------------------------|------------|---------------------------------------------------------------|
|
|
12
|
+
* | `fromCustomerAccount`| `boolean` | ❌ | If `true`, filters quotes originating from customer accounts. |
|
|
13
|
+
* | `pageable.page` | `number` | ❌ | The page number to fetch (0-based index). |
|
|
14
|
+
* | `pageable.size` | `number` | ❌ | The number of items per page. |
|
|
15
|
+
* | `pageable.sort` | `string[]` | ❌ | Sorting criteria (e.g., `["createdAt,desc"]`). |
|
|
16
|
+
*
|
|
17
|
+
* 📤 **Returns**:
|
|
18
|
+
* A `Promise` resolving to a `GetMasterQuotesResponse` object,
|
|
19
|
+
* containing the paginated list of master quotes with metadata such as total pages, size, and current page.
|
|
20
|
+
*
|
|
21
|
+
* 🛠 **Example usage**:
|
|
22
|
+
* ```ts
|
|
23
|
+
* const quotes = await getMasterQuotes({
|
|
24
|
+
* fromCustomerAccount: true,
|
|
25
|
+
* pageable: { page: 1, size: 10, sort: ["createdAt,desc"] },
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* console.log(quotes);
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @param {GetMasterQuotesParameters} params - Optional filters and pagination parameters.
|
|
32
|
+
* @returns {Promise<GetMasterQuotesResponse>} A promise resolving to the paginated master quotes response.
|
|
4
33
|
*/
|
|
5
34
|
export declare function getMasterQuotes({ fromCustomerAccount, pageable, }?: GetMasterQuotesParameters): Promise<GetMasterQuotesResponse>;
|
|
6
35
|
/**
|
|
7
|
-
*
|
|
36
|
+
* ✏️ Creates a new master quote.
|
|
37
|
+
*
|
|
38
|
+
* This function allows the creation of a new master quote by providing a description and a name.
|
|
39
|
+
* Both parameters are mandatory and validated before sending the request.
|
|
40
|
+
*
|
|
41
|
+
* 🛠 **Endpoint**: `POST /v1/shop/master-quotes`
|
|
42
|
+
*
|
|
43
|
+
* | Parameter | Type | Required | Description |
|
|
44
|
+
* |----------------|------------|------------|---------------------------------------------|
|
|
45
|
+
* | `description` | `string` | ✅ | The description of the master quote. |
|
|
46
|
+
* | `name` | `string` | ✅ | The name of the master quote. |
|
|
47
|
+
*
|
|
48
|
+
* 📤 **Returns**:
|
|
49
|
+
* A `Promise` resolving to a `CreateMasterQuoteResponse` object,
|
|
50
|
+
* representing the created master quote with its details.
|
|
51
|
+
*
|
|
52
|
+
* 🛠 **Example usage**:
|
|
53
|
+
* ```ts
|
|
54
|
+
* const newQuote = await createMasterQuote({
|
|
55
|
+
* description: "This is a test quote.",
|
|
56
|
+
* name: "Test Quote",
|
|
57
|
+
* });
|
|
58
|
+
*
|
|
59
|
+
* console.log(newQuote);
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @param {CreateMasterQuoteParameters} params - The parameters for creating the master quote.
|
|
63
|
+
* @throws {Error} If `description` or `name` is missing.
|
|
64
|
+
* @returns {Promise<CreateMasterQuoteResponse>} A promise resolving to the created master quote response.
|
|
8
65
|
*/
|
|
9
66
|
export declare function createMasterQuote({ description, name, }: CreateMasterQuoteParameters): Promise<CreateMasterQuoteResponse>;
|
|
10
67
|
/**
|
|
11
|
-
*
|
|
68
|
+
* 📝 Deletes a master quote by its ID.
|
|
69
|
+
*
|
|
70
|
+
* This function allows you to delete an existing master quote by providing the `masterQuoteId`. Once the quote is deleted, it can no longer be retrieved or used in other operations.
|
|
71
|
+
*
|
|
72
|
+
* 🛠 **Endpoint**: `DELETE /v1/shop/master-quotes/{masterQuoteId}`
|
|
73
|
+
*
|
|
74
|
+
* | Parameter | Type | Required | Description |
|
|
75
|
+
* |-------------------|---------|------------|---------------------------------------------------------------|
|
|
76
|
+
* | `masterQuoteId` | `string`| ✅ | The unique identifier of the master quote to be deleted. |
|
|
77
|
+
*
|
|
78
|
+
* 📤 **Returns**:
|
|
79
|
+
* A `Promise<void>` indicating the operation was successful. No data is returned as the master quote is simply deleted.
|
|
80
|
+
*
|
|
81
|
+
* 🛠 **Example usage**:
|
|
82
|
+
* ```ts
|
|
83
|
+
* await deleteMasterQuote({
|
|
84
|
+
* masterQuoteId: "quote123",
|
|
85
|
+
* });
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @param {DeleteMasterQuoteParameters} params - The parameters required to delete the master quote.
|
|
89
|
+
* @throws {Error} If the required `masterQuoteId` is missing.
|
|
90
|
+
* @returns {Promise<void>} A promise that resolves when the master quote is successfully deleted.
|
|
12
91
|
*/
|
|
13
92
|
export declare function deleteMasterQuote({ masterQuoteId, }: DeleteMasterQuoteParameters): Promise<void>;
|
|
14
93
|
/**
|
|
15
|
-
*
|
|
94
|
+
* 📄 Fetches the details of a specific master quote.
|
|
95
|
+
*
|
|
96
|
+
* This function retrieves a master quote identified by its unique `masterQuoteId`.
|
|
97
|
+
*
|
|
98
|
+
* 🛠 **Endpoint**: `GET /v1/shop/master-quotes/{masterQuoteId}`
|
|
99
|
+
*
|
|
100
|
+
* | Parameter | Type | Required | Description |
|
|
101
|
+
* |-------------------|------------|------------|--------------------------------------------------|
|
|
102
|
+
* | `masterQuoteId` | `string` | ✅ | The unique identifier of the master quote to fetch. |
|
|
103
|
+
*
|
|
104
|
+
* 📤 **Returns**:
|
|
105
|
+
* A `Promise` resolving to a `GetMasterQuoteResponse` object, containing the details of the requested master quote.
|
|
106
|
+
*
|
|
107
|
+
* 🛠 **Example usage**:
|
|
108
|
+
* ```ts
|
|
109
|
+
* const masterQuote = await getMasterQuote({ masterQuoteId: "12345" });
|
|
110
|
+
*
|
|
111
|
+
* console.log(masterQuote);
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* @param {GetMasterQuoteParameters} params - The parameters required to fetch the master quote.
|
|
115
|
+
* @throws {Error} If `masterQuoteId` is missing.
|
|
116
|
+
* @returns {Promise<GetMasterQuoteResponse>} A promise resolving to the details of the master quote.
|
|
16
117
|
*/
|
|
17
118
|
export declare function getMasterQuote({ masterQuoteId, }: GetMasterQuoteParameters): Promise<GetMasterQuoteResponse>;
|
|
18
119
|
/**
|
|
19
|
-
*
|
|
120
|
+
* ✏️ Updates an existing master quote.
|
|
121
|
+
*
|
|
122
|
+
* This function modifies the specified master quote by updating custom field values, adding new details, or removing existing ones.
|
|
123
|
+
*
|
|
124
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/master-quotes/{masterQuoteId}`
|
|
125
|
+
*
|
|
126
|
+
* | Parameter | Type | Required | Description |
|
|
127
|
+
* |------------------------------|--------------------------------------------|------------|------------------------------------------------------|
|
|
128
|
+
* | `masterQuoteId` | `string` | ✅ | The unique identifier of the master quote to update. |
|
|
129
|
+
* | `customFieldValues` | `{ customFieldId: string; customFieldValue?: string; }[]` | ❌ | Custom field values to update for the master quote. |
|
|
130
|
+
* | `masterQuoteDetailsToAdd` | `{ productVariantId: string; quantity: number; }[]` | ❌ | Details to add to the master quote. |
|
|
131
|
+
* | `masterQuoteDetailsToRemove` | `string[]` | ❌ | IDs of details to remove from the master quote. |
|
|
132
|
+
*
|
|
133
|
+
* 📤 **Returns**:
|
|
134
|
+
* A `Promise` resolving to an `UpdateMasterQuoteResponse` object, which contains the updated details of the master quote.
|
|
135
|
+
*
|
|
136
|
+
* 🛠 **Example usage**:
|
|
137
|
+
* ```ts
|
|
138
|
+
* const updatedQuote = await updateMasterQuote({
|
|
139
|
+
* masterQuoteId: "12345",
|
|
140
|
+
* customFieldValues: [{ customFieldId: "field1", customFieldValue: "value1" }],
|
|
141
|
+
* masterQuoteDetailsToAdd: [{ productVariantId: "variant1", quantity: 5 }],
|
|
142
|
+
* masterQuoteDetailsToRemove: ["detail1", "detail2"],
|
|
143
|
+
* });
|
|
144
|
+
*
|
|
145
|
+
* console.log(updatedQuote);
|
|
146
|
+
* ```
|
|
147
|
+
*
|
|
148
|
+
* @param {UpdateMasterQuoteParameters} params - The parameters required to update the master quote.
|
|
149
|
+
* @throws {Error} If `masterQuoteId` is missing.
|
|
150
|
+
* @returns {Promise<UpdateMasterQuoteResponse>} A promise resolving to the updated details of the master quote.
|
|
20
151
|
*/
|
|
21
152
|
export declare function updateMasterQuote({ masterQuoteId, customFieldValues, masterQuoteDetailsToAdd, masterQuoteDetailsToRemove, }: UpdateMasterQuoteParameters): Promise<UpdateMasterQuoteResponse>;
|
|
22
153
|
/**
|
|
23
|
-
*
|
|
154
|
+
* ✏️ Creates supplier quotes.
|
|
155
|
+
*
|
|
156
|
+
* This function generates supplier quotes based on the provided parameters, including billing and shipping information, quantities, and supplier details.
|
|
157
|
+
*
|
|
158
|
+
* 🛠 **Endpoint**: `POST /v1/shop/supplier-quotes`
|
|
159
|
+
*
|
|
160
|
+
* | Parameter | Type | Required | Description |
|
|
161
|
+
* |--------------------------------|----------------------------------------------------------------------------------------|------------|-----------------------------------------------------------------------------|
|
|
162
|
+
* | `billingAddressId` | `string` | ❌ | The ID of the billing address for the supplier quotes. |
|
|
163
|
+
* | `createSupplierQuoteRequests` | `{ createQuoteDeliveryLineRequests: { quantity: number; shippingAddressId: string; }[]; masterQuoteDetailId: string; quantity: number; supplierIds: string[]; }[]` | ✅ | Array of supplier quote request objects, including delivery and supplier details. |
|
|
164
|
+
* | `masterQuoteId` | `string` | ❌ | The ID of the master quote associated with the supplier quotes. |
|
|
165
|
+
* | `supplierQuoteUrl` | `string` | ✅ | The URL for the supplier quote. |
|
|
166
|
+
*
|
|
167
|
+
* 📤 **Returns**:
|
|
168
|
+
* A `Promise` resolving to a `CreateSupplierQuotesResponse` object, containing the newly created supplier quotes.
|
|
169
|
+
*
|
|
170
|
+
* 🛠 **Example usage**:
|
|
171
|
+
* ```ts
|
|
172
|
+
* const response = await createSupplierQuotes({
|
|
173
|
+
* billingAddressId: "address123",
|
|
174
|
+
* createSupplierQuoteRequests: [
|
|
175
|
+
* {
|
|
176
|
+
* createQuoteDeliveryLineRequests: [
|
|
177
|
+
* { quantity: 10, shippingAddressId: "ship123" },
|
|
178
|
+
* ],
|
|
179
|
+
* masterQuoteDetailId: "detail123",
|
|
180
|
+
* quantity: 20,
|
|
181
|
+
* supplierIds: ["supplier1", "supplier2"],
|
|
182
|
+
* },
|
|
183
|
+
* ],
|
|
184
|
+
* masterQuoteId: "master123",
|
|
185
|
+
* supplierQuoteUrl: "https://example.com/supplier-quote",
|
|
186
|
+
* });
|
|
187
|
+
*
|
|
188
|
+
* console.log(response);
|
|
189
|
+
* ```
|
|
190
|
+
*
|
|
191
|
+
* @param {CreateSupplierQuotesParameters} params - The parameters required to create supplier quotes.
|
|
192
|
+
* @throws {Error} If `createSupplierQuoteRequests` or `supplierQuoteUrl` is missing.
|
|
193
|
+
* @returns {Promise<CreateSupplierQuotesResponse>} A promise resolving to the created supplier quotes.
|
|
24
194
|
*/
|
|
25
195
|
export declare function createSupplierQuotes({ billingAddressId, createSupplierQuoteRequests, masterQuoteId, supplierQuoteUrl, }: CreateSupplierQuotesParameters): Promise<CreateSupplierQuotesResponse>;
|
|
26
196
|
/**
|
|
27
|
-
*
|
|
197
|
+
* ✏️ Retrieves a supplier quote by ID.
|
|
198
|
+
*
|
|
199
|
+
* This function fetches detailed information about a specific supplier quote, including customer details, billing address, quote lines, and status.
|
|
200
|
+
*
|
|
201
|
+
* 🛠 **Endpoint**: `GET /v1/shop/supplier-quotes/{supplierQuoteId}`
|
|
202
|
+
*
|
|
203
|
+
* | Parameter | Type | Required | Description |
|
|
204
|
+
* |--------------------|-----------|------------|------------------------------------------------------|
|
|
205
|
+
* | `supplierQuoteId` | `string` | ✅ | The unique identifier of the supplier quote to retrieve. |
|
|
206
|
+
*
|
|
207
|
+
* 📤 **Returns**:
|
|
208
|
+
* A `Promise` resolving to a `GetSupplierQuoteResponse` object, containing the details of the requested supplier quote.
|
|
209
|
+
*
|
|
210
|
+
* 🛠 **Example usage**:
|
|
211
|
+
* ```ts
|
|
212
|
+
* const response = await getSupplierQuote({
|
|
213
|
+
* supplierQuoteId: "quote123",
|
|
214
|
+
* });
|
|
215
|
+
*
|
|
216
|
+
* console.log(response);
|
|
217
|
+
* ```
|
|
218
|
+
*
|
|
219
|
+
* @param {GetSupplierQuoteParameters} params - The parameters required to retrieve a supplier quote.
|
|
220
|
+
* @throws {Error} If `supplierQuoteId` is missing.
|
|
221
|
+
* @returns {Promise<GetSupplierQuoteResponse>} A promise resolving to the supplier quote details.
|
|
28
222
|
*/
|
|
29
223
|
export declare function getSupplierQuote({ supplierQuoteId, }: GetSupplierQuoteParameters): Promise<GetSupplierQuoteResponse>;
|
|
30
224
|
/**
|
|
31
|
-
*
|
|
225
|
+
* ✅ Accepts a supplier quote.
|
|
226
|
+
*
|
|
227
|
+
* This function allows the user to accept a specific supplier quote, which may trigger further actions in the purchasing or negotiation process.
|
|
228
|
+
*
|
|
229
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/supplier-quotes/{supplierQuoteId}/accept`
|
|
230
|
+
*
|
|
231
|
+
* | Parameter | Type | Required | Description |
|
|
232
|
+
* |---------------------|-----------|------------|---------------------------------------------------------------------|
|
|
233
|
+
* | `supplierQuoteId` | `string` | ✅ | The unique identifier of the supplier quote to be accepted. |
|
|
234
|
+
*
|
|
235
|
+
* 📤 **Returns**:
|
|
236
|
+
* A `Promise` resolving to an `AcceptSupplierQuoteResponse` object, confirming that the supplier quote has been accepted.
|
|
237
|
+
*
|
|
238
|
+
* 🛠 **Example usage**:
|
|
239
|
+
* ```ts
|
|
240
|
+
* const response = await acceptSupplierQuote({
|
|
241
|
+
* supplierQuoteId: "quote123",
|
|
242
|
+
* });
|
|
243
|
+
*
|
|
244
|
+
* console.log(response);
|
|
245
|
+
* ```
|
|
246
|
+
*
|
|
247
|
+
* @param {AcceptSupplierQuoteParameters} params - The parameters required to accept a supplier quote.
|
|
248
|
+
* @throws {Error} If the required `supplierQuoteId` is missing.
|
|
249
|
+
* @returns {Promise<AcceptSupplierQuoteResponse>} A promise resolving to the result of the supplier quote acceptance operation.
|
|
250
|
+
*/
|
|
251
|
+
export declare function acceptSupplierQuote({ supplierQuoteId, }: AcceptSupplierQuoteParameters): Promise<AcceptSupplierQuoteResponse>;
|
|
252
|
+
/**
|
|
253
|
+
* 📝 Updates custom fields of a supplier quote.
|
|
254
|
+
*
|
|
255
|
+
* This function allows you to update custom fields associated with a specific supplier quote.
|
|
256
|
+
* You can modify the values of the custom fields, providing a flexible way to manage additional information for the quote.
|
|
257
|
+
*
|
|
258
|
+
* 🛠 **Endpoint**: `PATCH /v1/shop/supplier-quotes/{supplierQuoteId}/custom-fields`
|
|
259
|
+
*
|
|
260
|
+
* | Parameter | Type | Required | Description |
|
|
261
|
+
* |---------------------|---------|------------|----------------------------------------------------------------------|
|
|
262
|
+
* | `supplierQuoteId` | `string`| ✅ | The unique identifier of the supplier quote to be updated. |
|
|
263
|
+
* | `customFieldValues` | `array` | ✅ | An array of custom field values to be updated for the supplier quote. |
|
|
264
|
+
* | `idType` | `string`| ✅ | The ID type used for the custom fields. |
|
|
265
|
+
*
|
|
266
|
+
* 📤 **Returns**:
|
|
267
|
+
* A `Promise` resolving to an `UpdateSupplierQuoteCustomFieldsResponse` object, which confirms that the custom fields have been updated successfully.
|
|
268
|
+
*
|
|
269
|
+
* 🛠 **Example usage**:
|
|
270
|
+
* ```ts
|
|
271
|
+
* const response = await updateSupplierQuoteCustomFields({
|
|
272
|
+
* supplierQuoteId: "quote123",
|
|
273
|
+
* customFieldValues: [{ customFieldId: "field1", customFieldValue: "value1" }],
|
|
274
|
+
* idType: "EXTERNAL_ID",
|
|
275
|
+
* });
|
|
276
|
+
*
|
|
277
|
+
* console.log(response);
|
|
278
|
+
* ```
|
|
279
|
+
*
|
|
280
|
+
* @param {UpdateSupplierQuoteCustomFieldsParameters} params - The parameters required to update custom fields for a supplier quote.
|
|
281
|
+
* @throws {Error} If the required `supplierQuoteId` is missing.
|
|
282
|
+
* @returns {Promise<UpdateSupplierQuoteCustomFieldsResponse>} A promise resolving to the result of the custom fields update operation.
|
|
283
|
+
*/
|
|
284
|
+
export declare function updateSupplierQuoteCustomFields({ supplierQuoteId, customFieldValues, idType, }: UpdateSupplierQuoteCustomFieldsParameters): Promise<UpdateSupplierQuoteCustomFieldsResponse>;
|
|
285
|
+
/**
|
|
286
|
+
* ❌ Declines a supplier quote.
|
|
287
|
+
*
|
|
288
|
+
* This function allows the user to decline a specific supplier quote by its unique identifier.
|
|
289
|
+
*
|
|
290
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/supplier-quotes/{supplierQuoteId}/decline`
|
|
291
|
+
*
|
|
292
|
+
* | Parameter | Type | Required | Description |
|
|
293
|
+
* |--------------------|-----------|------------|------------------------------------------------------|
|
|
294
|
+
* | `supplierQuoteId` | `string` | ✅ | The unique identifier of the supplier quote to decline. |
|
|
295
|
+
*
|
|
296
|
+
* 📤 **Returns**:
|
|
297
|
+
* A `Promise` resolving to a `DeclineSupplierQuoteResponse` object, indicating the result of the decline operation.
|
|
298
|
+
*
|
|
299
|
+
* 🛠 **Example usage**:
|
|
300
|
+
* ```ts
|
|
301
|
+
* const response = await declineSupplierQuote({
|
|
302
|
+
* supplierQuoteId: "quote123",
|
|
303
|
+
* });
|
|
304
|
+
*
|
|
305
|
+
* console.log(response);
|
|
306
|
+
* ```
|
|
307
|
+
*
|
|
308
|
+
* @param {DeclineSupplierQuoteParameters} params - The parameters required to decline a supplier quote.
|
|
309
|
+
* @throws {Error} If `supplierQuoteId` is missing.
|
|
310
|
+
* @returns {Promise<DeclineSupplierQuoteResponse>} A promise resolving to the result of the decline operation.
|
|
32
311
|
*/
|
|
33
312
|
export declare function declineSupplierQuote({ supplierQuoteId, }: DeclineSupplierQuoteParameters): Promise<DeclineSupplierQuoteResponse>;
|
|
34
313
|
/**
|
|
35
|
-
*
|
|
314
|
+
* 💬 Posts a message to a supplier quote.
|
|
315
|
+
*
|
|
316
|
+
* This function allows the user to send a message to a specific supplier quote, useful for communication regarding the quote's details.
|
|
317
|
+
*
|
|
318
|
+
* 🛠 **Endpoint**: `POST /v1/shop/supplier-quotes/{supplierQuoteId}/messages`
|
|
319
|
+
*
|
|
320
|
+
* | Parameter | Type | Required | Description |
|
|
321
|
+
* |---------------------|-----------|------------|--------------------------------------------------------------|
|
|
322
|
+
* | `supplierQuoteId` | `string` | ✅ | The unique identifier of the supplier quote to which the message will be sent. |
|
|
323
|
+
* | `message` | `string` | ✅ | The content of the message to be sent to the supplier quote. |
|
|
324
|
+
* | `username` | `string` | ✅ | The username of the person sending the message. |
|
|
325
|
+
*
|
|
326
|
+
* 📤 **Returns**:
|
|
327
|
+
* A `Promise` resolving to a `PostMessageToSupplierQuoteResponse` object, confirming that the message was successfully posted.
|
|
328
|
+
*
|
|
329
|
+
* 🛠 **Example usage**:
|
|
330
|
+
* ```ts
|
|
331
|
+
* const response = await postMessageToSupplierQuote({
|
|
332
|
+
* supplierQuoteId: "quote123",
|
|
333
|
+
* message: "Please review the updated pricing.",
|
|
334
|
+
* username: "admin_user",
|
|
335
|
+
* });
|
|
336
|
+
*
|
|
337
|
+
* console.log(response);
|
|
338
|
+
* ```
|
|
339
|
+
*
|
|
340
|
+
* @param {PostMessageToSupplierQuoteParameters} params - The parameters required to send a message to a supplier quote.
|
|
341
|
+
* @throws {Error} If any of the required parameters (`supplierQuoteId`, `message`, `username`) are missing.
|
|
342
|
+
* @returns {Promise<PostMessageToSupplierQuoteResponse>} A promise resolving to the result of the message posting operation.
|
|
36
343
|
*/
|
|
37
344
|
export declare function postMessageToSupplierQuote({ supplierQuoteId, message, username, }: PostMessageToSupplierQuoteParameters): Promise<PostMessageToSupplierQuoteResponse>;
|
|
345
|
+
/**
|
|
346
|
+
* 📝 Initializes an order from a supplier quote.
|
|
347
|
+
*
|
|
348
|
+
* This function allows you to initialize an order based on a specific supplier quote, specifying which quote lines and quantities should be included in the order. Additionally, it lets you preview a set number of lines before the final order is created.
|
|
349
|
+
*
|
|
350
|
+
* 🛠 **Endpoint**: `POST /v1/shop/supplier-quotes/{supplierQuoteId}/initialize-orders`
|
|
351
|
+
*
|
|
352
|
+
* | Parameter | Type | Required | Description |
|
|
353
|
+
* |-------------------------|---------|------------|----------------------------------------------------------------------|
|
|
354
|
+
* | `supplierQuoteId` | `string`| ✅ | The unique identifier of the supplier quote from which to initialize the order. |
|
|
355
|
+
* | `nbPreviewLines` | `number`| ❌ | The number of lines to fetch in the order response. |
|
|
356
|
+
* | `quoteLineIdsAndQuantities` | `array` | ✅ | A list of quote line IDs along with the respective quantities to be included in the order. |
|
|
357
|
+
*
|
|
358
|
+
* 📤 **Returns**:
|
|
359
|
+
* A `Promise` resolving to an `InitializeOrderFromSupplierQuoteResponse` object, confirming the successful initialization of the order.
|
|
360
|
+
*
|
|
361
|
+
* 🛠 **Example usage**:
|
|
362
|
+
* ```ts
|
|
363
|
+
* const response = await initializeOrderFromSupplierQuote({
|
|
364
|
+
* supplierQuoteId: "quote123",
|
|
365
|
+
* nbPreviewLines: 5,
|
|
366
|
+
* quoteLineIdsAndQuantities: [{ quoteLineId: "line1", quantity: 10 }],
|
|
367
|
+
* });
|
|
368
|
+
*
|
|
369
|
+
* console.log(response);
|
|
370
|
+
* ```
|
|
371
|
+
*
|
|
372
|
+
* @param {InitializeOrderFromSupplierQuoteParameters} params - The parameters required to initialize an order from a supplier quote.
|
|
373
|
+
* @throws {Error} If the required `supplierQuoteId` or `quoteLineIdsAndQuantities` are missing.
|
|
374
|
+
* @returns {Promise<InitializeOrderFromSupplierQuoteResponse>} A promise resolving to the result of the order initialization operation.
|
|
375
|
+
*/
|
|
376
|
+
export declare function initializeOrderFromSupplierQuote({ supplierQuoteId, nbPreviewLines, quoteLineIdsAndQuantities, }: InitializeOrderFromSupplierQuoteParameters): Promise<InitializeOrderFromSupplierQuoteResponse>;
|