@hapl/api-queries 0.1.103 → 0.1.104
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 +12 -0
- package/dist/api-queries.cjs.development.js +43 -2
- package/dist/api-queries.cjs.development.js.map +1 -1
- package/dist/api-queries.cjs.production.min.js +1 -1
- package/dist/api-queries.cjs.production.min.js.map +1 -1
- package/dist/api-queries.esm.js +43 -2
- package/dist/api-queries.esm.js.map +1 -1
- package/dist/clients/v1/api/deal/createDealInvestPrepayment/index.d.ts +36 -0
- package/dist/clients/v1/api/index.d.ts +1 -0
- package/dist/clients/v1/dictionaries/DealCategorizedFile.d.ts +1 -0
- package/dist/clients/v1/dictionaries/ServiceRequest.d.ts +5 -1
- package/dist/clients/v1/index.d.ts +1 -0
- package/dist/clients/v1/types/Deal.d.ts +9 -0
- package/dist/clients/v1/types/DealCategorizedFile.d.ts +1 -0
- package/dist/clients/v1/types/ServiceRequest.d.ts +6 -0
- package/package.json +1 -1
- package/src/clients/v1/api/deal/createDealInvestPrepayment/index.ts +41 -0
- package/src/clients/v1/api/index.ts +1 -0
- package/src/clients/v1/dictionaries/DealCategorizedFile.ts +1 -0
- package/src/clients/v1/dictionaries/ServiceRequest.ts +5 -0
- package/src/clients/v1/index.ts +8 -0
- package/src/clients/v1/types/Deal.ts +7 -0
- package/src/clients/v1/types/DealCategorizedFile.ts +1 -0
- package/src/clients/v1/types/ServiceRequest.ts +7 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AxiosResponse, AxiosError } from 'axios';
|
|
2
|
+
import { Deal } from '../../../types';
|
|
3
|
+
declare type SuccessData = {
|
|
4
|
+
success: true;
|
|
5
|
+
data: Partial<Deal> & {
|
|
6
|
+
id: number;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
declare type ErrorData = {
|
|
10
|
+
success: false;
|
|
11
|
+
data: {
|
|
12
|
+
error: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
declare type ResultData = SuccessData['data'];
|
|
16
|
+
declare type ResultError = ErrorData['data']['error'];
|
|
17
|
+
export declare type CreateDealInvestPrepaymentHeaders = {
|
|
18
|
+
'x-auth-hc': string;
|
|
19
|
+
};
|
|
20
|
+
export declare type CreateDealInvestPrepaymentUrlParams = {
|
|
21
|
+
id: number;
|
|
22
|
+
};
|
|
23
|
+
export declare type CreateDealInvestPrepaymentBody = {
|
|
24
|
+
investBuyoutPrepaymentSum: number;
|
|
25
|
+
investBuyoutPrepaymentAt: string;
|
|
26
|
+
};
|
|
27
|
+
export declare type CreateDealInvestPrepaymentData = AxiosResponse<ResultData>;
|
|
28
|
+
export declare type CreateDealInvestPrepaymentError = AxiosError<ResultError>;
|
|
29
|
+
export declare type CreateDealInvestPrepaymentConfig = {
|
|
30
|
+
baseURL?: string;
|
|
31
|
+
urlParams: CreateDealInvestPrepaymentUrlParams;
|
|
32
|
+
headers: CreateDealInvestPrepaymentHeaders;
|
|
33
|
+
body: CreateDealInvestPrepaymentBody;
|
|
34
|
+
};
|
|
35
|
+
export declare function createDealInvestPrepaymentRequest({ baseURL, urlParams, headers, body, }: CreateDealInvestPrepaymentConfig): Promise<CreateDealInvestPrepaymentData>;
|
|
36
|
+
export {};
|
|
@@ -13,6 +13,7 @@ export * from './callCenter/startOperatorWork';
|
|
|
13
13
|
export * from './contract/approveContract';
|
|
14
14
|
export * from './contract/declineContract';
|
|
15
15
|
export * from './deal/createDealCategorizedFile';
|
|
16
|
+
export * from './deal/createDealInvestPrepayment';
|
|
16
17
|
export * from './deal/deleteDealCategorizedFile';
|
|
17
18
|
export * from './deal/findDealCategorizedFiles';
|
|
18
19
|
export * from './experts/findExperts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ServiceRequestCategory, ServiceRequestModerationStatus, ServiceRequestStatus, ServiceRequestType, ServiceRequestDepublishReason, ServiceRequestSource } from '../types';
|
|
1
|
+
import { ServiceRequestCategory, ServiceRequestModerationStatus, ServiceRequestStatus, ServiceRequestType, ServiceRequestDepublishReason, ServiceRequestSource, ServiceRequestInvestType } from '../types';
|
|
2
2
|
export declare const ServiceRequestDictionary: {
|
|
3
3
|
Category: {
|
|
4
4
|
depublished: string;
|
|
@@ -33,6 +33,10 @@ export declare const ServiceRequestDictionary: {
|
|
|
33
33
|
buy: string;
|
|
34
34
|
sell: string;
|
|
35
35
|
};
|
|
36
|
+
InvestType: {
|
|
37
|
+
buyout: string;
|
|
38
|
+
sell: string;
|
|
39
|
+
};
|
|
36
40
|
DepublishReason: {
|
|
37
41
|
temporary_depublish: string;
|
|
38
42
|
depublish_on_advance: string;
|
|
@@ -17,6 +17,7 @@ export declare class Api {
|
|
|
17
17
|
approveContract: (urlParams: api.ApproveContractUrlParams, body: api.ApproveContractBody, headers: api.ApproveContractHeaders) => Promise<api.ApproveContractData>;
|
|
18
18
|
declineContract: (urlParams: api.DeclineContractUrlParams, body: api.DeclineContractBody, headers: api.DeclineContractHeaders) => Promise<api.DeclineContractData>;
|
|
19
19
|
createDealCategorizedFile: (urlParams: api.CreateDealCategorizedFileUrlParams, body: api.CreateDealCategorizedFileBody, headers: api.CreateDealCategorizedFileHeaders) => Promise<api.CreateDealCategorizedFileData>;
|
|
20
|
+
createDealInvestPrepayment: (urlParams: api.CreateDealInvestPrepaymentUrlParams, body: api.CreateDealInvestPrepaymentBody, headers: api.CreateDealInvestPrepaymentHeaders) => Promise<api.CreateDealInvestPrepaymentData>;
|
|
20
21
|
findDealCategorizedFiles: (urlParams: api.FindDealCategorizedFilesUrlParams, params: api.FindDealCategorizedFilesParams, headers: api.FindDealCategorizedFilesHeaders) => Promise<api.FindDealCategorizedFilesData>;
|
|
21
22
|
deleteDealCategorizedFile: (urlParams: api.DeleteDealCategorizedFileUrlParams, headers: api.DeleteDealCategorizedFileHeaders) => Promise<api.DeleteDealCategorizedFileData>;
|
|
22
23
|
findExperts: (params: api.FindExpertsParams) => Promise<api.FindExpertsData>;
|
|
@@ -37,9 +37,13 @@ export declare type Deal = {
|
|
|
37
37
|
buyer: Partial<Buyer> & Required<Pick<Buyer, 'id'>>;
|
|
38
38
|
incomes: Array<Partial<Income> & Required<Pick<Income, 'id'>>>;
|
|
39
39
|
participants: Array<Partial<DealParticipant> & Required<Pick<DealParticipant, 'id'>>>;
|
|
40
|
+
investSellServiceRequestId?: number;
|
|
40
41
|
comment?: string;
|
|
41
42
|
lawyer?: Partial<User> & Required<Pick<User, 'id'>>;
|
|
42
43
|
files?: Array<Partial<File> & Required<Pick<File, 'id'>>>;
|
|
44
|
+
filesInDeal?: {
|
|
45
|
+
id: number;
|
|
46
|
+
};
|
|
43
47
|
updatedAt?: string;
|
|
44
48
|
dealSignPlannedAt?: string;
|
|
45
49
|
commissionPlannedAt?: string;
|
|
@@ -49,4 +53,9 @@ export declare type Deal = {
|
|
|
49
53
|
dealSingedAt?: string;
|
|
50
54
|
dealDoneAt?: string;
|
|
51
55
|
terminatedAt?: string;
|
|
56
|
+
invest?: {
|
|
57
|
+
isInvestBuyout?: boolean;
|
|
58
|
+
investBuyoutPrepaymentSum?: number;
|
|
59
|
+
investBuyoutPrepaymentAt?: string;
|
|
60
|
+
};
|
|
52
61
|
};
|
|
@@ -7,6 +7,7 @@ export declare enum DealCategorizedFileCategory {
|
|
|
7
7
|
Egrn = "egrn",
|
|
8
8
|
Explication = "explication",
|
|
9
9
|
FloorPlan = "floor_plan",
|
|
10
|
+
Invest = "invest",
|
|
10
11
|
MarriageCertificateContractor = "marriage_certificate_contractor",
|
|
11
12
|
Other = "other",
|
|
12
13
|
OwnershipCertificate = "ownership_certificate",
|
|
@@ -36,6 +36,10 @@ export declare enum ServiceRequestType {
|
|
|
36
36
|
Buy = "buy",
|
|
37
37
|
Sell = "sell"
|
|
38
38
|
}
|
|
39
|
+
export declare enum ServiceRequestInvestType {
|
|
40
|
+
Buyout = "buyout",
|
|
41
|
+
Sell = "sell"
|
|
42
|
+
}
|
|
39
43
|
export declare enum ServiceRequestDepublishReason {
|
|
40
44
|
TemporaryDepublish = "temporary_depublish",
|
|
41
45
|
DepublishOnAdvance = "depublish_on_advance",
|
|
@@ -91,6 +95,8 @@ export declare type ServiceRequest = {
|
|
|
91
95
|
user: Partial<User> & {
|
|
92
96
|
id: number;
|
|
93
97
|
};
|
|
98
|
+
investBuyoutDealId?: number;
|
|
99
|
+
investType?: ServiceRequestInvestType;
|
|
94
100
|
canBePublishedAt?: string;
|
|
95
101
|
closeRequestedAt?: string;
|
|
96
102
|
closedAt?: string;
|
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { Deal } from '../../../types';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true; data: Partial<Deal> & { id: number } };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = SuccessData['data'];
|
|
8
|
+
type ResultError = ErrorData['data']['error'];
|
|
9
|
+
|
|
10
|
+
export type CreateDealInvestPrepaymentHeaders = { 'x-auth-hc': string };
|
|
11
|
+
export type CreateDealInvestPrepaymentUrlParams = { id: number };
|
|
12
|
+
export type CreateDealInvestPrepaymentBody = { investBuyoutPrepaymentSum: number; investBuyoutPrepaymentAt: string };
|
|
13
|
+
export type CreateDealInvestPrepaymentData = AxiosResponse<ResultData>;
|
|
14
|
+
export type CreateDealInvestPrepaymentError = AxiosError<ResultError>;
|
|
15
|
+
export type CreateDealInvestPrepaymentConfig = {
|
|
16
|
+
baseURL?: string;
|
|
17
|
+
urlParams: CreateDealInvestPrepaymentUrlParams;
|
|
18
|
+
headers: CreateDealInvestPrepaymentHeaders;
|
|
19
|
+
body: CreateDealInvestPrepaymentBody;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function createDealInvestPrepaymentRequest({
|
|
23
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
24
|
+
urlParams,
|
|
25
|
+
headers,
|
|
26
|
+
body,
|
|
27
|
+
}: CreateDealInvestPrepaymentConfig) {
|
|
28
|
+
return axios
|
|
29
|
+
.patch(`/api/deal/invest-prepayment/${urlParams.id}`, body, {
|
|
30
|
+
baseURL,
|
|
31
|
+
headers: { Accept: 'application/json', ...headers },
|
|
32
|
+
transformResponse: [
|
|
33
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
34
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
|
|
35
|
+
],
|
|
36
|
+
})
|
|
37
|
+
.then((res: CreateDealInvestPrepaymentData) => res)
|
|
38
|
+
.catch((err: CreateDealInvestPrepaymentError) => {
|
|
39
|
+
throw err;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -18,6 +18,7 @@ export * from './contract/approveContract';
|
|
|
18
18
|
export * from './contract/declineContract';
|
|
19
19
|
|
|
20
20
|
export * from './deal/createDealCategorizedFile';
|
|
21
|
+
export * from './deal/createDealInvestPrepayment';
|
|
21
22
|
export * from './deal/deleteDealCategorizedFile';
|
|
22
23
|
export * from './deal/findDealCategorizedFiles';
|
|
23
24
|
|
|
@@ -5,6 +5,7 @@ export const DealCategorizedFileDictionary = {
|
|
|
5
5
|
[DealCategorizedFileCategory.Egd]: 'Выписка из домовой книги/ЕЖД',
|
|
6
6
|
[DealCategorizedFileCategory.Explication]: 'Экспликация',
|
|
7
7
|
[DealCategorizedFileCategory.FloorPlan]: 'Поэтажный план',
|
|
8
|
+
[DealCategorizedFileCategory.Invest]: 'Документы инвестпроекта',
|
|
8
9
|
[DealCategorizedFileCategory.MarriageCertificateContractor]: 'Свидетельство о регистрации/расторжении брака',
|
|
9
10
|
[DealCategorizedFileCategory.Other]: 'Разное (сделка)',
|
|
10
11
|
[DealCategorizedFileCategory.OwnershipCertificate]: 'Свид-во права собственности (при покупке)',
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
ServiceRequestType,
|
|
6
6
|
ServiceRequestDepublishReason,
|
|
7
7
|
ServiceRequestSource,
|
|
8
|
+
ServiceRequestInvestType,
|
|
8
9
|
} from '../types';
|
|
9
10
|
|
|
10
11
|
export const ServiceRequestDictionary = {
|
|
@@ -41,6 +42,10 @@ export const ServiceRequestDictionary = {
|
|
|
41
42
|
[ServiceRequestType.Buy]: 'Покупка',
|
|
42
43
|
[ServiceRequestType.Sell]: 'Продажа',
|
|
43
44
|
},
|
|
45
|
+
InvestType: {
|
|
46
|
+
[ServiceRequestInvestType.Buyout]: 'Инвестпроект 1 этапа',
|
|
47
|
+
[ServiceRequestInvestType.Sell]: 'Инвестпроект 2 этапа',
|
|
48
|
+
},
|
|
44
49
|
DepublishReason: {
|
|
45
50
|
[ServiceRequestDepublishReason.TemporaryDepublish]: 'Временное снятие объекта',
|
|
46
51
|
[ServiceRequestDepublishReason.DepublishOnAdvance]: 'Снятие объекта на время аванса',
|
package/src/clients/v1/index.ts
CHANGED
|
@@ -94,6 +94,14 @@ export class Api {
|
|
|
94
94
|
return api.createDealCategorizedFileRequest({ urlParams, body, headers, baseURL: this.baseURL });
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
+
createDealInvestPrepayment = (
|
|
98
|
+
urlParams: api.CreateDealInvestPrepaymentUrlParams,
|
|
99
|
+
body: api.CreateDealInvestPrepaymentBody,
|
|
100
|
+
headers: api.CreateDealInvestPrepaymentHeaders
|
|
101
|
+
) => {
|
|
102
|
+
return api.createDealInvestPrepaymentRequest({ urlParams, body, headers, baseURL: this.baseURL });
|
|
103
|
+
};
|
|
104
|
+
|
|
97
105
|
findDealCategorizedFiles = (
|
|
98
106
|
urlParams: api.FindDealCategorizedFilesUrlParams,
|
|
99
107
|
params: api.FindDealCategorizedFilesParams,
|
|
@@ -41,9 +41,11 @@ export type Deal = {
|
|
|
41
41
|
buyer: Partial<Buyer> & Required<Pick<Buyer, 'id'>>;
|
|
42
42
|
incomes: Array<Partial<Income> & Required<Pick<Income, 'id'>>>;
|
|
43
43
|
participants: Array<Partial<DealParticipant> & Required<Pick<DealParticipant, 'id'>>>;
|
|
44
|
+
investSellServiceRequestId?: number;
|
|
44
45
|
comment?: string;
|
|
45
46
|
lawyer?: Partial<User> & Required<Pick<User, 'id'>>;
|
|
46
47
|
files?: Array<Partial<File> & Required<Pick<File, 'id'>>>;
|
|
48
|
+
filesInDeal?: { id: number };
|
|
47
49
|
updatedAt?: string;
|
|
48
50
|
dealSignPlannedAt?: string;
|
|
49
51
|
commissionPlannedAt?: string;
|
|
@@ -53,4 +55,9 @@ export type Deal = {
|
|
|
53
55
|
dealSingedAt?: string;
|
|
54
56
|
dealDoneAt?: string;
|
|
55
57
|
terminatedAt?: string;
|
|
58
|
+
invest?: {
|
|
59
|
+
isInvestBuyout?: boolean;
|
|
60
|
+
investBuyoutPrepaymentSum?: number;
|
|
61
|
+
investBuyoutPrepaymentAt?: string;
|
|
62
|
+
};
|
|
56
63
|
};
|
|
@@ -8,6 +8,7 @@ export enum DealCategorizedFileCategory {
|
|
|
8
8
|
Egrn = 'egrn',
|
|
9
9
|
Explication = 'explication',
|
|
10
10
|
FloorPlan = 'floor_plan',
|
|
11
|
+
Invest = 'invest',
|
|
11
12
|
MarriageCertificateContractor = 'marriage_certificate_contractor',
|
|
12
13
|
Other = 'other',
|
|
13
14
|
OwnershipCertificate = 'ownership_certificate',
|
|
@@ -41,6 +41,11 @@ export enum ServiceRequestType {
|
|
|
41
41
|
Sell = 'sell',
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
export enum ServiceRequestInvestType {
|
|
45
|
+
Buyout = 'buyout',
|
|
46
|
+
Sell = 'sell',
|
|
47
|
+
}
|
|
48
|
+
|
|
44
49
|
export enum ServiceRequestDepublishReason {
|
|
45
50
|
TemporaryDepublish = 'temporary_depublish',
|
|
46
51
|
DepublishOnAdvance = 'depublish_on_advance',
|
|
@@ -92,6 +97,8 @@ export type ServiceRequest = {
|
|
|
92
97
|
type: ServiceRequestType;
|
|
93
98
|
user: Partial<User> & { id: number };
|
|
94
99
|
|
|
100
|
+
investBuyoutDealId?: number;
|
|
101
|
+
investType?: ServiceRequestInvestType;
|
|
95
102
|
canBePublishedAt?: string;
|
|
96
103
|
closeRequestedAt?: string;
|
|
97
104
|
closedAt?: string;
|