washday-sdk 1.6.2 → 1.6.4
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 +26 -0
- package/dist/api/index.js +3 -0
- package/dist/api/order/post.js +14 -0
- package/dist/api/reports/get.js +19 -0
- package/package.json +1 -1
- package/src/api/csv/get.ts +28 -0
- package/src/api/index.ts +3 -0
- package/src/api/order/post.ts +17 -0
- package/src/api/reports/get.ts +21 -0
- package/src/interfaces/Api.ts +3 -0
package/dist/api/csv/get.js
CHANGED
|
@@ -294,6 +294,32 @@ export const exportPaymentLinesReport = function (storeId, params) {
|
|
|
294
294
|
}
|
|
295
295
|
});
|
|
296
296
|
};
|
|
297
|
+
export const exportCashUpReportsByDateRange = function (storeId, params) {
|
|
298
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
299
|
+
try {
|
|
300
|
+
const config = {
|
|
301
|
+
headers: {
|
|
302
|
+
Authorization: `Bearer ${this.apiToken}`,
|
|
303
|
+
'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
304
|
+
'Content-disposition': 'attachment; filename=[file.csv]'
|
|
305
|
+
},
|
|
306
|
+
params: {
|
|
307
|
+
responseType: 'blob'
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
const queryParams = generateQueryParamsStr([
|
|
311
|
+
'fromDate',
|
|
312
|
+
'toDate',
|
|
313
|
+
'cashierBoxId',
|
|
314
|
+
], params);
|
|
315
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/cashups/export?${queryParams}`, config);
|
|
316
|
+
}
|
|
317
|
+
catch (error) {
|
|
318
|
+
console.error('Error fetching exportCashUpReportsByDateRange:', error);
|
|
319
|
+
throw error;
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
};
|
|
297
323
|
export const exportUnpaidOrdersReportCSV = function (storeId, params) {
|
|
298
324
|
return __awaiter(this, void 0, void 0, function* () {
|
|
299
325
|
try {
|
package/dist/api/index.js
CHANGED
|
@@ -134,6 +134,7 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD', clientId, c
|
|
|
134
134
|
bulkCreatePaymentLines: ordersEndpoints.postModule.bulkCreatePaymentLines,
|
|
135
135
|
createOrderEvidence: ordersEndpoints.postModule.createOrderEvidence,
|
|
136
136
|
getRedeemPointsPreview: ordersEndpoints.postModule.getRedeemPointsPreview,
|
|
137
|
+
setOrderUncollected: ordersEndpoints.postModule.setOrderUncollected,
|
|
137
138
|
deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
|
|
138
139
|
getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
|
|
139
140
|
getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
|
|
@@ -284,11 +285,13 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD', clientId, c
|
|
|
284
285
|
exportPaymentLinesReport: csvExportEndpoints.getModule.exportPaymentLinesReport,
|
|
285
286
|
exportUnpaidOrdersReportCSV: csvExportEndpoints.getModule.exportUnpaidOrdersReportCSV,
|
|
286
287
|
exportAttendanceReport: csvExportEndpoints.getModule.exportAttendanceReport,
|
|
288
|
+
exportCashUpReportsByDateRange: csvExportEndpoints.getModule.exportCashUpReportsByDateRange,
|
|
287
289
|
});
|
|
288
290
|
this.pdf = bindMethods(this, {
|
|
289
291
|
exportUnpaidOrdersReportPDF: pdfExportEndpoints.getModule.exportUnpaidOrdersReportPDF,
|
|
290
292
|
});
|
|
291
293
|
this.reports = bindMethods(this, {
|
|
294
|
+
getCashUpReportsByDateRange: reportsExportEndpoints.getModule.getCashUpReportsByDateRange,
|
|
292
295
|
getCleanedOrdersReport: reportsExportEndpoints.getModule.getCleanedOrdersReport,
|
|
293
296
|
getCleanedOrdersGraphDataReport: reportsExportEndpoints.getModule.getCleanedOrdersGraphDataReport,
|
|
294
297
|
getSalesReport: reportsExportEndpoints.getModule.getSalesReport,
|
package/dist/api/order/post.js
CHANGED
|
@@ -112,3 +112,17 @@ export const getRedeemPointsPreview = function (data) {
|
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
114
|
};
|
|
115
|
+
export const setOrderUncollected = function (data) {
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
try {
|
|
118
|
+
const config = {
|
|
119
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
120
|
+
};
|
|
121
|
+
return yield this.axiosInstance.post(`${GET_SET_ORDER}/uncollected`, data, config);
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
console.error('Error fetching setOrderUncollected:', error);
|
|
125
|
+
throw error;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
};
|
package/dist/api/reports/get.js
CHANGED
|
@@ -300,3 +300,22 @@ export const getPopularDaysStatistics = function (storeId, params) {
|
|
|
300
300
|
}
|
|
301
301
|
});
|
|
302
302
|
};
|
|
303
|
+
export const getCashUpReportsByDateRange = function (storeId, params) {
|
|
304
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
305
|
+
try {
|
|
306
|
+
const config = {
|
|
307
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
308
|
+
};
|
|
309
|
+
const queryParams = generateQueryParamsStr([
|
|
310
|
+
'fromDate',
|
|
311
|
+
'toDate',
|
|
312
|
+
'cashierBoxId',
|
|
313
|
+
], params);
|
|
314
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/cashups?${queryParams}`, config);
|
|
315
|
+
}
|
|
316
|
+
catch (error) {
|
|
317
|
+
console.error('Error fetching getCashUpReportsByDateRange:', error);
|
|
318
|
+
throw error;
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
};
|
package/package.json
CHANGED
package/src/api/csv/get.ts
CHANGED
|
@@ -321,6 +321,34 @@ export const exportPaymentLinesReport = async function (this: WashdayClientInsta
|
|
|
321
321
|
}
|
|
322
322
|
};
|
|
323
323
|
|
|
324
|
+
export const exportCashUpReportsByDateRange = async function (this: WashdayClientInstance, storeId: string, params: {
|
|
325
|
+
fromDate?: string
|
|
326
|
+
toDate?: string
|
|
327
|
+
cashierBoxId?: string
|
|
328
|
+
}): Promise<any> {
|
|
329
|
+
try {
|
|
330
|
+
const config = {
|
|
331
|
+
headers: {
|
|
332
|
+
Authorization: `Bearer ${this.apiToken}`,
|
|
333
|
+
'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
334
|
+
'Content-disposition': 'attachment; filename=[file.csv]'
|
|
335
|
+
},
|
|
336
|
+
params: {
|
|
337
|
+
responseType: 'blob'
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
const queryParams = generateQueryParamsStr([
|
|
341
|
+
'fromDate',
|
|
342
|
+
'toDate',
|
|
343
|
+
'cashierBoxId',
|
|
344
|
+
], params);
|
|
345
|
+
return await this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/cashups/export?${queryParams}`, config);
|
|
346
|
+
} catch (error) {
|
|
347
|
+
console.error('Error fetching exportCashUpReportsByDateRange:', error);
|
|
348
|
+
throw error;
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
|
|
324
352
|
export const exportUnpaidOrdersReportCSV = async function (this: WashdayClientInstance, storeId: string, params: {
|
|
325
353
|
fromDate?: string
|
|
326
354
|
toDate?: string
|
package/src/api/index.ts
CHANGED
|
@@ -141,6 +141,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
141
141
|
bulkCreatePaymentLines: ordersEndpoints.postModule.bulkCreatePaymentLines,
|
|
142
142
|
createOrderEvidence: ordersEndpoints.postModule.createOrderEvidence,
|
|
143
143
|
getRedeemPointsPreview: ordersEndpoints.postModule.getRedeemPointsPreview,
|
|
144
|
+
setOrderUncollected: ordersEndpoints.postModule.setOrderUncollected,
|
|
144
145
|
deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
|
|
145
146
|
getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
|
|
146
147
|
getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
|
|
@@ -291,11 +292,13 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
291
292
|
exportPaymentLinesReport: csvExportEndpoints.getModule.exportPaymentLinesReport,
|
|
292
293
|
exportUnpaidOrdersReportCSV: csvExportEndpoints.getModule.exportUnpaidOrdersReportCSV,
|
|
293
294
|
exportAttendanceReport: csvExportEndpoints.getModule.exportAttendanceReport,
|
|
295
|
+
exportCashUpReportsByDateRange: csvExportEndpoints.getModule.exportCashUpReportsByDateRange,
|
|
294
296
|
});
|
|
295
297
|
this.pdf = bindMethods(this, {
|
|
296
298
|
exportUnpaidOrdersReportPDF: pdfExportEndpoints.getModule.exportUnpaidOrdersReportPDF,
|
|
297
299
|
});
|
|
298
300
|
this.reports = bindMethods(this, {
|
|
301
|
+
getCashUpReportsByDateRange: reportsExportEndpoints.getModule.getCashUpReportsByDateRange,
|
|
299
302
|
getCleanedOrdersReport: reportsExportEndpoints.getModule.getCleanedOrdersReport,
|
|
300
303
|
getCleanedOrdersGraphDataReport: reportsExportEndpoints.getModule.getCleanedOrdersGraphDataReport,
|
|
301
304
|
getSalesReport: reportsExportEndpoints.getModule.getSalesReport,
|
package/src/api/order/post.ts
CHANGED
|
@@ -115,4 +115,21 @@ export const getRedeemPointsPreview = async function (this: WashdayClientInstanc
|
|
|
115
115
|
console.error('Error fetching getRedeemPointsPreview:', error);
|
|
116
116
|
throw error;
|
|
117
117
|
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const setOrderUncollected = async function (this: WashdayClientInstance, data: {
|
|
121
|
+
orderId?: string;
|
|
122
|
+
orderSequence?: string;
|
|
123
|
+
orderStore?: string;
|
|
124
|
+
reason?: 'abandoned' | 'sent_to_warehouse' | 'donated' | 'discarded' | 'other';
|
|
125
|
+
}): Promise<any> {
|
|
126
|
+
try {
|
|
127
|
+
const config = {
|
|
128
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
129
|
+
};
|
|
130
|
+
return await this.axiosInstance.post(`${GET_SET_ORDER}/uncollected`, data, config);
|
|
131
|
+
} catch (error) {
|
|
132
|
+
console.error('Error fetching setOrderUncollected:', error);
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
118
135
|
};
|
package/src/api/reports/get.ts
CHANGED
|
@@ -326,4 +326,25 @@ export const getPopularDaysStatistics = async function (this: WashdayClientInsta
|
|
|
326
326
|
console.error('Error fetching getPopularDaysStatistics :', error);
|
|
327
327
|
throw error;
|
|
328
328
|
}
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
export const getCashUpReportsByDateRange = async function (this: WashdayClientInstance, storeId: string, params: {
|
|
332
|
+
fromDate?: string
|
|
333
|
+
toDate?: string
|
|
334
|
+
cashierBoxId?: string
|
|
335
|
+
}): Promise<any> {
|
|
336
|
+
try {
|
|
337
|
+
const config = {
|
|
338
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
339
|
+
};
|
|
340
|
+
const queryParams = generateQueryParamsStr([
|
|
341
|
+
'fromDate',
|
|
342
|
+
'toDate',
|
|
343
|
+
'cashierBoxId',
|
|
344
|
+
], params);
|
|
345
|
+
return await this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/cashups?${queryParams}`, config);
|
|
346
|
+
} catch (error) {
|
|
347
|
+
console.error('Error fetching getCashUpReportsByDateRange:', error);
|
|
348
|
+
throw error;
|
|
349
|
+
}
|
|
329
350
|
};
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -126,6 +126,7 @@ export interface WashdayClientInstance {
|
|
|
126
126
|
bulkCreatePaymentLines: typeof ordersEndpoints.postModule.bulkCreatePaymentLines,
|
|
127
127
|
createOrderEvidence: typeof ordersEndpoints.postModule.createOrderEvidence,
|
|
128
128
|
getRedeemPointsPreview: typeof ordersEndpoints.postModule.getRedeemPointsPreview,
|
|
129
|
+
setOrderUncollected: typeof ordersEndpoints.postModule.setOrderUncollected,
|
|
129
130
|
deletePaymentLineById: typeof ordersEndpoints.deleteModule.deletePaymentLineById;
|
|
130
131
|
getListCustomersApp: typeof ordersEndpoints.getModule.getListCustomersApp;
|
|
131
132
|
getByIdCustomersApp: typeof ordersEndpoints.getModule.getByIdCustomersApp;
|
|
@@ -270,6 +271,7 @@ export interface WashdayClientInstance {
|
|
|
270
271
|
exportProductSalesReport: typeof csvExportEndpoints.getModule.exportProductSalesReport;
|
|
271
272
|
exportPaymentLinesReport: typeof csvExportEndpoints.getModule.exportPaymentLinesReport;
|
|
272
273
|
exportUnpaidOrdersReportCSV: typeof csvExportEndpoints.getModule.exportUnpaidOrdersReportCSV;
|
|
274
|
+
exportCashUpReportsByDateRange: typeof csvExportEndpoints.getModule.exportCashUpReportsByDateRange;
|
|
273
275
|
exportOrdersList: typeof csvExportEndpoints.getModule.exportOrdersList,
|
|
274
276
|
exportProductsList: typeof csvExportEndpoints.getModule.exportProductsList,
|
|
275
277
|
exportCleanedOrdersReport: typeof csvExportEndpoints.getModule.exportCleanedOrdersReport,
|
|
@@ -281,6 +283,7 @@ export interface WashdayClientInstance {
|
|
|
281
283
|
exportUnpaidOrdersReportPDF: typeof pdfExportEndpoints.getModule.exportUnpaidOrdersReportPDF;
|
|
282
284
|
};
|
|
283
285
|
reports: {
|
|
286
|
+
getCashUpReportsByDateRange: typeof reportsExportEndpoints.getModule.getCashUpReportsByDateRange;
|
|
284
287
|
getCleanedOrdersReport: typeof reportsExportEndpoints.getModule.getCleanedOrdersReport;
|
|
285
288
|
getCleanedOrdersGraphDataReport: typeof reportsExportEndpoints.getModule.getCleanedOrdersGraphDataReport;
|
|
286
289
|
getSalesReport: typeof reportsExportEndpoints.getModule.getSalesReport;
|