@hapl/api-queries 0.1.94 → 0.1.97--canary.32.ebc55fb.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.
@@ -23,6 +23,7 @@ export declare type UpdateAvailableFundsBody = {
23
23
  incomeType?: AvailableFundsIncomeType;
24
24
  paymentType?: AvailableFundsPaymentType | AvailableFundsCostType;
25
25
  realtyType?: AvailableFundsRealtyType;
26
+ receivedAt?: string;
26
27
  payerType?: AvailableFundsPayerType;
27
28
  comment?: string;
28
29
  };
@@ -29,6 +29,7 @@ export * from './serviceRequest/extendServiceRequestByRealty';
29
29
  export * from './serviceRequest/findServiceRequestById';
30
30
  export * from './serviceRequest/findServiceRequestDuplicates';
31
31
  export * from './serviceRequest/findServiceRequests';
32
+ export * from './serviceRequest/findServiceRequestShortInfoById';
32
33
  export * from './serviceRequest/findServiceRequestCategorizedFiles';
33
34
  export * from './serviceRequest/sendServiceRequestToModeration';
34
35
  export * from './serviceRequest/startServiceRequestModeration';
@@ -1,12 +1,16 @@
1
1
  import { AxiosResponse, AxiosError } from 'axios';
2
2
  import { ServiceRequest } from '../../../types';
3
+ declare type SuccessData = {
4
+ success: true;
5
+ data: ServiceRequest;
6
+ };
3
7
  declare type ErrorData = {
4
8
  success: false;
5
9
  data: {
6
10
  error: string;
7
11
  };
8
12
  };
9
- declare type ResultData = ServiceRequest;
13
+ declare type ResultData = SuccessData['data'];
10
14
  declare type ResultError = ErrorData['data']['error'];
