washday-sdk 0.0.150 → 0.0.151

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
@@ -102,6 +102,7 @@ const WashdayClient = function WashdayClient(apiToken) {
102
102
  sendEmailReceipt: ordersEndpoints.postModule.sendEmailReceipt,
103
103
  createOrderCustomersApp: ordersEndpoints.postModule.createOrderCustomersApp,
104
104
  createOrderUsersApp: ordersEndpoints.postModule.createOrderUsersApp,
105
+ bulkCreatePaymentLines: ordersEndpoints.postModule.bulkCreatePaymentLines,
105
106
  deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
106
107
  getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
107
108
  getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
@@ -67,3 +67,17 @@ export const createOrderUsersApp = function (data) {
67
67
  }
68
68
  });
69
69
  };
70
+ export const bulkCreatePaymentLines = function (storeId, body) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ try {
73
+ const config = {
74
+ headers: { Authorization: `Bearer ${this.apiToken}` }
75
+ };
76
+ return yield axiosInstance.post(`${GET_SET_ORDER}/${storeId}/bulkPaymentLines`, body, config);
77
+ }
78
+ catch (error) {
79
+ console.error('Error fetching bulkCreatePaymentLines:', error);
80
+ throw error;
81
+ }
82
+ });
83
+ };
@@ -11,3 +11,10 @@ export var BuyAndGetConditionsTypes;
11
11
  BuyAndGetConditionsTypes["PERCENTAGE"] = "percentage";
12
12
  BuyAndGetConditionsTypes["FREE"] = "free";
13
13
  })(BuyAndGetConditionsTypes || (BuyAndGetConditionsTypes = {}));
14
+ export var PaymentMethodsEnum;
15
+ (function (PaymentMethodsEnum) {
16
+ PaymentMethodsEnum["Cash"] = "cash";
17
+ PaymentMethodsEnum["Card"] = "card";
18
+ PaymentMethodsEnum["Delivery"] = "delivery";
19
+ PaymentMethodsEnum["Transfer"] = "transfer";
20
+ })(PaymentMethodsEnum || (PaymentMethodsEnum = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.150",
3
+ "version": "0.0.151",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
package/src/api/index.ts CHANGED
@@ -108,6 +108,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
108
108
  sendEmailReceipt: ordersEndpoints.postModule.sendEmailReceipt,
109
109
  createOrderCustomersApp: ordersEndpoints.postModule.createOrderCustomersApp,
110
110
  createOrderUsersApp: ordersEndpoints.postModule.createOrderUsersApp,
111
+ bulkCreatePaymentLines: ordersEndpoints.postModule.bulkCreatePaymentLines,
111
112
  deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
112
113
  getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
113
114
  getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
@@ -1,3 +1,5 @@
1
+ import { AxiosResponse } from "axios";
2
+ import { PaymentMethodsEnum } from "../../enum";
1
3
  import { WashdayClientInstance } from "../../interfaces/Api";
2
4
  import { OrderDto } from "../../interfaces/Order";
3
5
  import axiosInstance from "../axiosInstance";
@@ -57,4 +59,25 @@ export const createOrderUsersApp = async function (this: WashdayClientInstance,
57
59
  console.error('Error fetching createOrderUsersApp:', error);
58
60
  throw error;
59
61
  }
62
+ };
63
+
64
+ export const bulkCreatePaymentLines = async function (this: WashdayClientInstance, storeId: string, body: {
65
+ paymentLines: {
66
+ sequence: string;
67
+ orderId: string
68
+ paymentMethod: PaymentMethodsEnum;
69
+ amount: number;
70
+ cashierBoxId: string;
71
+ paymentDate: Date;
72
+ }[],
73
+ }): Promise<AxiosResponse<any, any>> {
74
+ try {
75
+ const config = {
76
+ headers: { Authorization: `Bearer ${this.apiToken}` }
77
+ };
78
+ return await axiosInstance.post(`${GET_SET_ORDER}/${storeId}/bulkPaymentLines`, body, config);
79
+ } catch (error) {
80
+ console.error('Error fetching bulkCreatePaymentLines:', error);
81
+ throw error;
82
+ }
60
83
  };
package/src/enum/index.ts CHANGED
@@ -9,4 +9,11 @@ export enum DiscountCodeTypes {
9
9
  export enum BuyAndGetConditionsTypes {
10
10
  PERCENTAGE = 'percentage',
11
11
  FREE = 'free'
12
+ }
13
+
14
+ export enum PaymentMethodsEnum {
15
+ Cash = "cash",
16
+ Card = "card",
17
+ Delivery = "delivery",
18
+ Transfer = "transfer",
12
19
  }
@@ -94,6 +94,7 @@ export interface WashdayClientInstance {
94
94
  createPaymentLine: typeof ordersEndpoints.postModule.createPaymentLine;
95
95
  createOrderCustomersApp: typeof ordersEndpoints.postModule.createOrderCustomersApp,
96
96
  createOrderUsersApp: typeof ordersEndpoints.postModule.createOrderUsersApp,
97
+ bulkCreatePaymentLines: typeof ordersEndpoints.postModule.bulkCreatePaymentLines,
97
98
  deletePaymentLineById: typeof ordersEndpoints.deleteModule.deletePaymentLineById;
98
99
  getListCustomersApp: typeof ordersEndpoints.getModule.getListCustomersApp;
99
100
  getByIdCustomersApp: typeof ordersEndpoints.getModule.getByIdCustomersApp;