btrz-api-client 5.194.0 → 5.196.0

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.
@@ -362,6 +362,18 @@ function shiftsFactory(_ref) {
362
362
  });
363
363
  }
364
364
  };
365
+ var commissions = {
366
+ get: function get(_ref28) {
367
+ var token = _ref28.token,
368
+ jwtToken = _ref28.jwtToken,
369
+ shiftId = _ref28.shiftId,
370
+ headers = _ref28.headers;
371
+
372
+ return client.get("/shifts/" + shiftId + "/commissions", {
373
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
374
+ });
375
+ }
376
+ };
365
377
 
366
378
  return {
367
379
  all: all,
@@ -384,7 +396,8 @@ function shiftsFactory(_ref) {
384
396
  locationClosures: locationClosures,
385
397
  startingBalances: startingBalances,
386
398
  purchaseLimitPayments: purchaseLimitPayments,
387
- salesSummary: salesSummary
399
+ salesSummary: salesSummary,
400
+ commissions: commissions
388
401
  };
389
402
  }
390
403
 
@@ -161,6 +161,37 @@ function cartFactory(_ref) {
161
161
  }
162
162
  };
163
163
 
164
+ var financingCosts = {
165
+ create: function create(_ref12) {
166
+ var token = _ref12.token,
167
+ jwtToken = _ref12.jwtToken,
168
+ headers = _ref12.headers,
169
+ cartId = _ref12.cartId,
170
+ financingCost = _ref12.financingCost;
171
+
172
+ return client({
173
+ url: "/carts/" + cartId + "/financing-costs",
174
+ method: "POST",
175
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
176
+ data: {
177
+ financingcost: financingCost
178
+ }
179
+ });
180
+ },
181
+ delete: function _delete(_ref13) {
182
+ var token = _ref13.token,
183
+ jwtToken = _ref13.jwtToken,
184
+ headers = _ref13.headers,
185
+ cartId = _ref13.cartId;
186
+
187
+ return client({
188
+ url: "/carts/" + cartId + "/financing-costs",
189
+ method: "delete",
190
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
191
+ });
192
+ }
193
+ };
194
+
164
195
  return {
165
196
  get: get,
166
197
  create: create,
@@ -170,7 +201,8 @@ function cartFactory(_ref) {
170
201
  patch: patch,
171
202
  partialDepositStatus: partialDepositStatus,
172
203
  payments: payments,
173
- taxExemptPaymentMethod: taxExemptPaymentMethod
204
+ taxExemptPaymentMethod: taxExemptPaymentMethod,
205
+ financingCosts: financingCosts
174
206
  };
175
207
  }
176
208
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btrz-api-client",
3
- "version": "5.194.0",
3
+ "version": "5.196.0",
4
4
  "description": "Api client for Betterez endpoints",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -218,6 +218,13 @@ function shiftsFactory({client, internalAuthTokenProvider}) {
218
218
  });
219
219
  }
220
220
  };
221
+ const commissions = {
222
+ get({token, jwtToken, shiftId, headers}) {
223
+ return client.get(`/shifts/${shiftId}/commissions`, {
224
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
225
+ });
226
+ }
227
+ };
221
228
 
222
229
  return {
223
230
  all,
@@ -240,7 +247,8 @@ function shiftsFactory({client, internalAuthTokenProvider}) {
240
247
  locationClosures,
241
248
  startingBalances,
242
249
  purchaseLimitPayments,
243
- salesSummary
250
+ salesSummary,
251
+ commissions
244
252
  };
245
253
  }
246
254
 
@@ -98,6 +98,26 @@ function cartFactory({client, internalAuthTokenProvider}) {
98
98
  }
99
99
  };
100
100
 
101
+ const financingCosts = {
102
+ create({token, jwtToken, headers, cartId, financingCost}) {
103
+ return client({
104
+ url: `/carts/${cartId}/financing-costs`,
105
+ method: "POST",
106
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
107
+ data: {
108
+ financingcost: financingCost
109
+ }
110
+ });
111
+ },
112
+ delete({token, jwtToken, headers, cartId}) {
113
+ return client({
114
+ url: `/carts/${cartId}/financing-costs`,
115
+ method: "delete",
116
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
117
+ });
118
+ }
119
+ };
120
+
101
121
  return {
102
122
  get,
103
123
  create,
@@ -107,7 +127,8 @@ function cartFactory({client, internalAuthTokenProvider}) {
107
127
  patch,
108
128
  partialDepositStatus,
109
129
  payments,
110
- taxExemptPaymentMethod
130
+ taxExemptPaymentMethod,
131
+ financingCosts
111
132
  };
112
133
  }
113
134
 
@@ -197,5 +197,12 @@ describe("accounts/shifts", () => {
197
197
  axiosMock.onGet(`/shifts/${shiftId}/sales-summary`).reply(expectRequest({statusCode: 200, token, query}));
198
198
  return api.accounts.shifts.salesSummary.get({token, jwtToken, shiftId, query});
199
199
  });
200
+
201
+ it("should get the shift commissions", () => {
202
+ const shiftId = "shiftId1";
203
+ axiosMock.onGet(`/shifts/${shiftId}/commissions`).reply(expectRequest({statusCode: 200, token}));
204
+ return api.accounts.shifts.commissions.get({token, jwtToken, shiftId});
205
+ });
206
+
200
207
  });
