washday-sdk 0.0.193 → 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.
- package/dist/api/index.js +1 -0
- package/dist/api/order/post.js +14 -0
- package/package.json +1 -1
- package/src/api/index.ts +1 -0
- package/src/api/order/post.ts +16 -0
- package/src/interfaces/Api.ts +1 -0
package/dist/api/index.js
CHANGED
|
@@ -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,
|
package/dist/api/order/post.js
CHANGED
|
@@ -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
package/src/api/index.ts
CHANGED
|
@@ -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,
|
package/src/api/order/post.ts
CHANGED
|
@@ -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
|
};
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -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;
|