washday-sdk 0.0.91 → 0.0.92

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.
@@ -82,6 +82,7 @@ export const sendCFDIByEmail = function (id) {
82
82
  }
83
83
  });
84
84
  };
85
+ // THIS IS FOR WHEN MODAL OPENS AND WE WANT TO GET PREVIEW DATA
85
86
  export const getGlobalCFDIPreview = function (params) {
86
87
  return __awaiter(this, void 0, void 0, function* () {
87
88
  try {
package/dist/api/index.js CHANGED
@@ -65,6 +65,7 @@ const WashdayClient = function WashdayClient(apiToken) {
65
65
  this.orders = bindMethods(this, {
66
66
  getList: ordersEndpoints.getModule.getList,
67
67
  getById: ordersEndpoints.getModule.getById,
68
+ fetchOrdersForCFDI: ordersEndpoints.getModule.fetchOrdersForCFDI,
68
69
  updateById: ordersEndpoints.putModule.updateById,
69
70
  updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
70
71
  createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
@@ -56,3 +56,37 @@ export const getById = function (id) {
56
56
  }
57
57
  });
58
58
  };
59
+ export const getCFDIOrdersByDateAndStore = function (id) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ try {
62
+ const config = {
63
+ headers: { Authorization: `Bearer ${this.apiToken}` }
64
+ };
65
+ return yield axiosInstance.get(`${GET_SET_ORDER}/${id}`, config);
66
+ }
67
+ catch (error) {
68
+ console.error('Error fetching:', error);
69
+ throw error;
70
+ }
71
+ });
72
+ };
73
+ export const fetchOrdersForCFDI = function (params) {
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ try {
76
+ const config = {
77
+ headers: { Authorization: `Bearer ${this.apiToken}` }
78
+ };
79
+ const queryParams = generateQueryParamsStr([
80
+ "fromDate",
81
+ "toDate",
82
+ "storeID",
83
+ "customerID"
84
+ ], params);
85
+ return yield axiosInstance.get(`${GET_SET_ORDER}/cfdiPreview?${queryParams}`, config);
86
+ }
87
+ catch (error) {
88
+ console.error('Error fetching:', error);
89
+ throw error;
90
+ }
91
+ });
92
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.91",
3
+ "version": "0.0.92",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -77,7 +77,7 @@ export const sendCFDIByEmail = async function (this: WashdayClientInstance, id:
77
77
  }
78
78
  }
79
79
 
80
-
80
+ // THIS IS FOR WHEN MODAL OPENS AND WE WANT TO GET PREVIEW DATA
81
81
  export const getGlobalCFDIPreview = async function (this: WashdayClientInstance, params: {
82
82
  ordersID?: string[];
83
83
  customerId?: string
package/src/api/index.ts CHANGED
@@ -71,6 +71,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
71
71
  this.orders = bindMethods(this, {
72
72
  getList: ordersEndpoints.getModule.getList,
73
73
  getById: ordersEndpoints.getModule.getById,
74
+ fetchOrdersForCFDI: ordersEndpoints.getModule.fetchOrdersForCFDI,
74
75
  updateById: ordersEndpoints.putModule.updateById,
75
76
  updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
76
77
  createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
@@ -61,4 +61,39 @@ export const getById = async function (this: WashdayClientInstance, id: string):
61
61
  console.error('Error fetching:', error);
62
62
  throw error;
63
63
  }
64
+ }
65
+
66
+ export const getCFDIOrdersByDateAndStore = async function (this: WashdayClientInstance, id: string): Promise<IOrder> {
67
+ try {
68
+ const config = {
69
+ headers: { Authorization: `Bearer ${this.apiToken}` }
70
+ };
71
+ return await axiosInstance.get(`${GET_SET_ORDER}/${id}`, config);
72
+ } catch (error) {
73
+ console.error('Error fetching:', error);
74
+ throw error;
75
+ }
76
+ }
77
+
78
+ export const fetchOrdersForCFDI = async function (this: WashdayClientInstance, params: {
79
+ fromDate: string
80
+ toDate: string
81
+ storeID: string
82
+ customerID?: string
83
+ }): Promise<any> {
84
+ try {
85
+ const config = {
86
+ headers: { Authorization: `Bearer ${this.apiToken}` }
87
+ };
88
+ const queryParams = generateQueryParamsStr([
89
+ "fromDate",
90
+ "toDate",
91
+ "storeID",
92
+ "customerID"
93
+ ], params);
94
+ return await axiosInstance.get(`${GET_SET_ORDER}/cfdiPreview?${queryParams}`, config);
95
+ } catch (error) {
96
+ console.error('Error fetching:', error);
97
+ throw error;
98
+ }
64
99
  }
@@ -57,6 +57,7 @@ export interface WashdayClientInstance {
57
57
  orders: {
58
58
  getList: typeof ordersEndpoints.getModule.getList;
59
59
  getById: typeof ordersEndpoints.getModule.getById;
60
+ fetchOrdersForCFDI: typeof ordersEndpoints.getModule.fetchOrdersForCFDI;
60
61
  updateById: typeof ordersEndpoints.putModule.updateById;
61
62
  updatePaymentLineById: typeof ordersEndpoints.putModule.updatePaymentLineById;
62
63
  createPaymentLine: typeof ordersEndpoints.postModule.createPaymentLine;