washday-sdk 1.5.2 → 1.5.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/index.js CHANGED
@@ -338,6 +338,7 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD') {
338
338
  createMPAttempt: integrationsEndpoints.postModule.createMPAttempt,
339
339
  cancelMPAttempt: integrationsEndpoints.postModule.cancelMPAttempt,
340
340
  getMPAttemptStatus: integrationsEndpoints.getModule.getMPAttemptStatus,
341
+ updateMPTerminalOperationMode: integrationsEndpoints.postModule.updateMPTerminalOperationMode,
341
342
  });
342
343
  };
343
344
  export default WashdayClient;
@@ -68,6 +68,19 @@ export const importAllMPTerminals = function (data) {
68
68
  }
69
69
  });
70
70
  };
71
+ export const updateMPTerminalOperationMode = function (data) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ try {
74
+ const config = {
75
+ headers: { Authorization: `Bearer ${this.apiToken}` }
76
+ };
77
+ return yield this.axiosInstance.post(`${BASE_ROUTER}/mp/terminals/updateOperationMode`, data, config);
78
+ }
79
+ catch (error) {
80
+ throw error;
81
+ }
82
+ });
83
+ };
71
84
  export const createMPAttempt = function (data) {
72
85
  return __awaiter(this, void 0, void 0, function* () {
73
86
  try {
@@ -203,6 +203,7 @@ async function performDailyCashUp(storeId: string, cashierBoxId: string) {
203
203
  declaredCash: previewData.data.expectedCash,
204
204
  declaredCard: previewData.data.cardFromOrders,
205
205
  declaredTransfer: previewData.data.transferFromOrders || 0,
206
+ declaredMercadoPago: previewData.data.declaredMercadoPago || 0
206
207
  cashToBank: 500.00,
207
208
  notes: 'Daily cash-up completed'
208
209
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -8,6 +8,7 @@ export const create = async function (this: WashdayClientInstance, storeId: stri
8
8
  declaredCash: number;
9
9
  declaredCard: number;
10
10
  declaredTransfer: number;
11
+ declaredMercadoPago: number;
11
12
  cashToBank: number;
12
13
  notes: string;
13
14
  }): Promise<any> {
package/src/api/index.ts CHANGED
@@ -345,6 +345,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
345
345
  createMPAttempt: integrationsEndpoints.postModule.createMPAttempt,
346
346
  cancelMPAttempt: integrationsEndpoints.postModule.cancelMPAttempt,
347
347
  getMPAttemptStatus: integrationsEndpoints.getModule.getMPAttemptStatus,
348
+ updateMPTerminalOperationMode: integrationsEndpoints.postModule.updateMPTerminalOperationMode,
348
349
  });
349
350
  } as any;
350
351
 
@@ -67,6 +67,22 @@ export const importAllMPTerminals = async function (this: WashdayClientInstance,
67
67
  }
68
68
  };
69
69
 
70
+ export const updateMPTerminalOperationMode = async function (this: WashdayClientInstance, data: {
71
+ storeId: string;
72
+ mp_terminal_id: string;
73
+ operatingMode: string;
74
+ }): Promise<any> {
75
+ try {
76
+ const config = {
77
+ headers: { Authorization: `Bearer ${this.apiToken}` }
78
+ };
79
+ return await this.axiosInstance.post(`${BASE_ROUTER}/mp/terminals/updateOperationMode`, data, config);
80
+ }
81
+ catch (error) {
82
+ throw error;
83
+ }
84
+ };
85
+
70
86
  export const createMPAttempt = async function (this: WashdayClientInstance, data: {
71
87
  orderId: string;
72
88
  amount: number;
@@ -327,6 +327,7 @@ export interface WashdayClientInstance {
327
327
  createMPAttempt: typeof integrationsEndpoints.postModule.createMPAttempt;
328
328
  cancelMPAttempt: typeof integrationsEndpoints.postModule.cancelMPAttempt;
329
329
  getMPAttemptStatus: typeof integrationsEndpoints.getModule.getMPAttemptStatus;
330
+ updateMPTerminalOperationMode: typeof integrationsEndpoints.postModule.updateMPTerminalOperationMode;
330
331
  }
331
332
  };
332
333
  }
@@ -180,6 +180,7 @@ export interface ICashUpReport {
180
180
  declaredCash: number,
181
181
  declaredCard: number,
182
182
  declaredTransfer?: number,
183
+ declaredMercadoPago?: number,
183
184
  leftInDrawer: number,
184
185
  cashToBank: number,
185
186
  expectedCash: number,
@@ -209,6 +210,7 @@ export interface ICashUpReport {
209
210
  declaredCash: number,
210
211
  declaredCard: number,
211
212
  declaredTransfer?: number,
213
+ declaredMercadoPago?: number,
212
214
  leftInDrawer: number,
213
215
  cashToBank: number,
214
216
  expectedCash: number,