washday-sdk 1.6.74 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "1.6.74",
3
+ "version": "1.6.76",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -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) {
@@ -1,4 +1,5 @@
1
1
  import { WashdayClientInstance } from "../../interfaces/Api";
2
+ import { IProductInvoiceModuleSettings } from "../../interfaces/Product";
2
3
  import axiosInstance from "../axiosInstance";
3
4
  const GET_SET_PRODUCTS_SUPPLY = 'api/product-supply';
4
5
  const GET_SET_PRODUCTS = 'api/product';
@@ -25,6 +26,7 @@ export const create = async function (this: WashdayClientInstance, data: {
25
26
  invoice_product_key: string;
26
27
  invoice_product_unit_key: string;
27
28
  invoice_product_unit_name: string;
29
+ invoiceModuleSettings?: IProductInvoiceModuleSettings;
28
30
  productSupplies: Array<any>
29
31
  isOutsourced?: boolean
30
32
  outsourcingPartner?: string
@@ -1,4 +1,5 @@
1
1
  import { WashdayClientInstance } from "../../interfaces/Api";
2
+ import { IProductInvoiceModuleSettings } from "../../interfaces/Product";
2
3
  import axiosInstance from "../axiosInstance";
3
4
  const GET_SET_PRODUCTS = 'api/product';
4
5
 
@@ -34,6 +35,7 @@ export const updateById = async function (this: WashdayClientInstance, id: strin
34
35
  invoice_description?: string,
35
36
  invoice_product_unit_key?: string
36
37
  invoice_product_unit_name?: string
38
+ invoiceModuleSettings?: IProductInvoiceModuleSettings
37
39
  isOutsourced?: boolean
38
40
  outsourcingPartner?: string,
39
41
  barcode?: string
@@ -29,6 +29,22 @@ export interface IPriceOption {
29
29
  isActive?: boolean,
30
30
  }
31
31
 
32
+ export interface IProductCfdiInvoiceModuleSettings {
33
+ description?: string,
34
+ productKey?: string,
35
+ unitKey?: string,
36
+ unitName?: string,
37
+ }
38
+
39
+ export interface IProductSunatInvoiceModuleSettings {
40
+ enabled?: boolean,
41
+ }
42
+
43
+ export interface IProductInvoiceModuleSettings {
44
+ cfdi?: IProductCfdiInvoiceModuleSettings,
45
+ sunat?: IProductSunatInvoiceModuleSettings,
46
+ }
47
+
32
48
 
33
49
  export interface IProduct {
34
50
  _id?: string
@@ -55,6 +71,7 @@ export interface IProduct {
55
71
  invoice_product_key?: string,
56
72
  invoice_product_unit_key?: string,
57
73
  invoice_product_unit_name?: string,
74
+ invoiceModuleSettings?: IProductInvoiceModuleSettings,
58
75
  priceOptions?: IPriceOption[],
59
76
  }
60
77
 
@@ -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
+ });