washday-sdk 1.6.75 → 1.6.76
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.
|
@@ -35,7 +35,14 @@ export const getOutsourcedOrdersByStore = function (params) {
|
|
|
35
35
|
'statuses',
|
|
36
36
|
'page',
|
|
37
37
|
'limit',
|
|
38
|
-
'sequence'
|
|
38
|
+
'sequence',
|
|
39
|
+
'partnerId',
|
|
40
|
+
'dateFrom',
|
|
41
|
+
'dateTo',
|
|
42
|
+
'dateField',
|
|
43
|
+
'includeSummary',
|
|
44
|
+
'sortBy',
|
|
45
|
+
'sortDirection'
|
|
39
46
|
], params);
|
|
40
47
|
return yield this.axiosInstance.get(`${GET_OUTSOURCED_ORDERS_BY_STORE.replace(':storeId', params.storeId)}?${queryParams}`, config);
|
|
41
48
|
}
|
package/package.json
CHANGED
|
@@ -23,6 +23,13 @@ export const getOutsourcedOrdersByStore = async function (this: WashdayClientIns
|
|
|
23
23
|
sequence?: string,
|
|
24
24
|
page?: number,
|
|
25
25
|
limit?: number,
|
|
26
|
+
partnerId?: string,
|
|
27
|
+
dateFrom?: string,
|
|
28
|
+
dateTo?: string,
|
|
29
|
+
dateField?: 'sentDate' | 'receivedDate' | 'createdAt' | 'updatedAt',
|
|
30
|
+
includeSummary?: boolean,
|
|
31
|
+
sortBy?: 'sentDate' | 'receivedDate' | 'createdAt' | 'updatedAt' | 'outsourcedOrderSequence',
|
|
32
|
+
sortDirection?: 'asc' | 'desc',
|
|
26
33
|
}): Promise<any> {
|
|
27
34
|
try {
|
|
28
35
|
const config = {
|
|
@@ -32,7 +39,14 @@ export const getOutsourcedOrdersByStore = async function (this: WashdayClientIns
|
|
|
32
39
|
'statuses',
|
|
33
40
|
'page',
|
|
34
41
|
'limit',
|
|
35
|
-
'sequence'
|
|
42
|
+
'sequence',
|
|
43
|
+
'partnerId',
|
|
44
|
+
'dateFrom',
|
|
45
|
+
'dateTo',
|
|
46
|
+
'dateField',
|
|
47
|
+
'includeSummary',
|
|
48
|
+
'sortBy',
|
|
49
|
+
'sortDirection'
|
|
36
50
|
], params);
|
|
37
51
|
return await this.axiosInstance.get(`${GET_OUTSOURCED_ORDERS_BY_STORE.replace(':storeId', params.storeId)}?${queryParams}`, config);
|
|
38
52
|
} catch (error) {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getOutsourcedOrdersByStore } from "../src/api/outsourcedOrders/get";
|
|
2
|
+
|
|
3
|
+
describe("outsourcedOrders.getOutsourcedOrdersByStore report params", () => {
|
|
4
|
+
it("passes optional report filters through the query string", async () => {
|
|
5
|
+
const get = jest.fn().mockResolvedValue({
|
|
6
|
+
data: {
|
|
7
|
+
data: {
|
|
8
|
+
data: [],
|
|
9
|
+
pagination: { totalDocs: 0, limit: 25, page: 1, totalPages: 0 },
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
const client = {
|
|
14
|
+
apiToken: "token-123",
|
|
15
|
+
axiosInstance: { get },
|
|
16
|
+
} as any;
|
|
17
|
+
|
|
18
|
+
await getOutsourcedOrdersByStore.call(client, {
|
|
19
|
+
storeId: "store-1",
|
|
20
|
+
statuses: ["returned"],
|
|
21
|
+
page: 1,
|
|
22
|
+
limit: 25,
|
|
23
|
+
sequence: "100",
|
|
24
|
+
partnerId: "partner-1",
|
|
25
|
+
dateFrom: "2026-06-01",
|
|
26
|
+
dateTo: "2026-06-30",
|
|
27
|
+
dateField: "receivedDate",
|
|
28
|
+
includeSummary: true,
|
|
29
|
+
sortBy: "receivedDate",
|
|
30
|
+
sortDirection: "desc",
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
expect(get).toHaveBeenCalledWith(
|
|
34
|
+
"api/store/store-1/outsourced-orders?statuses=returned&page=1&limit=25&sequence=100&partnerId=partner-1&dateFrom=2026-06-01&dateTo=2026-06-30&dateField=receivedDate&includeSummary=true&sortBy=receivedDate&sortDirection=desc",
|
|
35
|
+
{
|
|
36
|
+
headers: { Authorization: "Bearer token-123" },
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
});
|