@hapl/api-queries 0.1.125 → 0.1.127

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/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # v0.1.127 (Wed Feb 09 2022)
2
+
3
+ #### ⚠️ Pushed to `main`
4
+
5
+ - добавил пропузенный period в оценку ([@yeshkarluk](https://github.com/yeshkarluk))
6
+
7
+ #### Authors: 1
8
+
9
+ - Ivan Ignatev ([@yeshkarluk](https://github.com/yeshkarluk))
10
+
11
+ ---
12
+
13
+ # v0.1.126 (Tue Feb 08 2022)
14
+
15
+ #### 🐛 Bug Fix
16
+
17
+ - Добавлены ручки для списка счетов [#56](https://github.com/homeappcorporate/api-queries/pull/56) ([@alexandropavlov](https://github.com/alexandropavlov))
18
+
19
+ #### Authors: 1
20
+
21
+ - Alexander Pavlov ([@alexandropavlov](https://github.com/alexandropavlov))
22
+
23
+ ---
24
+
1
25
  # v0.1.125 (Tue Feb 08 2022)
2
26
 
3
27
  #### 🐛 Bug Fix
@@ -6,6 +6,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
6
6
 
7
7
  var axios = _interopDefault(require('axios'));
8
8
  var qs = _interopDefault(require('qs'));
9
+ var nanoid = require('nanoid');
9
10
  var nonSecure = require('nanoid/non-secure');
10
11
  var chunk = _interopDefault(require('lodash/chunk'));
11
12
 
@@ -194,6 +195,70 @@ function deleteAvailableFundsRequest(_ref) {
194
195
  });
195
196
  }
196
197
 
198
+ function createBillRequest(_ref) {
199
+ var _ref$baseURL = _ref.baseURL,
200
+ baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
201
+ body = _ref.body,
202
+ headers = _ref.headers;
203
+ return axios.post('/api/bill', body, {
204
+ baseURL: baseURL,
205
+ headers: _extends({
206
+ Accept: 'application/json',
207
+ 'Content-Type': 'application/json'
208
+ }, headers),
209
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
210
+ return data.success ? data.data : data.data.error;
211
+ }])
212
+ }).then(function (res) {
213
+ return res;
214
+ })["catch"](function (err) {
215
+ throw err;
216
+ });
217
+ }
218
+
219
+ function findBillsRequest(_ref) {
220
+ var _ref$baseURL = _ref.baseURL,
221
+ baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
222
+ headers = _ref.headers,
223
+ params = _ref.params;
224
+ return axios.get('/api/bill/list', {
225
+ baseURL: baseURL,
226
+ params: params,
227
+ paramsSerializer: function paramsSerializer(params) {
228
+ return qs.stringify(params, {
229
+ arrayFormat: 'brackets'
230
+ });
231
+ },
232
+ headers: _extends({
233
+ Accept: 'application/json'
234
+ }, headers),
235
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
236
+ if (!data.success) return data.data.error || data.data.message;
237
+ var ids = [];
238
+ var byId = {};
239
+ data.data.forEach(function (entity) {
240
+ var _id = nanoid.nanoid();
241
+
242
+ byId[_id] = _extends({}, entity, {
243
+ _id: _id
244
+ });
245
+ ids.push(_id);
246
+ });
247
+ return {
248
+ ids: ids,
249
+ byId: byId,
250
+ meta: {
251
+ total: data.pageParams.length
252
+ }
253
+ };
254
+ }])
255
+ }).then(function (res) {
256
+ return res;
257
+ })["catch"](function (err) {
258
+ throw err;
259
+ });
260
+ }
261
+
197
262
  function countBuyersRequest(_ref) {
198
263
  var _ref$baseURL = _ref.baseURL,
199
264
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
@@ -486,6 +551,45 @@ function declineContractRequest(_ref) {
486
551
  });
487
552
  }
488
553
 
