washday-sdk 1.6.1 → 1.6.3

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/index.js CHANGED
@@ -2,7 +2,7 @@ import { deleteCashierBoxById, deleteCashierBoxMovementById } from "./cashierbox
2
2
  import { getCashierBoxMovementsHistory, getCashierboxesById, getCashierboxesByStoreId } from "./cashierbox/get";
3
3
  import { addCashierBoxMovement, createCashierBox } from "./cashierbox/post";
4
4
  import { updateCashierBoxById, updateCashierBoxMovementById } from "./cashierbox/put";
5
- import { getCompanyById } from "./companies/get";
5
+ import { getCompanyById, getCompanyOrdersMetrics } from "./companies/get";
6
6
  import { disableBillingOverage, enableBillingOverage, updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "./companies/post";
7
7
  import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "./companies/put";
8
8
  import { getCountries } from "./countries/get";
@@ -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,
@@ -231,6 +232,7 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD', clientId, c
231
232
  });
232
233
  this.companies = bindMethods(this, {
233
234
  getCompanyById: getCompanyById,
235
+ getCompanyOrdersMetrics: getCompanyOrdersMetrics,
234
236
  updateCompanyById: updateCompanyById,
235
237
  updateCompanyLogoById: updateCompanyLogoById,
236
238
  updateCompanyTaxInfoById: updateCompanyTaxInfoById,
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
package/src/api/index.ts CHANGED
@@ -3,7 +3,7 @@ import { deleteCashierBoxById, deleteCashierBoxMovementById } from "./cashierbox
3
3
  import { getCashierBoxMovementsHistory, getCashierboxesById, getCashierboxesByStoreId } from "./cashierbox/get";
4
4
  import { addCashierBoxMovement, createCashierBox } from "./cashierbox/post";
5
5
  import { updateCashierBoxById, updateCashierBoxMovementById } from "./cashierbox/put";
6
- import { getCompanyById } from "./companies/get";
6
+ import { getCompanyById, getCompanyOrdersMetrics } from "./companies/get";
7
7
  import { disableBillingOverage, enableBillingOverage, updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "./companies/post";
8
8
  import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "./companies/put";
9
9
  import { getCountries } from "./countries/get";
@@ -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,
@@ -238,6 +239,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
238
239
  });
239
240
  this.companies = bindMethods(this, {
240
241
  getCompanyById: getCompanyById,
242
+ getCompanyOrdersMetrics: getCompanyOrdersMetrics,
241
243
  updateCompanyById: updateCompanyById,
242
244
  updateCompanyLogoById: updateCompanyLogoById,
243
245
  updateCompanyTaxInfoById: updateCompanyTaxInfoById,
@@ -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
  };
@@ -2,7 +2,7 @@ import { deleteCashierBoxById, deleteCashierBoxMovementById } from "../api/cashi
2
2
  import { getCashierBoxMovementsHistory, getCashierboxesById, getCashierboxesByStoreId } from "../api/cashierbox/get";
3
3
  import { addCashierBoxMovement, createCashierBox } from "../api/cashierbox/post";
4
4
  import { updateCashierBoxById, updateCashierBoxMovementById } from "../api/cashierbox/put";
5
- import { getCompanyById } from "../api/companies/get";
5
+ import { getCompanyById, getCompanyOrdersMetrics } from "../api/companies/get";
6
6
  import { disableBillingOverage, enableBillingOverage, updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "../api/companies/post";
7
7
  import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "../api/companies/put";
8
8
  import { getCountries } from "../api/countries/get";
@@ -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;
@@ -223,6 +224,7 @@ export interface WashdayClientInstance {
223
224
  };
224
225
  companies: {
225
226
  getCompanyById: typeof getCompanyById;
227
+ getCompanyOrdersMetrics: typeof getCompanyOrdersMetrics;
226
228
  updateCompanyById: typeof updateCompanyById;
227
229
  updateCompanyLogoById: typeof updateCompanyLogoById;
228
230
  updateCompanyTaxInfoById: typeof updateCompanyTaxInfoById;