washday-sdk 0.0.192 → 0.0.194

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.
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import axiosInstance from "../axiosInstance";
11
11
  const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
12
+ const GET_SET_CASHIER_BOX_MOVEMENT = (storeId, cashierBoxId) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
12
13
  export const deleteCashierBoxById = function (storeId, id) {
13
14
  return __awaiter(this, void 0, void 0, function* () {
14
15
  try {
@@ -23,3 +24,17 @@ export const deleteCashierBoxById = function (storeId, id) {
23
24
  }
24
25
  });
25
26
  };
27
+ export const deleteCashierBoxMovementById = function (_a) {
28
+ return __awaiter(this, arguments, void 0, function* ({ storeId, cashierBoxId, movementId }) {
29
+ try {
30
+ const config = {
31
+ headers: { Authorization: `Bearer ${this.apiToken}` }
32
+ };
33
+ return yield axiosInstance.delete(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${movementId}`, config);
34
+ }
35
+ catch (error) {
36
+ console.error('Error fetching getStoreStaff:', error);
37
+ throw error;
38
+ }
39
+ });
40
+ };
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import axiosInstance from "../axiosInstance";
11
11
  const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
12
+ const GET_SET_CASHIER_BOX_MOVEMENT = (storeId, cashierBoxId) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
12
13
  export const createCashierBox = function (storeId, data) {
13
14
  return __awaiter(this, void 0, void 0, function* () {
14
15
  try {
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import axiosInstance from "../axiosInstance";
11
11
  const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
12
+ const GET_SET_CASHIER_BOX_MOVEMENT = (storeId, cashierBoxId) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
12
13
  export const updateCashierBoxById = function (storeId, id, data) {
13
14
  return __awaiter(this, void 0, void 0, function* () {
14
15
  try {
@@ -24,3 +25,18 @@ export const updateCashierBoxById = function (storeId, id, data) {
24
25
  }
25
26
  });
26
27
  };
28
+ export const updateCashierBoxMovementById = function (_a, data_1) {
29
+ return __awaiter(this, arguments, void 0, function* ({ storeId, cashierBoxId, id }, data) {
30
+ try {
31
+ const config = {
32
+ headers: { Authorization: `Bearer ${this.apiToken}` }
33
+ };
34
+ const response = yield axiosInstance.put(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${id}`, data, config);
35
+ return response;
36
+ }
37
+ catch (error) {
38
+ console.error('Error fetching getStoreById:', error);
39
+ throw error;
40
+ }
41
+ });
42
+ };
package/dist/api/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { deleteCashierBoxById } from "./cashierbox/delete";
1
+ import { deleteCashierBoxById, deleteCashierBoxMovementById } from "./cashierbox/delete";
2
2
  import { getCashierBoxMovementsHistory, getCashierboxesById, getCashierboxesByStoreId } from "./cashierbox/get";
3
3
  import { addCashierBoxMovement, createCashierBox } from "./cashierbox/post";
4
- import { updateCashierBoxById } from "./cashierbox/put";
4
+ import { updateCashierBoxById, updateCashierBoxMovementById } from "./cashierbox/put";
5
5
  import { getCompanyById } from "./companies/get";
6
6
  import { updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "./companies/post";
7
7
  import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "./companies/put";
@@ -124,6 +124,7 @@ const WashdayClient = function WashdayClient(apiToken) {
124
124
  createOrderUsersApp: ordersEndpoints.postModule.createOrderUsersApp,
125
125
  bulkCreatePaymentLines: ordersEndpoints.postModule.bulkCreatePaymentLines,
126
126
  createOrderEvidence: ordersEndpoints.postModule.createOrderEvidence,
127
+ getRedeemPointsPreview: ordersEndpoints.postModule.getRedeemPointsPreview,
127
128
  deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
128
129
  getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
129
130
  getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
@@ -209,8 +210,10 @@ const WashdayClient = function WashdayClient(apiToken) {
209
210
  getCashierBoxMovementsHistory: getCashierBoxMovementsHistory,
210
211
  createCashierBox: createCashierBox,
211
212
  updateCashierBoxById: updateCashierBoxById,
213
+ updateCashierBoxMovementById: updateCashierBoxMovementById,
212
214
  deleteCashierBoxById: deleteCashierBoxById,
213
215
  addCashierBoxMovement: addCashierBoxMovement,
216
+ deleteCashierBoxMovementById: deleteCashierBoxMovementById,
214
217
  });
215
218
  this.companies = bindMethods(this, {
216
219
  getCompanyById: getCompanyById,
@@ -99,3 +99,17 @@ export const createOrderEvidence = function (orderId, data) {
99
99
  }
100
100
  });
101
101
  };
102
+ export const getRedeemPointsPreview = function (data) {
103
+ return __awaiter(this, void 0, void 0, function* () {
104
+ try {
105
+ const config = {
106
+ headers: { Authorization: `Bearer ${this.apiToken}` }
107
+ };
108
+ return yield axiosInstance.post(`${GET_SET_ORDER}/redeemPointsPreview`, data, config);
109
+ }
110
+ catch (error) {
111
+ console.error('Error fetching getRedeemPointsPreview:', error);
112
+ throw error;
113
+ }
114
+ });
115
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.192",
3
+ "version": "0.0.194",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,6 +1,7 @@
1
1
  import { WashdayClientInstance } from "../../interfaces/Api";
2
2
  import axiosInstance from "../axiosInstance";
3
3
  const GET_SET_CASHIER_BOX = (storeId: string) => `api/store/${storeId}/cashierbox`;
4
+ const GET_SET_CASHIER_BOX_MOVEMENT = (storeId: string, cashierBoxId: string) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
4
5
 
5
6
  export const deleteCashierBoxById = async function (this: WashdayClientInstance, storeId: string, id: string): Promise<any> {
6
7
  try {
@@ -13,3 +14,15 @@ export const deleteCashierBoxById = async function (this: WashdayClientInstance,
13
14
  throw error;
14
15
  }
15
16
  };
17
+
18
+ export const deleteCashierBoxMovementById = async function (this: WashdayClientInstance, { storeId, cashierBoxId, movementId }: { storeId: string, cashierBoxId: string, movementId: string }): Promise<any> {
19
+ try {
20
+ const config = {
21
+ headers: { Authorization: `Bearer ${this.apiToken}` }
22
+ };
23
+ return await axiosInstance.delete(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${movementId}`, config);
24
+ } catch (error) {
25
+ console.error('Error fetching getStoreStaff:', error);
26
+ throw error;
27
+ }
28
+ };
@@ -2,6 +2,7 @@ import { WashdayClientInstance } from "../../interfaces/Api";
2
2
  import axiosInstance from "../axiosInstance";
3
3
 
4
4
  const GET_SET_CASHIER_BOX = (storeId: string) => `api/store/${storeId}/cashierbox`;
5
+ const GET_SET_CASHIER_BOX_MOVEMENT = (storeId: string, cashierBoxId: string) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
5
6
 
6
7
  export const createCashierBox = async function (this: WashdayClientInstance, storeId: string, data: {
7
8
  name: string
@@ -2,6 +2,7 @@ import { WashdayClientInstance } from "../../interfaces/Api";
2
2
  import axiosInstance from "../axiosInstance";
3
3
 
4
4
  const GET_SET_CASHIER_BOX = (storeId: string) => `api/store/${storeId}/cashierbox`;
5
+ const GET_SET_CASHIER_BOX_MOVEMENT = (storeId: string, cashierBoxId: string) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
5
6
 
6
7
  export const updateCashierBoxById = async function (this: WashdayClientInstance, storeId: string, id: string, data: { name: string }): Promise<any> {
7
8
  try {
@@ -15,3 +16,17 @@ export const updateCashierBoxById = async function (this: WashdayClientInstance,
15
16
  throw error;
16
17
  }
17
18
  };
19
+
20
+ export const updateCashierBoxMovementById = async function (this: WashdayClientInstance, { storeId, cashierBoxId, id }: { storeId: string, cashierBoxId: string, id: string }, data: { name: string }): Promise<any> {
21
+ try {
22
+ const config = {
23
+ headers: { Authorization: `Bearer ${this.apiToken}` }
24
+ };
25
+ const response = await axiosInstance.put(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${id}`, data, config);
26
+ return response;
27
+ } catch (error) {
28
+ console.error('Error fetching getStoreById:', error);
29
+ throw error;
30
+ }
31
+ };
32
+
package/src/api/index.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { WashdayClientInstance } from "../interfaces/Api";
2
- import { deleteCashierBoxById } from "./cashierbox/delete";
2
+ import { deleteCashierBoxById, deleteCashierBoxMovementById } from "./cashierbox/delete";
3
3
  import { getCashierBoxMovementsHistory, getCashierboxesById, getCashierboxesByStoreId } from "./cashierbox/get";
4
4
  import { addCashierBoxMovement, createCashierBox } from "./cashierbox/post";
5
- import { updateCashierBoxById } from "./cashierbox/put";
5
+ import { updateCashierBoxById, updateCashierBoxMovementById } from "./cashierbox/put";
6
6
  import { getCompanyById } from "./companies/get";
7
7
  import { updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "./companies/post";
8
8
  import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "./companies/put";
@@ -131,6 +131,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
131
131
  createOrderUsersApp: ordersEndpoints.postModule.createOrderUsersApp,
132
132
  bulkCreatePaymentLines: ordersEndpoints.postModule.bulkCreatePaymentLines,
133
133
  createOrderEvidence: ordersEndpoints.postModule.createOrderEvidence,
134
+ getRedeemPointsPreview: ordersEndpoints.postModule.getRedeemPointsPreview,
134
135
  deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
135
136
  getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
136
137
  getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
@@ -216,8 +217,10 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
216
217
  getCashierBoxMovementsHistory: getCashierBoxMovementsHistory,
217
218
  createCashierBox: createCashierBox,
218
219
  updateCashierBoxById: updateCashierBoxById,
220
+ updateCashierBoxMovementById: updateCashierBoxMovementById,
219
221
  deleteCashierBoxById: deleteCashierBoxById,
220
222
  addCashierBoxMovement: addCashierBoxMovement,
223
+ deleteCashierBoxMovementById: deleteCashierBoxMovementById,
221
224
  });
222
225
  this.companies = bindMethods(this, {
223
226
  getCompanyById: getCompanyById,
@@ -97,4 +97,20 @@ export const createOrderEvidence = async function (this: WashdayClientInstance,
97
97
  console.error('Error fetching createOrderEvidence:', error);
98
98
  throw error;
99
99
  }
100
+ };
101
+
102
+ export const getRedeemPointsPreview = async function (this: WashdayClientInstance, data: {
103
+ customerId: string;
104
+ storeId: string;
105
+ orderTotal: number;
106
+ }): Promise<any> {
107
+ try {
108
+ const config = {
109
+ headers: { Authorization: `Bearer ${this.apiToken}` }
110
+ };
111
+ return await axiosInstance.post(`${GET_SET_ORDER}/redeemPointsPreview`, data, config);
112
+ } catch (error) {
113
+ console.error('Error fetching getRedeemPointsPreview:', error);
114
+ throw error;
115
+ }
100
116
  };
@@ -1,7 +1,7 @@
1
- import { deleteCashierBoxById } from "../api/cashierbox/delete";
1
+ import { deleteCashierBoxById, deleteCashierBoxMovementById } from "../api/cashierbox/delete";
2
2
  import { getCashierBoxMovementsHistory, getCashierboxesById, getCashierboxesByStoreId } from "../api/cashierbox/get";
3
3
  import { addCashierBoxMovement, createCashierBox } from "../api/cashierbox/post";
4
- import { updateCashierBoxById } from "../api/cashierbox/put";
4
+ import { updateCashierBoxById, updateCashierBoxMovementById } from "../api/cashierbox/put";
5
5
  import { getCompanyById } from "../api/companies/get";
6
6
  import { updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "../api/companies/post";
7
7
  import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "../api/companies/put";
@@ -116,6 +116,7 @@ export interface WashdayClientInstance {
116
116
  createOrderUsersApp: typeof ordersEndpoints.postModule.createOrderUsersApp,
117
117
  bulkCreatePaymentLines: typeof ordersEndpoints.postModule.bulkCreatePaymentLines,
118
118
  createOrderEvidence: typeof ordersEndpoints.postModule.createOrderEvidence,
119
+ getRedeemPointsPreview: typeof ordersEndpoints.postModule.getRedeemPointsPreview,
119
120
  deletePaymentLineById: typeof ordersEndpoints.deleteModule.deletePaymentLineById;
120
121
  getListCustomersApp: typeof ordersEndpoints.getModule.getListCustomersApp;
121
122
  getByIdCustomersApp: typeof ordersEndpoints.getModule.getByIdCustomersApp;
@@ -201,8 +202,10 @@ export interface WashdayClientInstance {
201
202
  getCashierBoxMovementsHistory: typeof getCashierBoxMovementsHistory;
202
203
  createCashierBox: typeof createCashierBox;
203
204
  updateCashierBoxById: typeof updateCashierBoxById;
205
+ updateCashierBoxMovementById: typeof updateCashierBoxMovementById;
204
206
  deleteCashierBoxById: typeof deleteCashierBoxById;
205
207
  addCashierBoxMovement: typeof addCashierBoxMovement;
208
+ deleteCashierBoxMovementById: typeof deleteCashierBoxMovementById;
206
209
  };
207
210
  companies: {
208
211
  getCompanyById: typeof getCompanyById;