554
+ function findContractsRequest(_ref) {
555
+ var _ref$baseURL = _ref.baseURL,
556
+ baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
557
+ headers = _ref.headers,
558
+ params = _ref.params;
559
+ return axios.get('/api/contract', {
560
+ baseURL: baseURL,
561
+ params: params,
562
+ paramsSerializer: function paramsSerializer(params) {
563
+ return qs.stringify(params, {
564
+ arrayFormat: 'brackets'
565
+ });
566
+ },
567
+ headers: _extends({
568
+ Accept: 'application/json'
569
+ }, headers),
570
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
571
+ if (!data.success) return data.data.error || data.data.message;
572
+ var ids = [];
573
+ var byId = {};
574
+ data.data.forEach(function (entity) {
575
+ byId[entity.id] = entity;
576
+ ids.push(entity.id);
577
+ });
578
+ return {
579
+ ids: ids,
580
+ byId: byId,
581
+ meta: {
582
+ total: data.pageParams.length
583
+ }
584
+ };
585
+ }])
586
+ }).then(function (res) {
587
+ return res;
588
+ })["catch"](function (err) {
589
+ throw err;
590
+ });
591
+ }
592
+
489
593
  function terminateContractRequest(_ref) {
490
594
  var _ref$baseURL = _ref.baseURL,
491
595
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
@@ -1848,6 +1952,20 @@ var AvailableFundsPayerType;
1848
1952
  AvailableFundsPayerType["Expert"] = "expert";
1849
1953
  })(AvailableFundsPayerType || (AvailableFundsPayerType = {}));
1850
1954
 
1955
+ var BillServiceType;
1956
+
1957
+ (function (BillServiceType) {
1958
+ BillServiceType["PartPayment"] = "part_payment";
1959
+ BillServiceType["FullPayment"] = "full_payment";
1960
+ BillServiceType["BuyServicePayment"] = "buy_service_payment";
1961
+ })(BillServiceType || (BillServiceType = {}));
1962
+
1963
+ var BillServiceUnit;
1964
+
1965
+ (function (BillServiceUnit) {
1966
+ BillServiceUnit["Piece"] = "piece";
1967
+ })(BillServiceUnit || (BillServiceUnit = {}));
1968
+
1851
1969
  var BuyerStatus;
1852
1970
 
1853
1971
  (function (BuyerStatus) {
@@ -2535,6 +2653,12 @@ var AvailableFundsDictionary = {
2535
2653
  PayerType: (_PayerType = {}, _PayerType[AvailableFundsPayerType.Common] = 'Общий', _PayerType[AvailableFundsPayerType.Homeapp] = 'Homeapp', _PayerType[AvailableFundsPayerType.SalesHead] = 'РОП', _PayerType[AvailableFundsPayerType.Expert] = 'Эксперт', _PayerType)
2536
2654
  };
2537
2655
 
2656
+ var _ServiceType, _ServiceUnit;
2657
+ var BillDictionary = {
2658
+ ServiceType: (_ServiceType = {}, _ServiceType[BillServiceType.PartPayment] = 'Частичная оплата обеспечительного платежа', _ServiceType[BillServiceType.FullPayment] = 'Окончательный расчет', _ServiceType[BillServiceType.BuyServicePayment] = 'Оплата оказания услуг', _ServiceType),
2659
+ ServiceUnit: (_ServiceUnit = {}, _ServiceUnit[BillServiceUnit.Piece] = 'шт', _ServiceUnit)
2660
+ };
2661
+
2538
2662
  var _BuyerStatus;
2539
2663
  var BuyerDictionary = {
2540
2664
  BuyerStatus: (_BuyerStatus = {}, _BuyerStatus[BuyerStatus.Incoming] = 'Входящее обращение', _BuyerStatus[BuyerStatus.ShowCoordination] = 'Согласование даты показа', _BuyerStatus[BuyerStatus.ShowScheduled] = 'Показ назначен', _BuyerStatus[BuyerStatus.ShowComplete] = 'Показ проведен (ожидание оффера)', _BuyerStatus[BuyerStatus.GotOffer] = 'Оффер получен (согласование)', _BuyerStatus[BuyerStatus.Advance] = 'Аванс', _BuyerStatus[BuyerStatus.Closed] = 'Завершение работы', _BuyerStatus)
@@ -2716,6 +2840,23 @@ var Api = function Api(baseURL) {
2716
2840
  headers: headers,
2717
2841
  baseURL: _this.baseURL
2718
2842
  });
2843
+ }; // bill
2844
+
2845
+
2846
+ this.createBill = function (body, headers) {
2847
+ return createBillRequest({
2848
+ body: body,
2849
+ headers: headers,
2850
+ baseURL: _this.baseURL
2851
+ });
2852
+ };
2853
+
2854
+ this.findBills = function (params, headers) {
2855
+ return findBillsRequest({
2856
+ params: params,
2857
+ headers: headers,
2858
+ baseURL: _this.baseURL
2859
+ });
2719
2860
  }; // buyer
2720
2861
 
2721
2862
 
@@ -2810,6 +2951,14 @@ var Api = function Api(baseURL) {
2810
2951
  });