11
15
  export declare type FindServiceRequestByIdUrlParams = {
12
16
  id: number;
@@ -0,0 +1,34 @@
1
+ import { AxiosResponse, AxiosError } from 'axios';
2
+ import { ServiceRequest, Realty, User } from '../../../types';
3
+ declare type SuccessData = {
4
+ success: true;
5
+ data: Pick<ServiceRequest, 'curator' | 'publicationTestPeriodDays' | 'realtyExtId'> & {
6
+ realty?: Pick<Realty, 'price' | 'roomsNumber' | 'floorsNumber' | 'area' | 'realtyType'>;
7
+ user?: Pick<User, 'firstName'> & {
8
+ phonePostfix: string;
9
+ };
10
+ };
11
+ };
12
+ declare type ErrorData = {
13
+ success: false;
14
+ data: {
15
+ error: string;
16
+ };
17
+ };
18
+ declare type ResultData = SuccessData['data'];
19
+ declare type ResultError = ErrorData['data']['error'];
20
+ export declare type FindServiceRequestShortInfoByIdUrlParams = {
21
+ id: number;
22
+ };
23
+ export declare type FindServiceRequestShortInfoByIdHeaders = {
24
+ 'x-auth-hc': string;
25
+ };
26
+ export declare type FindServiceRequestShortInfoByIdData = AxiosResponse<ResultData>;
27
+ export declare type FindServiceRequestShortInfoByIdError = AxiosError<ResultError>;
28
+ export declare type FindServiceRequestShortInfoByIdConfig = {
29
+ baseURL?: string;
30
+ urlParams: FindServiceRequestShortInfoByIdUrlParams;
31
+ headers: FindServiceRequestShortInfoByIdHeaders;
32
+ };
33
+ export declare function findServiceRequestShortInfoByIdRequest({ baseURL, urlParams, headers, }: FindServiceRequestShortInfoByIdConfig): Promise<FindServiceRequestShortInfoByIdData>;
34
+ export {};
@@ -1,4 +1,4 @@
1
- import { AvailableFundsIncomeType, AvailableFundsCostType, AvailableFundsPaymentType, AvailableFundsRealtyType, AvailableFundsPayerType, AvailableFundsCommonPaymentType } from '../types';
1
+ import { AvailableFundsIncomeType, AvailableFundsCostType, AvailableFundsPaymentType, AvailableFundsRealtyType, AvailableFundsPayerType } from '../types';
2
2
  export declare const AvailableFundsDictionary: {
3
3
  IncomeType: {
4
4
  cashbox: string;
@@ -19,25 +19,6 @@ export declare const AvailableFundsDictionary: {
19
19
  realty_legal_check: string;
20
20
  safe_deposit_box: string;
21
21
  };
22
- CommonPaymentType: {
23
- advance_payment_under_the_advance_agreement: string;
24
- bill_of_credit: string;
25
- bonus_payment_to_mentor: string;
26
- bonus_payment_to_teamlead: string;
27
- bonus_to_trainee: string;
28
- bonus_to_expert: string;
29
- charging_bank_account: string;
30
- closing_deal: string;
31
- legal_support_payment: string;
32
- letter_of_guarantee: string;
33
- other_payments: string;
34
- partner_charges: string;
35
- prepayment: string;
36
- realty_legal_check: string;
37
- refund_of_advance: string;
38
- safe_deposit_box: string;
39
- security_payment: string;
40
- };
41
22
  PaymentType: {
42
23
  advance_payment_under_the_advance_agreement: string;
43
24
  closing_deal: string;
@@ -33,6 +33,7 @@ export declare class Api {
33
33
  findServiceRequestById: (urlParams: api.FindServiceRequestByIdUrlParams, headers: api.FindServiceRequestByIdHeaders) => Promise<api.FindServiceRequestByIdData>;
34
34
  findServiceRequestDuplicates: (body: api.FindServiceRequestDuplicatesBody, headers: api.FindServiceRequestDuplicatesHeaders) => Promise<api.FindServiceRequestDuplicatesData>;
35
35
  findServiceRequests: (params: api.FindServiceRequestsParams, headers: api.FindServiceRequestsHeaders) => Promise<api.FindServiceRequestsData>;
36
+ findServiceRequestShortInfoById: (urlParams: api.FindServiceRequestShortInfoByIdUrlParams, headers: api.FindServiceRequestShortInfoByIdHeaders) => Promise<api.FindServiceRequestShortInfoByIdData>;
36
37
  findServiceRequestCategorizedFiles: (urlParams: api.FindServiceRequestCategorizedFilesUrlParams, params: api.FindServiceRequestCategorizedFilesParams, headers: api.FindServiceRequestCategorizedFilesHeaders) => Promise<api.FindServiceRequestCategorizedFilesData>;
37
38
  sendServiceRequestToModeration: (urlParams: api.SendServiceRequestToModerationUrlParams, headers: api.SendServiceRequestToModerationHeaders) => Promise<api.SendServiceRequestToModerationData>;
38
39
  startServiceRequestModeration: (urlParams: api.StartServiceRequestModerationUrlParams, headers: api.StartServiceRequestModerationHeaders) => Promise<api.StartServiceRequestModerationData>;
@@ -6,25 +6,6 @@ export declare enum AvailableFundsIncomeType {
6
6
  CheckingAccount = "checking_account",
7
7
  Other = "other"
8
8
  }
9
- export declare enum AvailableFundsCommonPaymentType {
10
- AdvancePaymentUnderTheAdvanceAgreement = "advance_payment_under_the_advance_agreement",
11
- BillOfCredit = "bill_of_credit",
12
- BonusPaymentToMentor = "bonus_payment_to_mentor",
13
- BonusPaymentToTeamlead = "bonus_payment_to_teamlead",
14
- BonusToExpert = "bonus_to_expert",
15
- BonusToTrainee = "bonus_to_trainee",
16
- ChargingBankAccount = "charging_bank_account",
17
- ClosingDeal = "closing_deal",
18
- LegalSupportPayment = "legal_support_payment",
19
- LetterOfGuarantee = "letter_of_guarantee",
20
- OtherPayments = "other_payments",
21
- PartnerCharges = "partner_charges",
22
- Prepayment = "prepayment",
23
- RealtyLegalCheck = "realty_legal_check",
24
- RefundOfAdvance = "refund_of_advance",
25
- SafeDepositBox = "safe_deposit_box",
26
- SecurityPayment = "security_payment"
27
- }
28
9
  export declare enum AvailableFundsCostType {
29
10
  BillOfCredit = "bill_of_credit",
30
11
  BonusPaymentToMentor = "bonus_payment_to_mentor",
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.94",
2
+ "version": "0.1.97--canary.32.ebc55fb.0",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -22,6 +22,7 @@ export type UpdateAvailableFundsBody = {
22
22
  incomeType?: AvailableFundsIncomeType;
23
23
  paymentType?: AvailableFundsPaymentType | AvailableFundsCostType;
24
24
  realtyType?: AvailableFundsRealtyType;
25
+ receivedAt?: string;
25
26
  payerType?: AvailableFundsPayerType;
26
27
  comment?: string;
27
28
  };
@@ -35,6 +35,7 @@ export * from './serviceRequest/extendServiceRequestByRealty';
35
35
  export * from './serviceRequest/findServiceRequestById';
36
36
  export * from './serviceRequest/findServiceRequestDuplicates';
37
37
  export * from './serviceRequest/findServiceRequests';
38
+ export * from './serviceRequest/findServiceRequestShortInfoById';
38
39
  export * from './serviceRequest/findServiceRequestCategorizedFiles';
39
40
  export * from './serviceRequest/sendServiceRequestToModeration';
40
41
  export * from './serviceRequest/startServiceRequestModeration';
@@ -4,7 +4,7 @@ import { ServiceRequest } from '../../../types';
4
4
  type SuccessData = { success: true; data: ServiceRequest };
5
5
  type ErrorData = { success: false; data: { error: string } };
6
6
 
7
- type ResultData = ServiceRequest;
7
+ type ResultData = SuccessData['data'];
8
8
  type ResultError = ErrorData['data']['error'];
9
9
 
10
10
  export type FindServiceRequestByIdUrlParams = { id: number };
@@ -26,7 +26,7 @@ export function findServiceRequestByIdRequest({
26
26
  return axios
27
27
  .get(`/api/service-request/${urlParams.id}`, {
28
28
  baseURL,
29
- headers: { Accept: 'application/json', 'Content-Type': 'application/json', ...headers },
29
+ headers: { Accept: 'application/json', ...headers },
30
30
  transformResponse: [
31
31
  ...(axios.defaults.transformResponse as AxiosTransformer[]),
32
32
  (data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
@@ -0,0 +1,45 @@
1
+ import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
2
+ import { ServiceRequest, Realty, User } from '../../../types';
3
+
4
+ type SuccessData = {
5
+ success: true;
6
+ data: Pick<ServiceRequest, 'curator' | 'publicationTestPeriodDays' | 'realtyExtId'> & {
7
+ realty?: Pick<Realty, 'price' | 'roomsNumber' | 'floorsNumber' | 'area' | 'realtyType'>;
8
+ user?: Pick<User, 'firstName'> & { phonePostfix: string };
9
+ };
10
+ };
11
+ type ErrorData = { success: false; data: { error: string } };
12
+
13
+ type ResultData = SuccessData['data'];
14
+ type ResultError = ErrorData['data']['error'];
15
+
16
+ export type FindServiceRequestShortInfoByIdUrlParams = { id: number };
17
+ export type FindServiceRequestShortInfoByIdHeaders = { 'x-auth-hc': string };
18
+ export type FindServiceRequestShortInfoByIdData = AxiosResponse<ResultData>;
19
+ export type FindServiceRequestShortInfoByIdError = AxiosError<ResultError>;
20
+
21
+ export type FindServiceRequestShortInfoByIdConfig = {
22
+ baseURL?: string;
23
+ urlParams: FindServiceRequestShortInfoByIdUrlParams;
24
+ headers: FindServiceRequestShortInfoByIdHeaders;
25
+ };
26
+
27
+ export function findServiceRequestShortInfoByIdRequest({
28
+ baseURL = 'https://clients.homeapp.ru',
29
+ urlParams,
30
+ headers,
31
+ }: FindServiceRequestShortInfoByIdConfig) {
32
+ return axios
33
+ .get(`/api/service-request/short/${urlParams.id}`, {
34
+ baseURL,
35
+ headers: { Accept: 'application/json', ...headers },
36
+ transformResponse: [
37
+ ...(axios.defaults.transformResponse as AxiosTransformer[]),
38
+ (data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
39
+ ],
40
+ })
41
+ .then((res: FindServiceRequestShortInfoByIdData) => res)
42
+ .catch((err: FindServiceRequestShortInfoByIdError) => {
43
+ throw err;
44
+ });
45
+ }
@@ -4,7 +4,6 @@ import {
4
4
  AvailableFundsPaymentType,
5
5
  AvailableFundsRealtyType,
6
6
  AvailableFundsPayerType,
7
- AvailableFundsCommonPaymentType,
8
7
  } from '../types';
9
8
 
10
9
  export const AvailableFundsDictionary = {
@@ -27,25 +26,6 @@ export const AvailableFundsDictionary = {
27
26
  [AvailableFundsCostType.RealtyLegalCheck]: 'Проверка объектов',
28
27
  [AvailableFundsCostType.SafeDepositBox]: 'Оплата банковской ячейки',
29
28
  },
30
- CommonPaymentType: {
31
- [AvailableFundsCommonPaymentType.AdvancePaymentUnderTheAdvanceAgreement]: 'Аванс по соглашению об авансе',
32
- [AvailableFundsCommonPaymentType.BillOfCredit]: 'Оплата аккредитива',
33
- [AvailableFundsCommonPaymentType.BonusPaymentToMentor]: 'Выплата бонуса наставнику',
34
- [AvailableFundsCommonPaymentType.BonusPaymentToTeamlead]: 'Выплата бонуса РОПу',
35
- [AvailableFundsCommonPaymentType.BonusToTrainee]: 'Выплата бонуса стажеру',
36
- [AvailableFundsCommonPaymentType.BonusToExpert]: 'Выплата бонуса эксперту',
37
- [AvailableFundsCommonPaymentType.ChargingBankAccount]: 'Внесение на р/с',
38
- [AvailableFundsCommonPaymentType.ClosingDeal]: 'Закрытие сделки',
39
- [AvailableFundsCommonPaymentType.LegalSupportPayment]: 'Внесение за альтернативный объект',
40
- [AvailableFundsCommonPaymentType.LetterOfGuarantee]: 'Гарантийное письмо',
41
- [AvailableFundsCommonPaymentType.OtherPayments]: 'Прочие расходы',
42
- [AvailableFundsCommonPaymentType.PartnerCharges]: 'Партнерские расходы',
43
- [AvailableFundsCommonPaymentType.Prepayment]: 'Предоплата',
44
- [AvailableFundsCommonPaymentType.RealtyLegalCheck]: 'Проверка объектов',
45
- [AvailableFundsCommonPaymentType.RefundOfAdvance]: 'Возврат аванса',
46
- [AvailableFundsCommonPaymentType.SafeDepositBox]: 'Оплата банковской ячейки',
47
- [AvailableFundsCommonPaymentType.SecurityPayment]: 'Обеспечительный платеж',
48
- },
49
29
  PaymentType: {
50
30
  [AvailableFundsPaymentType.AdvancePaymentUnderTheAdvanceAgreement]: 'Аванс по соглашению об авансе',
51
31
  [AvailableFundsPaymentType.ClosingDeal]: 'Закрытие сделки',
@@ -185,6 +185,13 @@ export class Api {
185
185
  return api.findServiceRequestsRequest({ params, headers, baseURL: this.baseURL });
186
186
  };
187
187
 
188
+ findServiceRequestShortInfoById = (
189
+ urlParams: api.FindServiceRequestShortInfoByIdUrlParams,
190
+ headers: api.FindServiceRequestShortInfoByIdHeaders
191
+ ) => {
192
+ return api.findServiceRequestShortInfoByIdRequest({ urlParams, headers, baseURL: this.baseURL });
193
+ };
194
+
188
195
  findServiceRequestCategorizedFiles = (
189
196
  urlParams: api.FindServiceRequestCategorizedFilesUrlParams,
190
197
  params: api.FindServiceRequestCategorizedFilesParams,
@@ -8,26 +8,6 @@ export enum AvailableFundsIncomeType {
8
8
  Other = 'other',
9
9
  }
10
10
 
11
- export enum AvailableFundsCommonPaymentType {
12
- AdvancePaymentUnderTheAdvanceAgreement = 'advance_payment_under_the_advance_agreement',
13
- BillOfCredit = 'bill_of_credit',
14
- BonusPaymentToMentor = 'bonus_payment_to_mentor',
15
- BonusPaymentToTeamlead = 'bonus_payment_to_teamlead',
16
- BonusToExpert = 'bonus_to_expert',
17
- BonusToTrainee = 'bonus_to_trainee',
18
- ChargingBankAccount = 'charging_bank_account',
19
- ClosingDeal = 'closing_deal',
20
- LegalSupportPayment = 'legal_support_payment',
21
- LetterOfGuarantee = 'letter_of_guarantee',
22
- OtherPayments = 'other_payments',
23
- PartnerCharges = 'partner_charges',
24
- Prepayment = 'prepayment',
25
- RealtyLegalCheck = 'realty_legal_check',
26
- RefundOfAdvance = 'refund_of_advance',
27
- SafeDepositBox = 'safe_deposit_box',
28
- SecurityPayment = 'security_payment',
29
- }
30
-
31
11
  export enum AvailableFundsCostType {
32
12
  BillOfCredit = 'bill_of_credit',
33
13
  BonusPaymentToMentor = 'bonus_payment_to_mentor',