washday-sdk 1.6.49 → 1.6.51
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/dist/api/csv/get.js +2 -1
- package/dist/interfaces/Store.ticketStructurePresets.test.js +13 -0
- package/package.json +1 -1
- package/src/api/csv/get.ts +4 -2
- package/src/interfaces/Store.ticketStructurePresets.test.ts +16 -0
- package/src/interfaces/Store.ts +4 -0
- package/test/csv.exportOrdersListAssignedEmployee.test.ts +45 -0
- package/test/store.ticketStructureTaxIdLabel.test.ts +26 -0
package/dist/api/csv/get.js
CHANGED
|
@@ -61,7 +61,8 @@ export const exportOrdersList = function (params) {
|
|
|
61
61
|
'cleanedDateTime',
|
|
62
62
|
'readyDateTime',
|
|
63
63
|
'collectedDateTime',
|
|
64
|
-
'q'
|
|
64
|
+
'q',
|
|
65
|
+
'assignedEmployee'
|
|
65
66
|
], params);
|
|
66
67
|
return yield this.axiosInstance.get(`${GENERATE_EXPORT}/export-all-orders?${queryParams}`, config);
|
|
67
68
|
}
|
|
@@ -22,6 +22,8 @@ const ticketStructure = {
|
|
|
22
22
|
orderFolioFontSizePreset: folioPreset,
|
|
23
23
|
ticketLineSpacingPreset: spacingPreset,
|
|
24
24
|
ticketPrintFormat: "escpos",
|
|
25
|
+
tax_id: "J-507138330",
|
|
26
|
+
tax_id_label: "RIF",
|
|
25
27
|
};
|
|
26
28
|
const labelTicketStructure = Object.assign({}, ticketStructure);
|
|
27
29
|
const ticketForLaundryStructure = {
|
|
@@ -47,6 +49,8 @@ const ticketForLaundryStructure = {
|
|
|
47
49
|
orderFolioFontSizePreset: "large",
|
|
48
50
|
ticketLineSpacingPreset: "small",
|
|
49
51
|
ticketPrintFormat: "html",
|
|
52
|
+
tax_id: "ABC123",
|
|
53
|
+
tax_id_label: "RFC",
|
|
50
54
|
};
|
|
51
55
|
if (ticketStructure.orderFolioFontSizePreset !== "large") {
|
|
52
56
|
throw new Error("Ticket structure folio preset was not preserved");
|
|
@@ -57,4 +61,13 @@ if (labelTicketStructure.ticketLineSpacingPreset !== "medium") {
|
|
|
57
61
|
if (ticketForLaundryStructure.customerNameFontSize !== "medium") {
|
|
58
62
|
throw new Error("Laundry ticket structure customer font size was not preserved");
|
|
59
63
|
}
|
|
64
|
+
if (ticketStructure.tax_id_label !== "RIF") {
|
|
65
|
+
throw new Error("Ticket structure tax ID label was not preserved");
|
|
66
|
+
}
|
|
67
|
+
if (labelTicketStructure.tax_id !== "J-507138330") {
|
|
68
|
+
throw new Error("Label ticket structure tax ID value was not preserved");
|
|
69
|
+
}
|
|
70
|
+
if (ticketForLaundryStructure.tax_id_label !== "RFC") {
|
|
71
|
+
throw new Error("Laundry ticket structure tax ID label was not preserved");
|
|
72
|
+
}
|
|
60
73
|
export {};
|
package/package.json
CHANGED
package/src/api/csv/get.ts
CHANGED
|
@@ -51,7 +51,8 @@ export const exportOrdersList = async function (this: WashdayClientInstance, par
|
|
|
51
51
|
cleanedDateTime: string | undefined,
|
|
52
52
|
readyDateTime: string | undefined,
|
|
53
53
|
collectedDateTime: string | undefined,
|
|
54
|
-
q: string | undefined
|
|
54
|
+
q: string | undefined,
|
|
55
|
+
assignedEmployee?: string | undefined
|
|
55
56
|
}): Promise<any> {
|
|
56
57
|
try {
|
|
57
58
|
const config = {
|
|
@@ -79,7 +80,8 @@ export const exportOrdersList = async function (this: WashdayClientInstance, par
|
|
|
79
80
|
'cleanedDateTime',
|
|
80
81
|
'readyDateTime',
|
|
81
82
|
'collectedDateTime',
|
|
82
|
-
'q'
|
|
83
|
+
'q',
|
|
84
|
+
'assignedEmployee'
|
|
83
85
|
], params);
|
|
84
86
|
return await this.axiosInstance.get(`${GENERATE_EXPORT}/export-all-orders?${queryParams}`, config);
|
|
85
87
|
} catch (error) {
|
|
@@ -30,6 +30,8 @@ const ticketStructure: ITicketStructure = {
|
|
|
30
30
|
orderFolioFontSizePreset: folioPreset,
|
|
31
31
|
ticketLineSpacingPreset: spacingPreset,
|
|
32
32
|
ticketPrintFormat: "escpos",
|
|
33
|
+
tax_id: "J-507138330",
|
|
34
|
+
tax_id_label: "RIF",
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
const labelTicketStructure: ILabelTicketStructure = {
|
|
@@ -59,6 +61,8 @@ const ticketForLaundryStructure: ITicketForLaundryStructure = {
|
|
|
59
61
|
orderFolioFontSizePreset: "large",
|
|
60
62
|
ticketLineSpacingPreset: "small",
|
|
61
63
|
ticketPrintFormat: "html",
|
|
64
|
+
tax_id: "ABC123",
|
|
65
|
+
tax_id_label: "RFC",
|
|
62
66
|
};
|
|
63
67
|
|
|
64
68
|
if (ticketStructure.orderFolioFontSizePreset !== "large") {
|
|
@@ -72,3 +76,15 @@ if (labelTicketStructure.ticketLineSpacingPreset !== "medium") {
|
|
|
72
76
|
if (ticketForLaundryStructure.customerNameFontSize !== "medium") {
|
|
73
77
|
throw new Error("Laundry ticket structure customer font size was not preserved");
|
|
74
78
|
}
|
|
79
|
+
|
|
80
|
+
if (ticketStructure.tax_id_label !== "RIF") {
|
|
81
|
+
throw new Error("Ticket structure tax ID label was not preserved");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (labelTicketStructure.tax_id !== "J-507138330") {
|
|
85
|
+
throw new Error("Label ticket structure tax ID value was not preserved");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (ticketForLaundryStructure.tax_id_label !== "RFC") {
|
|
89
|
+
throw new Error("Laundry ticket structure tax ID label was not preserved");
|
|
90
|
+
}
|
package/src/interfaces/Store.ts
CHANGED
|
@@ -300,6 +300,8 @@ export interface ITicketStructure {
|
|
|
300
300
|
showLegend: Boolean,
|
|
301
301
|
showPaymentMethod: Boolean,
|
|
302
302
|
showStorePhone: Boolean,
|
|
303
|
+
tax_id?: string,
|
|
304
|
+
tax_id_label?: string,
|
|
303
305
|
showCustomerPoints: Boolean,
|
|
304
306
|
showDeliveryDate: Boolean,
|
|
305
307
|
showDeliveryTime: Boolean,
|
|
@@ -325,6 +327,8 @@ export interface ITicketForLaundryStructure {
|
|
|
325
327
|
showLegend: Boolean,
|
|
326
328
|
showPaymentMethod: Boolean,
|
|
327
329
|
showStorePhone: Boolean,
|
|
330
|
+
tax_id?: string,
|
|
331
|
+
tax_id_label?: string,
|
|
328
332
|
showCustomerPoints: Boolean,
|
|
329
333
|
showDeliveryDate: Boolean,
|
|
330
334
|
showDeliveryTime: Boolean,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { exportOrdersList } from "../src/api/csv/get";
|
|
2
|
+
|
|
3
|
+
describe("csv.exportOrdersList assignedEmployee filter", () => {
|
|
4
|
+
it("passes assignedEmployee through the export query string", async () => {
|
|
5
|
+
const get = jest.fn().mockResolvedValue({ data: new Blob() });
|
|
6
|
+
const client = {
|
|
7
|
+
apiToken: "token-123",
|
|
8
|
+
axiosInstance: { get },
|
|
9
|
+
} as any;
|
|
10
|
+
|
|
11
|
+
const result = await exportOrdersList.call(client, {
|
|
12
|
+
storeId: "store-1",
|
|
13
|
+
status: "cleaning",
|
|
14
|
+
name: undefined,
|
|
15
|
+
phone: undefined,
|
|
16
|
+
email: undefined,
|
|
17
|
+
fromDate: undefined,
|
|
18
|
+
toDate: undefined,
|
|
19
|
+
sequence: undefined,
|
|
20
|
+
pageNum: "0",
|
|
21
|
+
limit: "20",
|
|
22
|
+
sequenceSort: "-1",
|
|
23
|
+
cleanedDateTime: undefined,
|
|
24
|
+
readyDateTime: undefined,
|
|
25
|
+
collectedDateTime: undefined,
|
|
26
|
+
q: undefined,
|
|
27
|
+
assignedEmployee: "employee-1",
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
expect(get).toHaveBeenCalledWith(
|
|
31
|
+
"api/export/export-all-orders?storeId=store-1&status=cleaning&name=undefined&phone=undefined&email=undefined&fromDate=undefined&toDate=undefined&sequence=undefined&pageNum=0&limit=20&sequenceSort=-1&cleanedDateTime=undefined&readyDateTime=undefined&collectedDateTime=undefined&q=undefined&assignedEmployee=employee-1",
|
|
32
|
+
{
|
|
33
|
+
headers: {
|
|
34
|
+
Authorization: "Bearer token-123",
|
|
35
|
+
"Content-Type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
36
|
+
"Content-disposition": "attachment; filename=[file.csv]",
|
|
37
|
+
},
|
|
38
|
+
params: {
|
|
39
|
+
responseType: "blob",
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
expect(result).toEqual({ data: expect.any(Blob) });
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ILabelTicketStructure,
|
|
3
|
+
ITicketForLaundryStructure,
|
|
4
|
+
ITicketStructure,
|
|
5
|
+
} from "../src/interfaces/Store";
|
|
6
|
+
|
|
7
|
+
describe("ticket structure tax ID fields", () => {
|
|
8
|
+
it("accepts tax_id and tax_id_label on all ticket structure variants", () => {
|
|
9
|
+
const ticketStructure: Partial<ITicketStructure> = {
|
|
10
|
+
tax_id: "J-507138330",
|
|
11
|
+
tax_id_label: "RIF",
|
|
12
|
+
};
|
|
13
|
+
const labelTicketStructure: Partial<ILabelTicketStructure> = {
|
|
14
|
+
tax_id: "ABC123",
|
|
15
|
+
tax_id_label: "RFC",
|
|
16
|
+
};
|
|
17
|
+
const ticketForLaundryStructure: Partial<ITicketForLaundryStructure> = {
|
|
18
|
+
tax_id: "J-507138330",
|
|
19
|
+
tax_id_label: "RIF",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
expect(ticketStructure.tax_id_label).toBe("RIF");
|
|
23
|
+
expect(labelTicketStructure.tax_id).toBe("ABC123");
|
|
24
|
+
expect(ticketForLaundryStructure.tax_id_label).toBe("RIF");
|
|
25
|
+
});
|
|
26
|
+
});
|