2811
2952
  };
2812
2953
 
2954
+ this.findContracts = function (params, headers) {
2955
+ return findContractsRequest({
2956
+ params: params,
2957
+ headers: headers,
2958
+ baseURL: _this.baseURL
2959
+ });
2960
+ };
2961
+
2813
2962
  this.terminateContract = function (urlParams, body, headers) {
2814
2963
  return terminateContractRequest({
2815
2964
  urlParams: urlParams,
@@ -3224,6 +3373,8 @@ var index = {
3224
3373
  findAvailableFundsRequest: findAvailableFundsRequest,
3225
3374
  updateAvailableFundsRequest: updateAvailableFundsRequest,
3226
3375
  deleteAvailableFundsRequest: deleteAvailableFundsRequest,
3376
+ createBillRequest: createBillRequest,
3377
+ findBillsRequest: findBillsRequest,
3227
3378
  countBuyersRequest: countBuyersRequest,
3228
3379
  findBuyersRequest: findBuyersRequest,
3229
3380
  findCallsRequest: findCallsRequest,
@@ -3235,6 +3386,7 @@ var index = {
3235
3386
  createCallTaskRequest: createCallTaskRequest,
3236
3387
  approveContractRequest: approveContractRequest,
3237
3388
  declineContractRequest: declineContractRequest,
3389
+ findContractsRequest: findContractsRequest,
3238
3390
  terminateContractRequest: terminateContractRequest,
3239
3391
  createDealCategorizedFileRequest: createDealCategorizedFileRequest,
3240
3392
  createDealInvestPrepaymentRequest: createDealInvestPrepaymentRequest,
@@ -3285,6 +3437,7 @@ var index = {
3285
3437
  findValuationByServiceRequestIdRequest: findValuationByServiceRequestIdRequest,
3286
3438
  AddressBTIParamsDictionary: AddressBTIParamsDictionary,
3287
3439
  AvailableFundsDictionary: AvailableFundsDictionary,
3440
+ BillDictionary: BillDictionary,
3288
3441
  BuyerDictionary: BuyerDictionary,
3289
3442
  CallDictionary: CallDictionary,
3290
3443
  CallTaskDictionary: CallTaskDictionary,
@@ -3310,6 +3463,8 @@ var index = {
3310
3463
  get AvailableFundsPaymentType () { return AvailableFundsPaymentType; },
3311
3464
  get AvailableFundsRealtyType () { return AvailableFundsRealtyType; },
3312
3465
  get AvailableFundsPayerType () { return AvailableFundsPayerType; },
3466
+ get BillServiceType () { return BillServiceType; },
3467
+ get BillServiceUnit () { return BillServiceUnit; },
3313
3468
  get BuyerStatus () { return BuyerStatus; },
3314
3469
  get BuyerRealtyShowStatus () { return BuyerRealtyShowStatus; },
3315
3470
  get CallType () { return CallType; },