201
208
 
@@ -81,4 +81,17 @@ describe("sales/cart", () => {
81
81
  axiosMock.onPost(`/carts/${cartId}/tax-exempt-payment-method`).reply(expectRequest({statusCode: 200, token, jwtToken}));
82
82
  return api.sales.cart.taxExemptPaymentMethod.post({jwtToken, token, cartId});
83
83
  });
84
+
85
+ it("should delete payments from a cart", () => {
86
+ const cartId = "someCartId";
87
+ axiosMock.onDelete(`/carts/${cartId}/financing-costs`).reply(expectRequest({statusCode: 200, token, jwtToken}));
88
+ return api.sales.cart.financingCosts.delete({jwtToken, token, cartId});
89
+ });
90
+
91
+ it("should update payments from a cart", () => {
92
+ const cartId = "someCartId";
93
+ const financingCost = {_id: "123"};
94
+ axiosMock.onPost(`/carts/${cartId}/financing-costs`).reply(expectRequest({statusCode: 204, token, jwtToken}));
95
+ return api.sales.cart.financingCosts.create({jwtToken, token, cartId, financingCost});
96
+ });
84
97
  });
package/types/client.d.ts CHANGED
@@ -2474,6 +2474,14 @@ export function createApiClient(options: {
2474
2474
  headers: any;
2475
2475
  }): any;
2476
2476
  };
2477
+ commissions: {
2478
+ get({ token, jwtToken, shiftId, headers }: {
2479
+ token: any;
2480
+ jwtToken: any;
2481
+ shiftId: any;
2482
+ headers: any;
2483
+ }): any;
2484
+ };
2477
2485
  };
2478
2486
  shiftSettings: {
2479
2487
  get: ({ token, jwtToken, query, headers }: {
@@ -2775,6 +2783,21 @@ export function createApiClient(options: {
2775
2783
  data?: {};
2776
2784
  }): any;
2777
2785
  };
2786
+ financingCosts: {
2787
+ create({ token, jwtToken, headers, cartId, financingCost }: {
2788
+ token: any;
2789
+ jwtToken: any;
2790
+ headers: any;
2791
+ cartId: any;
2792
+ financingCost: any;
2793
+ }): any;
2794
+ delete({ token, jwtToken, headers, cartId }: {
2795
+ token: any;
2796
+ jwtToken: any;
2797
+ headers: any;
2798
+ cartId: any;
2799
+ }): any;
2800
+ };
2778
2801
  };
2779
2802
  giftCertificates: {
2780
2803
  get: ({ token, GCNumber, query, headers }: {
@@ -202,4 +202,12 @@ declare function shiftsFactory({ client, internalAuthTokenProvider }: {
202
202
  headers: any;
203
203
  }): any;
204
204
  };
205
+ commissions: {
206
+ get({ token, jwtToken, shiftId, headers }: {
207
+ token: any;
208
+ jwtToken: any;
209
+ shiftId: any;
210
+ headers: any;
211
+ }): any;
212
+ };
205
213
  };
@@ -77,4 +77,19 @@ declare function cartFactory({ client, internalAuthTokenProvider }: {
77
77
  data?: {};
78
78
  }): any;
79
79
  };
80
+ financingCosts: {
81
+ create({ token, jwtToken, headers, cartId, financingCost }: {
82
+ token: any;
83
+ jwtToken: any;
84
+ headers: any;
85
+ cartId: any;
86
+ financingCost: any;
87
+ }): any;
88
+ delete({ token, jwtToken, headers, cartId }: {
89
+ token: any;
90
+ jwtToken: any;
91
+ headers: any;
92
+ cartId: any;
93
+ }): any;
94
+ };
80
95
  };
@@ -2428,6 +2428,14 @@ declare const _exports: {
2428
2428
  headers: any;
2429
2429
  }): any;
2430
2430
  };
2431
+ commissions: {
2432
+ get({ token, jwtToken, shiftId, headers }: {
2433
+ token: any;
2434
+ jwtToken: any;
2435
+ shiftId: any;
2436
+ headers: any;
2437
+ }): any;
2438
+ };
2431
2439
  };
2432
2440
  shiftSettings: {
2433
2441
  get: ({ token, jwtToken, query, headers }: {
@@ -2729,6 +2737,21 @@ declare const _exports: {
2729
2737
  data?: {};
2730
2738
  }): any;
2731
2739
  };
2740
+ financingCosts: {
2741
+ create({ token, jwtToken, headers, cartId, financingCost }: {
2742
+ token: any;
2743
+ jwtToken: any;
2744
+ headers: any;
2745
+ cartId: any;
2746
+ financingCost: any;
2747
+ }): any;
2748
+ delete({ token, jwtToken, headers, cartId }: {
2749
+ token: any;
2750
+ jwtToken: any;
2751
+ headers: any;
2752
+ cartId: any;
2753
+ }): any;
2754
+ };
2732
2755
  };
2733
2756
  giftCertificates: {
2734
2757
  get: ({ token, GCNumber, query, headers }: {