@djust-b2b/djust-front-sdk 1.28.0 → 1.29.1
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
CHANGED
|
@@ -6,7 +6,7 @@ export declare const DjustSDK: {
|
|
|
6
6
|
createOrderLogisticIncident({ logisticOrderId, idType, customField, reasonCode, }: import("./services/incident/definitions").createOrderLogisticIncidentParameters): Promise<import("./services/incident/definitions").createOrderLogisticIncidentResponse>;
|
|
7
7
|
createOrderLogisticLineIncident({ logisticOrderId, idType, customFieldIdType, orderLines, reasonCode, }: import("./services/incident/definitions").createOrderLogisticLineIncidentParameters): Promise<import("./services/incident/definitions").createOrderLogisticLineIncidentResponse>;
|
|
8
8
|
createOrderLogisticIncidentThread({ logisticOrderId, incidentId, idType, customField, message, name, reasonCode, }: import("./services/incident/definitions").createOrderLogisticIncidentThreadParameters): Promise<import("./services/incident/definitions").createOrderLogisticIncidentThreadResponse>;
|
|
9
|
-
getCommercialOrders({ locale, nbPreviewLines, }: import("./interfaces").GetCommercialOrdersParameters): Promise<import("./interfaces").GetCommercialOrdersResponse>;
|
|
9
|
+
getCommercialOrders({ locale, nbPreviewLines, page, size, sort, connectedUserOnly, customerAccountIds, isValidated, }: import("./interfaces").GetCommercialOrdersParameters): Promise<import("./interfaces").GetCommercialOrdersResponse>;
|
|
10
10
|
createCommercialOrder({ nbPreviewLines, channel, customFields, locale, origin, originId, paymentInfo, }: import("./interfaces").CreateCommercialOrderParameters): Promise<import("./interfaces").CreateCommercialOrderResponse>;
|
|
11
11
|
createCommercialOrderV2({ customFieldIdType, customFields, }: import("./interfaces").CreateCommercialOrderV2Parameters): Promise<import("./interfaces").CreateCommercialOrderV2Response>;
|
|
12
12
|
getCommercialOrder({ orderId, idType, locale, nbPreviewLines, }: import("./interfaces").GetCommercialOrderParameters): Promise<import("./interfaces").GetCommercialOrderResponse>;
|
|
@@ -21,6 +21,7 @@ export declare const DjustSDK: {
|
|
|
21
21
|
updateCommercialOrderShippingInformation({ orderId, shippingAddressId, shippingType, }: import("./interfaces").UpdateCommercialOrderShippingInformationParameters): Promise<void>;
|
|
22
22
|
updateCommercialOrderShippingType({ orderId, shippingType, }: import("./interfaces").UpdateCommercialOrderShippingTypeParameters): Promise<void>;
|
|
23
23
|
deleteCommercialOrder(commercialOrderId: string): Promise<void>;
|
|
24
|
+
getCommercialOrderLines({ commercialOrderId, page, size, sort, supplierIds, productVariantIds, offerPriceIds, idType, locale, }: import("./interfaces").GetOrderCommercialLinesParameters): Promise<import("./interfaces").GetOrderCommercialLinesResponse>;
|
|
24
25
|
updateCommercialOrderLines({ commercialOrderId, customFieldIdType, lineIdType, lineType, updateOrderCommercialLines, updateOrderLineIdType, updateOrderLineType, }: import("./interfaces").UpdateCommercialOrderLinesParameters): Promise<import("./interfaces").UpdateCommercialOrderLinesResponse>;
|
|
25
26
|
deleteCommercialOrderLines({ commercialOrderId, body, }: import("./interfaces").DeleteCommercialOrderLinesParameters): Promise<import("./interfaces").DeleteCommercialOrderLinesResponse>;
|
|
26
27
|
punchoutOciCommercialOrder({ tenantConfigurationKey, commercialOrderId, locale, }: import("./interfaces").PunchoutOciCommercialOrderParameters): Promise<any>;
|
|
@@ -288,6 +288,36 @@ export interface PageOrderLogisticLineDto {
|
|
|
288
288
|
totalElements: number;
|
|
289
289
|
totalPages: number;
|
|
290
290
|
}
|
|
291
|
+
export interface PageOrderCommercialLinesDto {
|
|
292
|
+
content: OrderCommercialLineDto[];
|
|
293
|
+
empty: boolean;
|
|
294
|
+
first: boolean;
|
|
295
|
+
last: boolean;
|
|
296
|
+
number: number;
|
|
297
|
+
numberOfElements: number;
|
|
298
|
+
pageable: PageableObject;
|
|
299
|
+
size: number;
|
|
300
|
+
sort: Order[];
|
|
301
|
+
totalElements: number;
|
|
302
|
+
totalPages: number;
|
|
303
|
+
}
|
|
304
|
+
export interface OrderCommercialLineDto {
|
|
305
|
+
confirmedQuantity: number;
|
|
306
|
+
customFieldValues: OrderCommercialLineCustomFieldValuesDto[];
|
|
307
|
+
externalId: string;
|
|
308
|
+
externalSource: string;
|
|
309
|
+
id: string;
|
|
310
|
+
incidentDeclared: boolean;
|
|
311
|
+
offerInventorySnapshotDto: OrderCommercialLineOfferInventoryDto;
|
|
312
|
+
offerPriceSnapshotDto: OrderCommercialLineOfferPriceDto;
|
|
313
|
+
orderLogisticLinePriceDto: OrderLogisticLinePriceDto;
|
|
314
|
+
orderLogisticLineProductDto: OrderLogisticLineProductDto;
|
|
315
|
+
orderLogisticLineProductVariantDto: OrderLogisticLineProductVariantDto;
|
|
316
|
+
paymentStatus: string;
|
|
317
|
+
quantity: number;
|
|
318
|
+
quoteLineExternalId: string;
|
|
319
|
+
status: string;
|
|
320
|
+
}
|
|
291
321
|
export interface ShippingTypeInformationDto {
|
|
292
322
|
code: string;
|
|
293
323
|
earliestDays: number;
|
|
@@ -375,6 +405,40 @@ export interface ThreadCustomFiedValuesDto {
|
|
|
375
405
|
};
|
|
376
406
|
value: unknown;
|
|
377
407
|
}
|
|
408
|
+
export interface OrderCommercialLineCustomFieldValuesDto extends ThreadCustomFiedValuesDto {
|
|
409
|
+
}
|
|
410
|
+
export interface OrderCommercialLineOfferInventoryDto extends ThreadCustomFiedValuesDto {
|
|
411
|
+
currency: string;
|
|
412
|
+
customFieldValueSnapshots: OrderCommercialLineCustomFieldValuesDto[];
|
|
413
|
+
externalSource: string;
|
|
414
|
+
offerInventoryExternalId: string;
|
|
415
|
+
packingType: string;
|
|
416
|
+
productTaxCode: string;
|
|
417
|
+
productTaxRate: number;
|
|
418
|
+
quantityPerItem: number;
|
|
419
|
+
shippingTaxCode: string;
|
|
420
|
+
shippingTaxRate: number;
|
|
421
|
+
}
|
|
422
|
+
export interface OrderCommercialLineOfferPriceDto {
|
|
423
|
+
confirmedProductPriceWithoutTaxes: number;
|
|
424
|
+
itemPerPack: number;
|
|
425
|
+
offerPriceExternalId: string;
|
|
426
|
+
offerPriceType: string;
|
|
427
|
+
offerPriceTypeValue: string;
|
|
428
|
+
productPriceWithTaxes: number;
|
|
429
|
+
productPriceWithoutTaxes: number;
|
|
430
|
+
productTaxAmount: number;
|
|
431
|
+
shippingPriceWithTaxes: number;
|
|
432
|
+
shippingPriceWithoutTaxes: number;
|
|
433
|
+
shippingTaxAmount: number;
|
|
434
|
+
taxLegalNotice: string;
|
|
435
|
+
totalPriceWithTaxes: number;
|
|
436
|
+
totalPriceWithoutTaxes: number;
|
|
437
|
+
totalProductPriceWithTaxes: number;
|
|
438
|
+
totalProductPriceWithoutTaxes: number;
|
|
439
|
+
totalProductTaxAmount: number;
|
|
440
|
+
totalTaxAmount: number;
|
|
441
|
+
}
|
|
378
442
|
export interface RequestGetAccountingDocumentLinkbyID {
|
|
379
443
|
orderLogisticId: string;
|
|
380
444
|
docId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Channel, Currency, IdType } from "../../interfaces/models/common";
|
|
2
2
|
import { CustomFieldValueRequest } from "../../interfaces/models/custom-field";
|
|
3
|
-
import { BrowserInfo, CardInformationDto, OrderCommercialDto, OrderIdType, OrderLogisticDto, OrderOrigin, PageOrderCommercialDto, PaymentCardInfo, PreauthorizationDto, OfferToDelete, OrderLogisticLineUpdate, OrderLineType } from "../../interfaces/models/order";
|
|
3
|
+
import { BrowserInfo, CardInformationDto, OrderCommercialDto, OrderIdType, OrderLogisticDto, OrderOrigin, PageOrderCommercialDto, PaymentCardInfo, PreauthorizationDto, OfferToDelete, OrderLogisticLineUpdate, OrderLineType, PageOrderCommercialLinesDto } from "../../interfaces/models/order";
|
|
4
4
|
import { SingleWarningReportDto } from "../../interfaces/models/common";
|
|
5
5
|
import { PaymentInfoRequest, PaymentOption, PaymentProvider } from "../../interfaces/models/payment";
|
|
6
6
|
/**
|
|
@@ -9,6 +9,23 @@ import { PaymentInfoRequest, PaymentOption, PaymentProvider } from "../../interf
|
|
|
9
9
|
export interface GetCommercialOrdersParameters {
|
|
10
10
|
locale: string;
|
|
11
11
|
nbPreviewLines?: number;
|
|
12
|
+
page?: number;
|
|
13
|
+
size?: number;
|
|
14
|
+
sort?: string[];
|
|
15
|
+
connectedUserOnly?: boolean;
|
|
16
|
+
customerAccountIds?: string[];
|
|
17
|
+
isValidated?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface GetOrderCommercialLinesParameters {
|
|
20
|
+
commercialOrderId: string;
|
|
21
|
+
page?: number;
|
|
22
|
+
size?: number;
|
|
23
|
+
sort?: string;
|
|
24
|
+
supplierIds?: string[];
|
|
25
|
+
productVariantIds?: string[];
|
|
26
|
+
offerPriceIds: string[];
|
|
27
|
+
idType?: IdType;
|
|
28
|
+
locale?: string;
|
|
12
29
|
}
|
|
13
30
|
export interface CreateCommercialOrderParameters {
|
|
14
31
|
nbPreviewLines?: number;
|
|
@@ -109,6 +126,8 @@ export interface UpdateCommercialOrderLinesParameters {
|
|
|
109
126
|
}
|
|
110
127
|
export interface GetCommercialOrderResponse extends OrderCommercialDto {
|
|
111
128
|
}
|
|
129
|
+
export interface GetOrderCommercialLinesResponse extends PageOrderCommercialLinesDto {
|
|
130
|
+
}
|
|
112
131
|
export interface CreateCommercialOrderCardRegistrationResponse extends CardInformationDto {
|
|
113
132
|
}
|
|
114
133
|
export interface CreateCommercialOrderPreauthorizationResponse extends PreauthorizationDto {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateCommercialOrderCardRegistrationParameters, CreateCommercialOrderCardRegistrationResponse, CreateCommercialOrderParameters, CreateCommercialOrderResponse, CreateCommercialOrderV2Parameters, CreateCommercialOrderV2Response, UpdateCommercialOrderParameters, DeleteCommercialOrderLinesParameters, DeleteCommercialOrderLinesResponse, UpdateCommercialOrderLinesParameters, UpdateCommercialOrderLinesResponse, CreateCommercialOrderPreauthorizationParameters, CreateCommercialOrderPreauthorizationResponse, GetCommercialOrderParameters, GetCommercialOrderPaymentPageUrlParameters, GetCommercialOrderResponse, GetCommercialOrdersParameters, GetCommercialOrdersResponse, SetCommercialOrderStatusAsCreatedParameters, SetCommercialOrderStatusAsOnHoldParameters, UpdateCommercialOrderBillingInformationParameters, UpdateCommercialOrderShippingAddressParameters, UpdateCommercialOrderShippingInformationParameters, UpdateCommercialOrderShippingTypeParameters, PunchoutOciCommercialOrderParameters } from "./definitions";
|
|
1
|
+
import { CreateCommercialOrderCardRegistrationParameters, CreateCommercialOrderCardRegistrationResponse, CreateCommercialOrderParameters, CreateCommercialOrderResponse, CreateCommercialOrderV2Parameters, CreateCommercialOrderV2Response, UpdateCommercialOrderParameters, DeleteCommercialOrderLinesParameters, DeleteCommercialOrderLinesResponse, UpdateCommercialOrderLinesParameters, UpdateCommercialOrderLinesResponse, CreateCommercialOrderPreauthorizationParameters, CreateCommercialOrderPreauthorizationResponse, GetCommercialOrderParameters, GetCommercialOrderPaymentPageUrlParameters, GetCommercialOrderResponse, GetCommercialOrdersParameters, GetCommercialOrdersResponse, SetCommercialOrderStatusAsCreatedParameters, SetCommercialOrderStatusAsOnHoldParameters, UpdateCommercialOrderBillingInformationParameters, UpdateCommercialOrderShippingAddressParameters, UpdateCommercialOrderShippingInformationParameters, UpdateCommercialOrderShippingTypeParameters, GetOrderCommercialLinesParameters, GetOrderCommercialLinesResponse, PunchoutOciCommercialOrderParameters } from "./definitions";
|
|
2
2
|
/**
|
|
3
3
|
* COMMERCIAL ORDER ENDPOINT
|
|
4
4
|
*/
|
|
@@ -10,10 +10,16 @@ import { CreateCommercialOrderCardRegistrationParameters, CreateCommercialOrderC
|
|
|
10
10
|
*
|
|
11
11
|
* 🛠 **Endpoint**: `GET /v1/shop/commercial-orders [ORDER-560]`
|
|
12
12
|
*
|
|
13
|
-
* | Parameter
|
|
14
|
-
*
|
|
15
|
-
* | `locale`
|
|
16
|
-
* | `nbPreviewLines`
|
|
13
|
+
* | Parameter | Type | Required | Description |
|
|
14
|
+
* |------------------------|---------------------|----------|------------------------------------------|
|
|
15
|
+
* | `locale` | `string` | ✅ | The locale in which to return the commercial order. |
|
|
16
|
+
* | `nbPreviewLines` | `number` | ❌ | The number of lines to display in the commercial order. |
|
|
17
|
+
* | `page` | `number` | ❌ | The page number to retrieve. |
|
|
18
|
+
* | `size` | `number` | ❌ | The number of items per page. |
|
|
19
|
+
* | `sort` | `string[]` | ❌ | The sort to apply to the results. |
|
|
20
|
+
* | `connectedUserOnly` | `boolean` | ❌ | Filter to show only orders for the connected user. |
|
|
21
|
+
* | `customerAccountIds` | `string[]` | ❌ | Filter by customer account IDs. |
|
|
22
|
+
* | `isValidated` | `boolean` | ❌ | Filter by validation status. |
|
|
17
23
|
*
|
|
18
24
|
* 📤 **Returns**:
|
|
19
25
|
* A `Promise` resolving to a single `GetCommercialOrdersResponse` object representing the page of commercial orders.
|
|
@@ -22,6 +28,10 @@ import { CreateCommercialOrderCardRegistrationParameters, CreateCommercialOrderC
|
|
|
22
28
|
* ```ts
|
|
23
29
|
* const orders = await getCommercialOrders({
|
|
24
30
|
* locale: "fr",
|
|
31
|
+
* page: 0,
|
|
32
|
+
* size: 20,
|
|
33
|
+
* sort: ["createdAt,desc"],
|
|
34
|
+
* connectedUserOnly: true
|
|
25
35
|
* });
|
|
26
36
|
* ```
|
|
27
37
|
*
|
|
@@ -29,7 +39,7 @@ import { CreateCommercialOrderCardRegistrationParameters, CreateCommercialOrderC
|
|
|
29
39
|
* @throws {Error} If `locale` is missing.
|
|
30
40
|
* @returns {Promise<GetCommercialOrdersResponse>} A promise resolving to the response containing page object.
|
|
31
41
|
*/
|
|
32
|
-
export declare function getCommercialOrders({ locale, nbPreviewLines, }: GetCommercialOrdersParameters): Promise<GetCommercialOrdersResponse>;
|
|
42
|
+
export declare function getCommercialOrders({ locale, nbPreviewLines, page, size, sort, connectedUserOnly, customerAccountIds, isValidated, }: GetCommercialOrdersParameters): Promise<GetCommercialOrdersResponse>;
|
|
33
43
|
/**
|
|
34
44
|
* 🚚 Creates commercial orders.
|
|
35
45
|
*
|
|
@@ -479,6 +489,45 @@ export declare function updateCommercialOrderShippingType({ orderId, shippingTyp
|
|
|
479
489
|
* @returns {Promise<void>} A promise resolving when the commercial order is successfully deleted.
|
|
480
490
|
*/
|
|
481
491
|
export declare function deleteCommercialOrder(commercialOrderId: string): Promise<void>;
|
|
492
|
+
/**
|
|
493
|
+
* 🚚 Gets commercial order lines.
|
|
494
|
+
*
|
|
495
|
+
* This function retrieves the lines of a commercial order identified by the `commercialOrderId`.
|
|
496
|
+
* The `commercialOrderId` parameter is mandatory and validated before the request is executed.
|
|
497
|
+
*
|
|
498
|
+
* 🛠 **Endpoint**: `GET /v1/shop/commercial-orders/${commercialOrderId}/lines` [ORDER-561]
|
|
499
|
+
*
|
|
500
|
+
* | Parameter | Type | Required | Description |
|
|
501
|
+
* |---------------------|--------------------|-----------|----------------------------------------------------------------|
|
|
502
|
+
* | `commercialOrderId` | `string` | ✅ | The ID of the commercial order whose lines are to be retrieved |
|
|
503
|
+
* | `page` | `number` | ❌ | The page number to retrieve |
|
|
504
|
+
* | `size` | `number` | ❌ | The number of items per page |
|
|
505
|
+
* | `sort` | `string` | ❌ | The sort to apply to the results |
|
|
506
|
+
* | `supplierIds` | `string[]` | ❌ | Filter by supplier IDs |
|
|
507
|
+
* | `productVariantIds` | `string[]` | ❌ | Filter by product variant IDs |
|
|
508
|
+
* | `offerPriceIds` | `string[]` | ❌ | Filter by offer price IDs |
|
|
509
|
+
* | `idType` | `string` | ❌ | The ID type to use |
|
|
510
|
+
* | `locale` | `string` | ❌ | The locale for the response data |
|
|
511
|
+
*
|
|
512
|
+
* 📤 **Returns**:
|
|
513
|
+
* A `Promise` resolving to a `GetOrderCommercialLinesResponse` object containing the commercial order lines.
|
|
514
|
+
*
|
|
515
|
+
* 🛠 **Example usage**:
|
|
516
|
+
* ```ts
|
|
517
|
+
* const response = await getCommercialOrderLines({
|
|
518
|
+
* commercialOrderId: "commercialOrder123",
|
|
519
|
+
* page: 0,
|
|
520
|
+
* size: 20,
|
|
521
|
+
* sort: "createdAt,desc",
|
|
522
|
+
* locale: "fr"
|
|
523
|
+
* });
|
|
524
|
+
* ```
|
|
525
|
+
*
|
|
526
|
+
* @param {GetOrderCommercialLinesParameters} params - The parameters for the request
|
|
527
|
+
* @throws {Error} If `commercialOrderId` is missing
|
|
528
|
+
* @returns {Promise<GetOrderCommercialLinesResponse>} A promise resolving to the response containing the commercial order lines
|
|
529
|
+
*/
|
|
530
|
+
export declare function getCommercialOrderLines({ commercialOrderId, page, size, sort, supplierIds, productVariantIds, offerPriceIds, idType, locale, }: GetOrderCommercialLinesParameters): Promise<GetOrderCommercialLinesResponse>;
|
|
482
531
|
/**
|
|
483
532
|
* 🚚 Update specific commercial order lines.
|
|
484
533
|
*
|
|
@@ -15,6 +15,7 @@ exports.updateCommercialOrderShippingAddress = updateCommercialOrderShippingAddr
|
|
|
15
15
|
exports.updateCommercialOrderShippingInformation = updateCommercialOrderShippingInformation;
|
|
16
16
|
exports.updateCommercialOrderShippingType = updateCommercialOrderShippingType;
|
|
17
17
|
exports.deleteCommercialOrder = deleteCommercialOrder;
|
|
18
|
+
exports.getCommercialOrderLines = getCommercialOrderLines;
|
|
18
19
|
exports.updateCommercialOrderLines = updateCommercialOrderLines;
|
|
19
20
|
exports.deleteCommercialOrderLines = deleteCommercialOrderLines;
|
|
20
21
|
exports.punchoutOciCommercialOrder = punchoutOciCommercialOrder;
|
|
@@ -31,10 +32,16 @@ const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
|
31
32
|
*
|
|
32
33
|
* 🛠 **Endpoint**: `GET /v1/shop/commercial-orders [ORDER-560]`
|
|
33
34
|
*
|
|
34
|
-
* | Parameter
|
|
35
|
-
*
|
|
36
|
-
* | `locale`
|
|
37
|
-
* | `nbPreviewLines`
|
|
35
|
+
* | Parameter | Type | Required | Description |
|
|
36
|
+
* |------------------------|---------------------|----------|------------------------------------------|
|
|
37
|
+
* | `locale` | `string` | ✅ | The locale in which to return the commercial order. |
|
|
38
|
+
* | `nbPreviewLines` | `number` | ❌ | The number of lines to display in the commercial order. |
|
|
39
|
+
* | `page` | `number` | ❌ | The page number to retrieve. |
|
|
40
|
+
* | `size` | `number` | ❌ | The number of items per page. |
|
|
41
|
+
* | `sort` | `string[]` | ❌ | The sort to apply to the results. |
|
|
42
|
+
* | `connectedUserOnly` | `boolean` | ❌ | Filter to show only orders for the connected user. |
|
|
43
|
+
* | `customerAccountIds` | `string[]` | ❌ | Filter by customer account IDs. |
|
|
44
|
+
* | `isValidated` | `boolean` | ❌ | Filter by validation status. |
|
|
38
45
|
*
|
|
39
46
|
* 📤 **Returns**:
|
|
40
47
|
* A `Promise` resolving to a single `GetCommercialOrdersResponse` object representing the page of commercial orders.
|
|
@@ -43,6 +50,10 @@ const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
|
43
50
|
* ```ts
|
|
44
51
|
* const orders = await getCommercialOrders({
|
|
45
52
|
* locale: "fr",
|
|
53
|
+
* page: 0,
|
|
54
|
+
* size: 20,
|
|
55
|
+
* sort: ["createdAt,desc"],
|
|
56
|
+
* connectedUserOnly: true
|
|
46
57
|
* });
|
|
47
58
|
* ```
|
|
48
59
|
*
|
|
@@ -50,7 +61,7 @@ const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
|
50
61
|
* @throws {Error} If `locale` is missing.
|
|
51
62
|
* @returns {Promise<GetCommercialOrdersResponse>} A promise resolving to the response containing page object.
|
|
52
63
|
*/
|
|
53
|
-
async function getCommercialOrders({ locale, nbPreviewLines, }) {
|
|
64
|
+
async function getCommercialOrders({ locale, nbPreviewLines, page, size, sort, connectedUserOnly, customerAccountIds, isValidated, }) {
|
|
54
65
|
(0, parameters_validation_1.required)({ locale });
|
|
55
66
|
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
56
67
|
method: "GET",
|
|
@@ -58,6 +69,12 @@ async function getCommercialOrders({ locale, nbPreviewLines, }) {
|
|
|
58
69
|
params: {
|
|
59
70
|
locale,
|
|
60
71
|
nbPreviewLines,
|
|
72
|
+
page,
|
|
73
|
+
size,
|
|
74
|
+
sort,
|
|
75
|
+
connectedUserOnly,
|
|
76
|
+
customerAccountIds,
|
|
77
|
+
isValidated,
|
|
61
78
|
},
|
|
62
79
|
});
|
|
63
80
|
return data;
|
|
@@ -654,6 +671,62 @@ async function deleteCommercialOrder(commercialOrderId) {
|
|
|
654
671
|
path: `/v2/shop/commercial-orders/${commercialOrderId}`,
|
|
655
672
|
});
|
|
656
673
|
}
|
|
674
|
+
/**
|
|
675
|
+
* 🚚 Gets commercial order lines.
|
|
676
|
+
*
|
|
677
|
+
* This function retrieves the lines of a commercial order identified by the `commercialOrderId`.
|
|
678
|
+
* The `commercialOrderId` parameter is mandatory and validated before the request is executed.
|
|
679
|
+
*
|
|
680
|
+
* 🛠 **Endpoint**: `GET /v1/shop/commercial-orders/${commercialOrderId}/lines` [ORDER-561]
|
|
681
|
+
*
|
|
682
|
+
* | Parameter | Type | Required | Description |
|
|
683
|
+
* |---------------------|--------------------|-----------|----------------------------------------------------------------|
|
|
684
|
+
* | `commercialOrderId` | `string` | ✅ | The ID of the commercial order whose lines are to be retrieved |
|
|
685
|
+
* | `page` | `number` | ❌ | The page number to retrieve |
|
|
686
|
+
* | `size` | `number` | ❌ | The number of items per page |
|
|
687
|
+
* | `sort` | `string` | ❌ | The sort to apply to the results |
|
|
688
|
+
* | `supplierIds` | `string[]` | ❌ | Filter by supplier IDs |
|
|
689
|
+
* | `productVariantIds` | `string[]` | ❌ | Filter by product variant IDs |
|
|
690
|
+
* | `offerPriceIds` | `string[]` | ❌ | Filter by offer price IDs |
|
|
691
|
+
* | `idType` | `string` | ❌ | The ID type to use |
|
|
692
|
+
* | `locale` | `string` | ❌ | The locale for the response data |
|
|
693
|
+
*
|
|
694
|
+
* 📤 **Returns**:
|
|
695
|
+
* A `Promise` resolving to a `GetOrderCommercialLinesResponse` object containing the commercial order lines.
|
|
696
|
+
*
|
|
697
|
+
* 🛠 **Example usage**:
|
|
698
|
+
* ```ts
|
|
699
|
+
* const response = await getCommercialOrderLines({
|
|
700
|
+
* commercialOrderId: "commercialOrder123",
|
|
701
|
+
* page: 0,
|
|
702
|
+
* size: 20,
|
|
703
|
+
* sort: "createdAt,desc",
|
|
704
|
+
* locale: "fr"
|
|
705
|
+
* });
|
|
706
|
+
* ```
|
|
707
|
+
*
|
|
708
|
+
* @param {GetOrderCommercialLinesParameters} params - The parameters for the request
|
|
709
|
+
* @throws {Error} If `commercialOrderId` is missing
|
|
710
|
+
* @returns {Promise<GetOrderCommercialLinesResponse>} A promise resolving to the response containing the commercial order lines
|
|
711
|
+
*/
|
|
712
|
+
async function getCommercialOrderLines({ commercialOrderId, page, size, sort, supplierIds, productVariantIds, offerPriceIds, idType, locale, }) {
|
|
713
|
+
(0, parameters_validation_1.required)({ commercialOrderId });
|
|
714
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
715
|
+
method: "GET",
|
|
716
|
+
path: `/v1/shop/commercial-orders/${commercialOrderId}/lines`,
|
|
717
|
+
params: {
|
|
718
|
+
page,
|
|
719
|
+
sort,
|
|
720
|
+
size,
|
|
721
|
+
supplierIds,
|
|
722
|
+
productVariantIds,
|
|
723
|
+
offerPriceIds,
|
|
724
|
+
idType,
|
|
725
|
+
locale,
|
|
726
|
+
},
|
|
727
|
+
});
|
|
728
|
+
return data;
|
|
729
|
+
}
|
|
657
730
|
/**
|
|
658
731
|
* 🚚 Update specific commercial order lines.
|
|
659
732
|
*
|