@hapl/api-queries 0.2.14 → 0.2.15--canary.134.247c9c3.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.
- package/CHANGELOG.md +0 -24
- package/dist/api-queries.cjs.development.js +6283 -4255
- 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 +6283 -4255
- package/dist/api-queries.esm.js.map +1 -1
- package/dist/clients/v1/api/bill/createBill/index.d.ts +0 -2
- package/dist/clients/v1/api/buyer/closeBuyer/index.d.ts +37 -0
- package/dist/clients/v1/api/buyer/findBuyerById/index.d.ts +33 -0
- package/dist/clients/v1/api/buyer/findBuyerStatuses/index.d.ts +36 -0
- package/dist/clients/v1/api/buyer/findBuyerUniquePhones/index.d.ts +23 -0
- package/dist/clients/v1/api/buyer/findBuyers/index.d.ts +15 -2
- package/dist/clients/v1/api/buyer/resetBuyerStatusTimer/index.d.ts +29 -0
- package/dist/clients/v1/api/buyer/shareBuyer/index.d.ts +33 -0
- package/dist/clients/v1/api/buyer/updateBuyer/index.d.ts +38 -0
- package/dist/clients/v1/api/call/createCallComment/index.d.ts +33 -0
- package/dist/clients/v1/api/call/findCallById/index.d.ts +29 -0
- package/dist/clients/v1/api/callTask/callCallTask.d.ts +29 -0
- package/dist/clients/v1/api/callTask/closeCallTask.d.ts +35 -0
- package/dist/clients/v1/api/callTask/findCallQualityAssessors.d.ts +35 -0
- package/dist/clients/v1/api/callTask/findCallTaskById.d.ts +29 -0
- package/dist/clients/v1/api/callTask/findCallTasks.d.ts +9 -3
- package/dist/clients/v1/api/callTask/updateCallTask.d.ts +24 -0
- package/dist/clients/v1/api/comment/findComments/index.d.ts +41 -0
- package/dist/clients/v1/api/deal/findDealExpertStatistics/index.d.ts +39 -0
- package/dist/clients/v1/api/index.d.ts +39 -7
- package/dist/clients/v1/api/messenger/findMessengerInviteLinks/index.d.ts +31 -0
- package/dist/clients/v1/api/motivationCalculator/createMotivationCalculatorRequest/index.d.ts +37 -0
- package/dist/clients/v1/api/motivationGlossary/findMotivationGlossary/index.d.ts +29 -0
- package/dist/clients/v1/api/motivationStatus/findMotivationStatus/index.d.ts +35 -0
- package/dist/clients/v1/api/payslip/findPayslipById.d.ts +29 -0
- package/dist/clients/v1/api/payslip/findPayslips.d.ts +56 -0
- package/dist/clients/v1/api/payslip/updatePayslip.d.ts +35 -0
- package/dist/clients/v1/api/realty/findRealtyPriceHistory/index.d.ts +39 -0
- package/dist/clients/v1/api/serviceRequest/buyer/findBuyerRejectionReasonStatistic/index.d.ts +36 -0
- package/dist/clients/v1/api/serviceRequest/buyer/findBuyerStatusStatistic/index.d.ts +40 -0
- package/dist/clients/v1/api/serviceRequest/chat/findChatsByServiceRequestId/index.d.ts +28 -0
- package/dist/clients/v1/api/serviceRequest/chat/message/findChatMessageByServiceRequestId/index.d.ts +43 -0
- package/dist/clients/v1/api/serviceRequest/createServiceRequestSellerReport/index.d.ts +31 -0
- package/dist/clients/v1/api/serviceRequest/findServiceRequestCategoryById/index.d.ts +44 -0
- package/dist/clients/v1/api/serviceRequest/restoreServiceRequest/index.d.ts +28 -0
- package/dist/clients/v1/api/slack/createCianRating/index.d.ts +29 -0
- package/dist/clients/v1/api/task/findTasks/index.d.ts +4 -0
- package/dist/clients/v1/api/user/findUsers/index.d.ts +2 -0
- package/dist/clients/v1/dictionaries/Bill.d.ts +1 -1
- package/dist/clients/v1/dictionaries/CallTask.d.ts +4 -0
- package/dist/clients/v1/index.d.ts +32 -0
- package/dist/clients/v1/types/Bill.d.ts +1 -3
- package/dist/clients/v1/types/Buyer.d.ts +6 -0
- package/dist/clients/v1/types/BuyerStatusHistory.d.ts +11 -0
- package/dist/clients/v1/types/Call.d.ts +2 -2
- package/dist/clients/v1/types/CallTask.d.ts +5 -0
- package/dist/clients/v1/types/Comment.d.ts +11 -0
- package/dist/clients/v1/types/Message.d.ts +20 -0
- package/dist/clients/v1/types/Motivation.d.ts +58 -0
- package/dist/clients/v1/types/Payslip.d.ts +61 -0
- package/dist/clients/v1/types/PriceHistory.d.ts +9 -0
- package/dist/clients/v1/types/index.d.ts +7 -1
- package/package.json +1 -1
- package/src/clients/v1/api/bill/createBill/index.ts +0 -2
- package/src/clients/v1/api/buyer/closeBuyer/index.ts +47 -0
- package/src/clients/v1/api/buyer/findBuyerById/index.ts +48 -0
- package/src/clients/v1/api/buyer/findBuyerStatuses/index.ts +61 -0
- package/src/clients/v1/api/buyer/findBuyerUniquePhones/index.ts +51 -0
- package/src/clients/v1/api/buyer/findBuyers/index.ts +17 -2
- package/src/clients/v1/api/buyer/resetBuyerStatusTimer/index.ts +42 -0
- package/src/clients/v1/api/buyer/shareBuyer/index.ts +40 -0
- package/src/clients/v1/api/buyer/updateBuyer/index.ts +48 -0
- package/src/clients/v1/api/call/createCallComment/index.ts +41 -0
- package/src/clients/v1/api/call/findCallById/index.ts +39 -0
- package/src/clients/v1/api/callTask/callCallTask.ts +46 -0
- package/src/clients/v1/api/callTask/closeCallTask.ts +45 -0
- package/src/clients/v1/api/callTask/findCallQualityAssessors.ts +59 -0
- package/src/clients/v1/api/callTask/findCallTaskById.ts +39 -0
- package/src/clients/v1/api/callTask/findCallTasks.ts +6 -3
- package/src/clients/v1/api/callTask/updateCallTask.ts +49 -0
- package/src/clients/v1/api/comment/findComments/index.ts +54 -0
- package/src/clients/v1/api/deal/findDealExpertStatistics/index.ts +43 -0
- package/src/clients/v1/api/index.ts +42 -7
- package/src/clients/v1/api/messenger/findMessengerInviteLinks/index.ts +40 -0
- package/src/clients/v1/api/motivationCalculator/createMotivationCalculatorRequest/index.ts +48 -0
- package/src/clients/v1/api/motivationGlossary/findMotivationGlossary/index.ts +38 -0
- package/src/clients/v1/api/motivationStatus/findMotivationStatus/index.ts +47 -0
- package/src/clients/v1/api/payslip/findPayslipById.ts +39 -0
- package/src/clients/v1/api/payslip/findPayslips.ts +53 -0
- package/src/clients/v1/api/payslip/updatePayslip.ts +45 -0
- package/src/clients/v1/api/realty/findRealtyPriceHistory/index.ts +43 -0
- package/src/clients/v1/api/serviceRequest/buyer/findBuyerRejectionReasonStatistic/index.ts +44 -0
- package/src/clients/v1/api/serviceRequest/buyer/findBuyerStatusStatistic/index.ts +48 -0
- package/src/clients/v1/api/serviceRequest/chat/findChatsByServiceRequestId/index.ts +37 -0
- package/src/clients/v1/api/serviceRequest/chat/message/findChatMessageByServiceRequestId/index.ts +59 -0
- package/src/clients/v1/api/serviceRequest/createServiceRequestSellerReport/index.ts +42 -0
- package/src/clients/v1/api/serviceRequest/findServiceRequestCategoryById/index.ts +48 -0
- package/src/clients/v1/api/serviceRequest/restoreServiceRequest/index.ts +41 -0
- package/src/clients/v1/api/slack/createCianRating/index.ts +34 -0
- package/src/clients/v1/api/task/findTasks/index.ts +1 -0
- package/src/clients/v1/api/user/findUsers/index.ts +2 -0
- package/src/clients/v1/dictionaries/Bill.ts +1 -1
- package/src/clients/v1/dictionaries/CallTask.ts +4 -0
- package/src/clients/v1/index.ts +257 -5
- package/src/clients/v1/types/Bill.ts +1 -3
- package/src/clients/v1/types/Buyer.ts +7 -0
- package/src/clients/v1/types/BuyerStatusHistory.ts +12 -0
- package/src/clients/v1/types/Call.ts +2 -2
- package/src/clients/v1/types/CallTask.ts +5 -0
- package/src/clients/v1/types/Comment.ts +10 -0
- package/src/clients/v1/types/Message.ts +20 -0
- package/src/clients/v1/types/Motivation.ts +64 -0
- package/src/clients/v1/types/Payslip.ts +62 -0
- package/src/clients/v1/types/PriceHistory.ts +7 -0
- package/src/clients/v1/types/index.ts +7 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AxiosResponse, AxiosError } from 'axios';
|
|
2
|
+
declare type SuccessData = {
|
|
3
|
+
success: true;
|
|
4
|
+
data: undefined;
|
|
5
|
+
};
|
|
6
|
+
declare type ErrorData = {
|
|
7
|
+
success: false;
|
|
8
|
+
data: {
|
|
9
|
+
error: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
declare type ResultData = SuccessData['data'];
|
|
13
|
+
declare type ResultError = ErrorData['data']['error'];
|
|
14
|
+
export declare type CreateCianRatingHeaders = {
|
|
15
|
+
'x-auth-hc': string;
|
|
16
|
+
};
|
|
17
|
+
export declare type CreateCianRatingBody = {
|
|
18
|
+
id: number;
|
|
19
|
+
urls: string[];
|
|
20
|
+
};
|
|
21
|
+
export declare type CreateCianRatingData = AxiosResponse<ResultData>;
|
|
22
|
+
export declare type CreateCianRatingError = AxiosError<ResultError>;
|
|
23
|
+
export declare type CreateCianRatingConfig = {
|
|
24
|
+
baseURL?: string;
|
|
25
|
+
headers: CreateCianRatingHeaders;
|
|
26
|
+
body: CreateCianRatingBody;
|
|
27
|
+
};
|
|
28
|
+
export declare function createCianRatingRequest({ baseURL, body, headers, }: CreateCianRatingConfig): Promise<CreateCianRatingData>;
|
|
29
|
+
export {};
|
|
@@ -12,10 +12,19 @@ export declare class Api {
|
|
|
12
12
|
createBill: (body: api.CreateBillBody, headers: api.CreateBillHeaders) => Promise<api.CreateBillData>;
|
|
13
13
|
findBills: (params: api.FindBillsParams, headers: api.FindBillsHeaders) => Promise<api.FindBillsData>;
|
|
14
14
|
callbackBuyer: (urlParams: api.CallbackBuyerUrlParams, headers: api.CallbackBuyerHeaders) => Promise<api.CallbackBuyerData>;
|
|
15
|
+
closeBuyer: (urlParams: api.CloseBuyerUrlParams, body: api.CloseBuyerBody, headers: api.CloseBuyerHeaders) => Promise<api.CloseBuyerData>;
|
|
15
16
|
countBuyers: (params: api.CountBuyersParams, headers: api.CountBuyersHeaders) => Promise<api.CountBuyersData>;
|
|
16
17
|
createBuyer: (body: api.CreateBuyerBody, headers?: api.CallbackBuyerHeaders | undefined) => Promise<api.CreateBuyerData>;
|
|
17
18
|
findBuyerClosingReason: (headers: api.FindBuyerClosingReasonHeaders) => Promise<api.FindBuyerClosingReasonData>;
|
|
19
|
+
findBuyerStatuses: (urlParams: api.FindBuyerStatusesUrlParams, params: api.FindBuyerStatusesParams, headers: api.FindBuyerStatusesHeaders) => Promise<api.FindBuyerStatusesData>;
|
|
20
|
+
findBuyerUniquePhones: (headers: api.FindBuyerUniquePhonesHeaders) => Promise<api.FindBuyerUniquePhonesData>;
|
|
18
21
|
findBuyers: (params: api.FindBuyersParams, headers: api.FindBuyersHeaders) => Promise<api.FindBuyersData>;
|
|
22
|
+
findBuyerById: (urlParams: api.FindBuyerByIdUrlParams, params: api.FindBuyerByIdParams, headers: api.FindBuyerByIdHeaders) => Promise<api.FindBuyerByIdData>;
|
|
23
|
+
resetBuyerStatusTimer: (urlParams: api.ResetBuyerStatusTimerUrlParams, headers: api.ResetBuyerStatusTimerHeaders) => Promise<api.ResetBuyerStatusTimerData>;
|
|
24
|
+
shareBuyer: (urlParams: api.ShareBuyerUrlParams, body: api.ShareBuyerBody, headers: api.ShareBuyerHeaders) => Promise<api.ShareBuyerData>;
|
|
25
|
+
updateBuyer: (urlParams: api.UpdateBuyerUrlParams, body: api.UpdateBuyerBody, headers: api.UpdateBuyerHeaders) => Promise<api.UpdateBuyerData>;
|
|
26
|
+
createCallComment: (urlParams: api.CreateCallCommentUrlParams, body: api.CreateCallCommentBody, headers: api.CreateCallCommentHeaders) => Promise<api.CreateCallCommentData>;
|
|
27
|
+
findCallById: (urlParams: api.FindCallByIdUrlParams, headers: api.FindCallByIdHeaders) => Promise<api.FindCallByIdData>;
|
|
19
28
|
findCalls: (params: api.FindCallsParams, headers: api.FindCallsHeaders) => Promise<api.FindCallsData>;
|
|
20
29
|
findFirstSuccessOutgoingCalls: (params: api.FindFirstSuccessOutgoingCallsParams, headers: api.FindFirstSuccessOutgoingCallsHeaders) => Promise<api.FindFirstSuccessOutgoingCallsData>;
|
|
21
30
|
markupCall: (body: api.MarkupCallBody, headers: api.MarkupCallHeaders) => Promise<api.MarkupCallData>;
|
|
@@ -24,8 +33,14 @@ export declare class Api {
|
|
|
24
33
|
finishOperatorWork: (headers: api.FinishOperatorWorkHeaders) => Promise<api.FinishOperatorWorkData>;
|
|
25
34
|
startOperatorWork: (headers: api.StartOperatorWorkHeaders) => Promise<api.StartOperatorWorkData>;
|
|
26
35
|
getOperatorStatus: (headers: api.GetOperatorStatusHeaders) => Promise<api.GetOperatorStatusData>;
|
|
36
|
+
callCallTask: (urlParams: api.CallCallTaskUrlParams, headers?: api.CreateCallTaskHeaders | undefined) => Promise<api.CallCallTaskData>;
|
|
37
|
+
closeCallTask: (urlParams: api.CallCallTaskUrlParams, body: api.CloseCallTaskBody, headers?: api.CreateCallTaskHeaders | undefined) => Promise<api.CloseCallTaskData>;
|
|
27
38
|
createCallTask: (body: api.CreateCallTaskBody, headers?: api.CreateCallTaskHeaders | undefined) => Promise<api.CreateCallTaskData>;
|
|
39
|
+
findCallQualityAssessors: (params: api.FindCallQualityAssessorsParams, headers: api.FindCallQualityAssessorsHeaders) => Promise<api.FindCallQualityAssessorsData>;
|
|
40
|
+
findCallTaskById: (urlParams: api.FindCallByIdUrlParams, headers: api.FindCallTaskByIdHeaders) => Promise<api.FindCallTaskByIdData>;
|
|
28
41
|
findCallTasks: (params: api.FindCallTasksParams, headers: api.FindCallTasksHeaders) => Promise<api.FindCallTasksData>;
|
|
42
|
+
updateCallTask: (urlParams: api.UpdateCallTaskUrlParams, body: api.UpdateCallTaskBody, headers: api.FindCallTasksHeaders) => Promise<api.UpdateCallTaskData>;
|
|
43
|
+
findComments: (params: api.FindCommentsParams, headers: api.FindCommentsHeaders) => Promise<api.FindCommentsData>;
|
|
29
44
|
approveContract: (urlParams: api.ApproveContractUrlParams, body: api.ApproveContractBody, headers: api.ApproveContractHeaders) => Promise<api.ApproveContractData>;
|
|
30
45
|
createContract: (body: api.CreateContractBody, headers: api.CreateContractHeaders) => Promise<api.CreateContractData>;
|
|
31
46
|
createContractLegalDocument: (urlParams: api.CreateContractLegalDocumentUrlParams, headers: api.CreateContractLegalDocumentHeaders) => Promise<api.CreateContractLegalDocumentData>;
|
|
@@ -45,6 +60,7 @@ export declare class Api {
|
|
|
45
60
|
createDealCategorizedFile: (urlParams: api.CreateDealCategorizedFileUrlParams, body: api.CreateDealCategorizedFileBody, headers: api.CreateDealCategorizedFileHeaders) => Promise<api.CreateDealCategorizedFileData>;
|
|
46
61
|
createDealInvestPrepayment: (urlParams: api.CreateDealInvestPrepaymentUrlParams, body: api.CreateDealInvestPrepaymentBody, headers: api.CreateDealInvestPrepaymentHeaders) => Promise<api.CreateDealInvestPrepaymentData>;
|
|
47
62
|
findDealCategorizedFiles: (urlParams: api.FindDealCategorizedFilesUrlParams, params: api.FindDealCategorizedFilesParams, headers: api.FindDealCategorizedFilesHeaders) => Promise<api.FindDealCategorizedFilesData>;
|
|
63
|
+
findDealExpertStatistics: (urlParams: api.FindDealExpertStatisticsUrlParams, params: api.FindDealExpertStatisticsParams, headers: api.FindDealExpertStatisticsHeaders) => Promise<api.FindDealExpertStatisticsData>;
|
|
48
64
|
findDeals: (params: api.FindDealsParams, headers: api.FindDealsHeaders) => Promise<api.FindDealsData>;
|
|
49
65
|
deleteDealCategorizedFile: (urlParams: api.DeleteDealCategorizedFileUrlParams, headers: api.DeleteDealCategorizedFileHeaders) => Promise<api.DeleteDealCategorizedFileData>;
|
|
50
66
|
setDealDoneState: (urlParams: api.SetDealDoneStateUrlParams, headers: api.SetDealDoneStateHeaders) => Promise<api.SetDealDoneStateData>;
|
|
@@ -78,6 +94,13 @@ export declare class Api {
|
|
|
78
94
|
findInternalCrossSaleInfo: (params: api.FindInternalCrossSaleInfoParams, headers: api.FindInternalCrossSaleInfoHeaders) => Promise<api.FindInternalCrossSaleInfoData>;
|
|
79
95
|
findInternalCrossSales: (urlParams: api.FindInternalCrossSalesUrlParams, headers: api.FindInternalCrossSalesHeaders) => Promise<api.FindInternalCrossSalesData>;
|
|
80
96
|
updateInternalCrossSale: (urlParams: api.UpdateInternalCrossSaleUrlParams, body: api.UpdateInternalCrossSaleBody, headers: api.UpdateInternalCrossSaleHeaders) => Promise<api.UpdateInternalCrossSaleData>;
|
|
97
|
+
findMessengerInviteLinks: (urlParams: api.FindMessengerInviteLinksUrlParams, headers: api.FindMessengerInviteLinksHeaders) => Promise<api.FindMessengerInviteLinksData>;
|
|
98
|
+
createMotivationCalculatorRequest: (body: api.CreateMotivationCalculatorRequestBody, headers: api.CreateMotivationCalculatorRequestHeaders) => Promise<api.CreateMotivationCalculatorRequestData>;
|
|
99
|
+
findMotivationGlossary: (headers: api.FindMotivationGlossaryHeaders) => Promise<api.FindMotivationGlossaryData>;
|
|
100
|
+
findMotivationStatus: (urlParams: api.FindMotivationStatusUrlParams, headers: api.FindMotivationStatusHeaders) => Promise<api.FindMotivationStatusData>;
|
|
101
|
+
findPayslips: (params: api.FindPayslipsParams, headers: api.FindPayslipsHeaders) => Promise<api.FindPayslipsData>;
|
|
102
|
+
findPayslipById: (urlParams: api.FindPayslipByIdUrlParams, headers: api.FindPayslipByIdHeaders) => Promise<api.FindPayslipByIdData>;
|
|
103
|
+
updatePayslip: (urlParams: api.UpdatePayslipUrlParams, body: api.UpdatePayslipBody, headers: api.UpdatePayslipHeaders) => Promise<api.UpdatePayslipData>;
|
|
81
104
|
createPhoneBookContact: (body: api.CreatePhoneBookContactBody, headers: api.CreatePhoneBookContactHeaders) => Promise<api.CreatePhoneBookContactData>;
|
|
82
105
|
findPhoneBookContacts: (params: api.FindPhoneBookContactsParams, headers: api.FindPhoneBookContactsHeaders) => Promise<api.FindPhoneBookContactsData>;
|
|
83
106
|
updatePhoneBookContact: (urlParams: api.UpdatePhoneBookContactUrlParams, body: api.UpdatePhoneBookContactBody, headers: api.UpdatePhoneBookContactHeaders) => Promise<api.UpdatePhoneBookContactData>;
|
|
@@ -86,10 +109,15 @@ export declare class Api {
|
|
|
86
109
|
findPhotoOrders: (params: api.FindPhotoOrdersParams, headers: api.FindPhotoOrdersHeaders) => Promise<api.FindPhotoOrdersData>;
|
|
87
110
|
sendPhotoOrderFeedback: (urlParams: api.SendPhotoOrderFeedbackUrlParams, headers: api.SendPhotoOrderFeedbackHeaders) => Promise<api.SendPhotoOrderFeedbackData>;
|
|
88
111
|
terminatePhotoOrder: (urlParams: api.TerminatePhotoOrderUrlParams, headers: api.TerminatePhotoOrderHeaders) => Promise<api.TerminatePhotoOrderData>;
|
|
112
|
+
findRealtyPriceHistory: (params: api.FindRealtyPriceHistoryParams) => Promise<api.FindRealtyPriceHistoryData>;
|
|
89
113
|
findSimilarRealtyIdsById: (urlParams: api.FindSimilarRealtyIdsByIdUrlParams) => Promise<api.FindSimilarRealtyIdsByIdData>;
|
|
90
114
|
subscribeToRealtyUpdates: (body: api.SubscribeToRealtyUpdatesBody) => Promise<api.SubscribeToRealtyUpdatesData>;
|
|
91
115
|
approveCloseServiceRequest: (urlParams: api.ApproveCloseServiceRequestUrlParams, body: api.ApproveCloseServiceRequestBody, headers: api.ApproveCloseServiceRequestHeaders) => Promise<api.ApproveCloseServiceRequestData>;
|
|
116
|
+
findBuyerRejectionReasonStatistic: (urlParams: api.FindBuyerRejectionReasonStatisticUrlParams, params: api.FindBuyerRejectionReasonStatisticParams, headers: api.FindBuyerRejectionReasonStatisticHeaders) => Promise<api.FindBuyerRejectionReasonStatisticData>;
|
|
117
|
+
findBuyerStatusStatistic: (urlParams: api.FindBuyerStatusStatisticUrlParams, params: api.FindBuyerStatusStatisticParams, headers: api.FindBuyerStatusStatisticHeaders) => Promise<api.FindBuyerStatusStatisticData>;
|
|
92
118
|
callbackServiceRequest: (urlParams: api.CallbackServiceRequestUrlParams, headers: api.CallbackServiceRequestHeaders) => Promise<api.CallbackServiceRequestData>;
|
|
119
|
+
findChatsByServiceRequestId: (urlParams: api.FindChatsByServiceRequestIdUrlParams, headers: api.FindChatsByServiceRequestIdHeaders) => Promise<api.FindChatsByServiceRequestIdData>;
|
|
120
|
+
findChatMessagesByServiceRequestId: (urlParams: api.FindChatMessagesByServiceRequestIdUrlParams, params: api.FindChatMessagesByServiceRequestIdParams, headers: api.FindChatMessagesByServiceRequestIdHeaders) => Promise<api.FindChatMessagesByServiceRequestIdData>;
|
|
93
121
|
closeServiceRequest: (urlParams: api.CloseServiceRequestUrlParams, body: api.CloseServiceRequestBody, headers: api.CloseServiceRequestHeaders) => Promise<api.CloseServiceRequestData>;
|
|
94
122
|
completeServiceRequestModeration: (urlParams: api.CompleteServiceRequestModerationUrlParams, headers: api.CompleteServiceRequestModerationHeaders) => Promise<api.CompleteServiceRequestModerationData>;
|
|
95
123
|
createServiceRequest: (body: api.CreateServiceRequestBody, headers: api.CreateServiceRequestHeaders) => Promise<api.CreateServiceRequestData>;
|
|
@@ -97,6 +125,7 @@ export declare class Api {
|
|
|
97
125
|
createServiceRequestByCrossSaleId: (urlParams: api.CreateServiceRequestByCrossSaleIdUrlParams, headers: api.CreateServiceRequestByCrossSaleIdHeaders) => Promise<api.CreateServiceRequestByCrossSaleIdData>;
|
|
98
126
|
createServiceRequestActivity: (body: api.CreateServiceRequestActivityBody, headers: api.CreateServiceRequestActivityHeaders) => Promise<api.CreateServiceRequestActivityData>;
|
|
99
127
|
createServiceRequestCategorizedFile: (urlParams: api.CreateServiceRequestCategorizedFileUrlParams, body: api.CreateServiceRequestCategorizedFileBody, headers: api.CreateServiceRequestCategorizedFileHeaders) => Promise<api.CreateServiceRequestCategorizedFileData>;
|
|
128
|
+
createServiceRequestSellerReport: (urlParams: api.CreateServiceRequestSellerReportUrlParams, body: api.CreateServiceRequestSellerReportBody, headers: api.CreateServiceRequestSellerReportHeaders) => Promise<api.CreateServiceRequestSellerReportData>;
|
|
100
129
|
deferServiceRequest: (body: api.DeferServiceRequestBody, headers: api.DeferServiceRequestHeaders) => Promise<api.DeferServiceRequestData>;
|
|
101
130
|
deleteServiceRequestCategorizedFile: (urlParams: api.DeleteServiceRequestCategorizedFileUrlParams, headers: api.DeleteServiceRequestCategorizedFileHeaders) => Promise<api.DeleteServiceRequestCategorizedFileData>;
|
|
102
131
|
deleteServiceRequestReportForSeller: (urlParams: api.DeleteServiceRequestReportForSellerUrlParams, headers: api.DeleteServiceRequestReportForSellerHeaders) => Promise<api.DeleteServiceRequestReportForSellerData>;
|
|
@@ -111,16 +140,19 @@ export declare class Api {
|
|
|
111
140
|
findServiceRequestShortInfoById: (urlParams: api.FindServiceRequestShortInfoByIdUrlParams, headers: api.FindServiceRequestShortInfoByIdHeaders) => Promise<api.FindServiceRequestShortInfoByIdData>;
|
|
112
141
|
findServiceRequestStatisticsById: (urlParams: api.FindServiceRequestStatisticsByIdUrlParams, headers: api.FindServiceRequestStatisticsByIdHeaders) => Promise<api.FindServiceRequestStatisticsByIdData>;
|
|
113
142
|
findServiceRequestCategorizedFiles: (urlParams: api.FindServiceRequestCategorizedFilesUrlParams, params: api.FindServiceRequestCategorizedFilesParams, headers: api.FindServiceRequestCategorizedFilesHeaders) => Promise<api.FindServiceRequestCategorizedFilesData>;
|
|
143
|
+
findServiceRequestCategoryById: (urlParams: api.FindServiceRequestCategoryByIdUrlParams, headers: api.FindServiceRequestCategoryByIdHeaders, params?: api.FindServiceRequestCategoryByIdParams | undefined) => Promise<api.FindServiceRequestCategoryByIdData>;
|
|
114
144
|
findServiceRequestCategorizedFileCreatedDate: (urlParams: api.FindServiceRequestCategorizedFileCreatedDateUrlParams, headers: api.FindServiceRequestCategorizedFileCreatedDateHeaders) => Promise<api.FindServiceRequestCategorizedFileCreatedDateData>;
|
|
115
145
|
findPriceHistoryAnalyticsById: (urlParams: api.FindPriceHistoryAnalyticsByIdUrlParams, headers: api.FindPriceHistoryAnalyticsByIdHeaders) => Promise<api.FindPriceHistoryAnalyticsByIdData>;
|
|
116
146
|
findServiceRequestSellerReports: (urlParams: api.FindServiceRequestSellerReportsUrlParams, params: api.FindServiceRequestSellerReportsParams, headers: api.FindServiceRequestSellerReportsHeaders) => Promise<api.FindServiceRequestSellerReportsData>;
|
|
117
147
|
publishServiceRequest: (urlParams: api.PublishServiceRequestUrlParams, headers: api.PublishServiceRequestHeaders) => Promise<api.PublishServiceRequestData>;
|
|
148
|
+
restoreServiceRequest: (urlParams: api.RestoreServiceRequestUrlParams, headers: api.RestoreServiceRequestHeaders) => Promise<api.RestoreServiceRequestData>;
|
|
118
149
|
returnDeferredServiceRequest: (body: api.ReturnDeferredServiceRequestBody, headers: api.ReturnDeferredServiceRequestHeaders) => Promise<api.ReturnDeferredServiceRequestData>;
|
|
119
150
|
sendServiceRequestToModeration: (urlParams: api.SendServiceRequestToModerationUrlParams, headers: api.SendServiceRequestToModerationHeaders) => Promise<api.SendServiceRequestToModerationData>;
|
|
120
151
|
startServiceRequestModeration: (urlParams: api.StartServiceRequestModerationUrlParams, headers: api.StartServiceRequestModerationHeaders) => Promise<api.StartServiceRequestModerationData>;
|
|
121
152
|
startServiceRequestModerationForOldRealty: (urlParams: api.StartServiceRequestModerationForOldRealtyUrlParams, headers: api.StartServiceRequestModerationForOldRealtyHeaders) => Promise<api.StartServiceRequestModerationForOldRealtyData>;
|
|
122
153
|
transferServiceRequest: (urlParams: api.TransferServiceRequestUrlParams, body: api.TransferServiceRequestBody, headers: api.TransferServiceRequestHeaders) => Promise<api.TransferServiceRequestData>;
|
|
123
154
|
updateServiceRequest: (urlParams: api.UpdateServiceRequestUrlParams, body: api.UpdateServiceRequestBody, headers: api.UpdateServiceRequestHeaders) => Promise<api.UpdateServiceRequestData>;
|
|
155
|
+
createCianRating: (body: api.CreateCianRatingBody, headers: api.CreateCianRatingHeaders) => Promise<api.CreateCianRatingData>;
|
|
124
156
|
findSoldStatistic: (headers?: api.FindSoldStatisticHeaders | undefined) => Promise<api.FindSoldStatisticData>;
|
|
125
157
|
findTasks: (params: api.FindTasksParams, headers: api.FindTasksHeaders) => Promise<api.FindTasksData>;
|
|
126
158
|
findTaskById: (urlParams: api.FindTaskByIdUrlParams, headers: api.FindTaskByIdHeaders) => Promise<api.FindTaskByIdData>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare enum BillServiceType {
|
|
2
|
-
|
|
2
|
+
PartPayment = "part_payment",
|
|
3
3
|
FullPayment = "full_payment",
|
|
4
4
|
BuyServicePayment = "buy_service_payment"
|
|
5
5
|
}
|
|
@@ -30,7 +30,5 @@ export declare type Bill = {
|
|
|
30
30
|
type: BillServiceType;
|
|
31
31
|
unit: BillServiceUnit;
|
|
32
32
|
}>;
|
|
33
|
-
acceptanceAgreementDate?: string;
|
|
34
|
-
acceptanceAgreementNumber?: string;
|
|
35
33
|
dealId?: number;
|
|
36
34
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ServiceRequest } from './ServiceRequest';
|
|
2
2
|
import { User } from './User';
|
|
3
|
+
import { Call } from './Call';
|
|
3
4
|
export declare enum BuyerStatus {
|
|
4
5
|
Incoming = "incoming",
|
|
5
6
|
ShowCoordination = "show_coordination",
|
|
@@ -46,4 +47,9 @@ export declare type Buyer = {
|
|
|
46
47
|
source?: string;
|
|
47
48
|
statusDeadlineAt?: string;
|
|
48
49
|
updatedAt?: string;
|
|
50
|
+
calls: Call[];
|
|
51
|
+
};
|
|
52
|
+
export declare type BuyerPhone = {
|
|
53
|
+
name: string;
|
|
54
|
+
phone: string;
|
|
49
55
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BuyerStatus, BuyerRealtyShowStatus } from './Buyer';
|
|
2
|
+
export declare type BuyerStatusHistory = {
|
|
3
|
+
id: number;
|
|
4
|
+
status: BuyerStatus;
|
|
5
|
+
changedAt: string;
|
|
6
|
+
deadlineAt: string;
|
|
7
|
+
realtyShowData: {
|
|
8
|
+
status: BuyerRealtyShowStatus;
|
|
9
|
+
scheduledAt: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -10,7 +10,7 @@ export declare enum CallDefaultTelephony {
|
|
|
10
10
|
Zadarma = "zadarma"
|
|
11
11
|
}
|
|
12
12
|
export declare type Call = {
|
|
13
|
-
callTask
|
|
13
|
+
callTask?: Partial<CallTask> & {
|
|
14
14
|
id: number;
|
|
15
15
|
};
|
|
16
16
|
createdAt: string;
|
|
@@ -20,7 +20,7 @@ export declare type Call = {
|
|
|
20
20
|
id: number;
|
|
21
21
|
number: string;
|
|
22
22
|
};
|
|
23
|
-
hasComments
|
|
23
|
+
hasComments?: boolean;
|
|
24
24
|
id: number;
|
|
25
25
|
inProgress: boolean;
|
|
26
26
|
redirectCount: number;
|
|
@@ -18,7 +18,12 @@ export declare enum CallTaskStatus {
|
|
|
18
18
|
Outgoing = "outgoing"
|
|
19
19
|
}
|
|
20
20
|
export declare enum CallTaskReason {
|
|
21
|
+
HasOwnRealtor = "has_own_realtor",
|
|
22
|
+
Rent = "rent",
|
|
23
|
+
NewComplex = "new_complex",
|
|
24
|
+
Error = "error",
|
|
21
25
|
WrongGeo = "wrong_geo",
|
|
26
|
+
QualityAssurance = "quality_assurance",
|
|
22
27
|
Double = "double",
|
|
23
28
|
Agent = "agent",
|
|
24
29
|
BuyingOrSellingPart = "buying_or_selling_part",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { User } from './User';
|
|
2
|
+
export declare enum MessageSide {
|
|
3
|
+
Inner = "inner",
|
|
4
|
+
Outer = "outer",
|
|
5
|
+
System = "system"
|
|
6
|
+
}
|
|
7
|
+
export declare type Message = {
|
|
8
|
+
id: number;
|
|
9
|
+
date: string;
|
|
10
|
+
content: string;
|
|
11
|
+
from: {
|
|
12
|
+
id: string;
|
|
13
|
+
contactId: string;
|
|
14
|
+
side: MessageSide;
|
|
15
|
+
displayName?: string;
|
|
16
|
+
};
|
|
17
|
+
user: {
|
|
18
|
+
id: number;
|
|
19
|
+
} & Partial<User>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare type MotivationSellMinCommission = {
|
|
2
|
+
categoryName: string;
|
|
3
|
+
minPrice: number;
|
|
4
|
+
minCommissionPercent: number;
|
|
5
|
+
recommendedCommissionPercent: number;
|
|
6
|
+
minCommissionAmount: number;
|
|
7
|
+
};
|
|
8
|
+
export declare type MotivationCommonMinCommission = {
|
|
9
|
+
categoryName: string;
|
|
10
|
+
minPrice: number;
|
|
11
|
+
minCommission: number;
|
|
12
|
+
minCommissionUnit: string;
|
|
13
|
+
legalDiligencePrice: number;
|
|
14
|
+
totalMinCommission: number;
|
|
15
|
+
};
|
|
16
|
+
export declare type MotivationMinCommission = {
|
|
17
|
+
sell: Array<MotivationSellMinCommission>;
|
|
18
|
+
buySecondary: Array<MotivationCommonMinCommission>;
|
|
19
|
+
legalSupport: Array<MotivationCommonMinCommission>;
|
|
20
|
+
};
|
|
21
|
+
export declare type MotivationStep = {
|
|
22
|
+
name: string;
|
|
23
|
+
val: number;
|
|
24
|
+
bonus: number;
|
|
25
|
+
bonusTrainee?: number;
|
|
26
|
+
};
|
|
27
|
+
export declare enum MotivationServiceTypeValues {
|
|
28
|
+
Sell = "sell",
|
|
29
|
+
BuySecondary = "buy_secondary",
|
|
30
|
+
BuyNew = "buy_new",
|
|
31
|
+
LegalSupport = "legal_support"
|
|
32
|
+
}
|
|
33
|
+
export declare type ExpertBonusCalculatingData = {
|
|
34
|
+
stepName: string;
|
|
35
|
+
commissionPart: number;
|
|
36
|
+
bonusPercent: number;
|
|
37
|
+
bonus: number;
|
|
38
|
+
};
|
|
39
|
+
export declare type MotivationCommission = {
|
|
40
|
+
minCommission: number;
|
|
41
|
+
recommendedCommission: number;
|
|
42
|
+
commission: number;
|
|
43
|
+
lowCommissionBonusFine: number;
|
|
44
|
+
additionalHighCommissionBonus: number;
|
|
45
|
+
additionalBonusOver2M: number;
|
|
46
|
+
expertBonusBySteps: number;
|
|
47
|
+
expertBonusPercentBySteps: number;
|
|
48
|
+
expertBonus: number;
|
|
49
|
+
expertBonusPercent: number;
|
|
50
|
+
expertBonusPercentCalculation: ExpertBonusCalculatingData[];
|
|
51
|
+
legalDiligencePrice?: number;
|
|
52
|
+
mentorLowCommissionBonusFine?: number;
|
|
53
|
+
mentorAdditionalHighCommissionBonus?: number;
|
|
54
|
+
mentorBonus?: number;
|
|
55
|
+
mentorBonusPercent?: number;
|
|
56
|
+
mentorBonusBySteps?: number;
|
|
57
|
+
mentorBonusPercentBySteps?: number;
|
|
58
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export declare type PayslipLevel = {
|
|
2
|
+
number: number;
|
|
3
|
+
revenue: number;
|
|
4
|
+
percent?: number;
|
|
5
|
+
baseCommissionSum?: number;
|
|
6
|
+
bonus?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare type Payslip = {
|
|
9
|
+
serviceRequestId: number;
|
|
10
|
+
advanceDate?: string;
|
|
11
|
+
allRelevantDeals?: number[];
|
|
12
|
+
baseBonusAll?: number;
|
|
13
|
+
baseBonusPercentAll?: number;
|
|
14
|
+
baseComission?: number;
|
|
15
|
+
basePercent?: number;
|
|
16
|
+
chargesComissionAboveTargetPercentAll?: number;
|
|
17
|
+
chargesComissionBelowMinimumAll?: number;
|
|
18
|
+
chargesComissionBelowTargetPercentAll?: number;
|
|
19
|
+
closingDate?: string;
|
|
20
|
+
comissionAboveTargetPercent?: number;
|
|
21
|
+
comissionBelowMinimum?: number;
|
|
22
|
+
comissionBelowTargetPercent?: number;
|
|
23
|
+
createdAt?: string;
|
|
24
|
+
curatorId?: number;
|
|
25
|
+
dealDate?: string;
|
|
26
|
+
dealId?: number;
|
|
27
|
+
dealStatus?: string;
|
|
28
|
+
dealType?: string;
|
|
29
|
+
effectiveBonusAll?: number;
|
|
30
|
+
effectiveBonusPercentAll?: number;
|
|
31
|
+
effectivePercent?: number;
|
|
32
|
+
expectedExpertPayoutDate?: string;
|
|
33
|
+
extraPercent?: number;
|
|
34
|
+
finalBonus?: number;
|
|
35
|
+
finalPrice?: number;
|
|
36
|
+
financeAdjustment?: number;
|
|
37
|
+
financeComment?: string;
|
|
38
|
+
formalId?: string;
|
|
39
|
+
grossRevenue4MAll?: number;
|
|
40
|
+
ifAmnesty?: boolean;
|
|
41
|
+
ifBelowMinimum?: boolean;
|
|
42
|
+
ifFinalNotification?: boolean;
|
|
43
|
+
lawyerId?: number;
|
|
44
|
+
legalCharges?: number;
|
|
45
|
+
levels?: Array<PayslipLevel>;
|
|
46
|
+
mentorId?: number;
|
|
47
|
+
minNetComission?: number;
|
|
48
|
+
negativeAdjustmentFact?: number;
|
|
49
|
+
netComission?: number;
|
|
50
|
+
partnerCommission?: number;
|
|
51
|
+
payslipMeta?: {
|
|
52
|
+
createdAt: string;
|
|
53
|
+
updatedAt?: string;
|
|
54
|
+
};
|
|
55
|
+
plannedCommission?: number;
|
|
56
|
+
signedAt?: string;
|
|
57
|
+
supervisorId?: number;
|
|
58
|
+
targetPercentFrom?: number;
|
|
59
|
+
targetPercentTo?: number;
|
|
60
|
+
traineeAdjustmentFact?: number;
|
|
61
|
+
};
|
|
@@ -5,9 +5,11 @@ export * from './AvailableFunds';
|
|
|
5
5
|
export * from './Bill';
|
|
6
6
|
export * from './Buyer';
|
|
7
7
|
export * from './BuyerClosingReason';
|
|
8
|
+
export * from './BuyerStatusHistory';
|
|
8
9
|
export * from './Call';
|
|
9
10
|
export * from './CallProxy';
|
|
10
11
|
export * from './CallTask';
|
|
12
|
+
export * from './Comment';
|
|
11
13
|
export * from './Contact';
|
|
12
14
|
export * from './Contract';
|
|
13
15
|
export * from './ContractDocument';
|
|
@@ -24,16 +26,20 @@ export * from './GalleryImage';
|
|
|
24
26
|
export * from './Image';
|
|
25
27
|
export * from './Income';
|
|
26
28
|
export * from './InternalCrossSale';
|
|
29
|
+
export * from './Message';
|
|
30
|
+
export * from './Motivation';
|
|
31
|
+
export * from './Payslip';
|
|
27
32
|
export * from './PhoneBookContact';
|
|
28
33
|
export * from './PhotoOrder';
|
|
34
|
+
export * from './PriceHistory';
|
|
29
35
|
export * from './PriceHistoryAnalytics';
|
|
30
36
|
export * from './Realty';
|
|
31
37
|
export * from './RealtyOffer';
|
|
32
38
|
export * from './ServiceRequest';
|
|
33
39
|
export * from './ServiceRequestActivity';
|
|
40
|
+
export * from './ServiceRequestCategorizedFile';
|
|
34
41
|
export * from './ServiceRequestSellerReport';
|
|
35
42
|
export * from './ServiceRequestShortInfo';
|
|
36
|
-
export * from './ServiceRequestCategorizedFile';
|
|
37
43
|
export * from './Shape';
|
|
38
44
|
export * from './SoldStatistic';
|
|
39
45
|
export * from './Task';
|
package/package.json
CHANGED
|
@@ -13,8 +13,6 @@ export type CreateBillBody = {
|
|
|
13
13
|
services: Required<Bill>['services'];
|
|
14
14
|
dealId?: Required<Bill>['dealId'];
|
|
15
15
|
contractId?: Required<Bill>['contractId'];
|
|
16
|
-
acceptanceAgreementDate?: Required<Bill>['acceptanceAgreementDate'];
|
|
17
|
-
acceptanceAgreementNumber?: Required<Bill>['acceptanceAgreementNumber'];
|
|
18
16
|
};
|
|
19
17
|
|
|
20
18
|
export type CreateBillData = AxiosResponse<ResultData>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { Buyer } from '../../../types';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true; data: Buyer };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = SuccessData['data'];
|
|
8
|
+
type ResultError = ErrorData['data']['error'];
|
|
9
|
+
|
|
10
|
+
export type CloseBuyerUrlParams = { id: number };
|
|
11
|
+
export type CloseBuyerHeaders = { 'x-auth-hc': string };
|
|
12
|
+
export type CloseBuyerBody = {
|
|
13
|
+
closingQuestionaryAnswers?: Array<{
|
|
14
|
+
questionId: string;
|
|
15
|
+
answerId: string;
|
|
16
|
+
comment?: string;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
export type CloseBuyerData = AxiosResponse<ResultData>;
|
|
20
|
+
export type CloseBuyerError = AxiosError<ResultError>;
|
|
21
|
+
export type CloseBuyerConfig = {
|
|
22
|
+
baseURL?: string;
|
|
23
|
+
urlParams: CloseBuyerUrlParams;
|
|
24
|
+
headers: CloseBuyerHeaders;
|
|
25
|
+
body: CloseBuyerBody;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export function closeBuyerRequest({
|
|
29
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
30
|
+
urlParams,
|
|
31
|
+
body,
|
|
32
|
+
headers,
|
|
33
|
+
}: CloseBuyerConfig) {
|
|
34
|
+
return axios
|
|
35
|
+
.put(`/api/buyer/${urlParams.id}/close`, body, {
|
|
36
|
+
baseURL,
|
|
37
|
+
headers: { Accept: 'application/json', 'Content-Type': 'application/json', ...headers },
|
|
38
|
+
transformResponse: [
|
|
39
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
40
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
|
|
41
|
+
],
|
|
42
|
+
})
|
|
43
|
+
.then((res: CloseBuyerData) => res)
|
|
44
|
+
.catch((err: CloseBuyerError) => {
|
|
45
|
+
throw err;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { Buyer } from '../../../types';
|
|
3
|
+
import qs from 'qs';
|
|
4
|
+
import isNil from 'lodash/isNil';
|
|
5
|
+
|
|
6
|
+
type SuccessData = { success: true; data: Buyer };
|
|
7
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
8
|
+
|
|
9
|
+
type ResultData = SuccessData['data'];
|
|
10
|
+
type ResultError = ErrorData['data']['error'];
|
|
11
|
+
|
|
12
|
+
export type FindBuyerByIdUrlParams = { id: number };
|
|
13
|
+
export type FindBuyerByIdParams = { include?: Array<'sharing.fromExpert'> };
|
|
14
|
+
export type FindBuyerByIdHeaders = { 'x-auth-hc': string };
|
|
15
|
+
export type FindBuyerByIdData = AxiosResponse<ResultData>;
|
|
16
|
+
export type FindBuyerByIdError = AxiosError<ResultError>;
|
|
17
|
+
|
|
18
|
+
export type FindBuyerByIdConfig = {
|
|
19
|
+
baseURL?: string;
|
|
20
|
+
urlParams: FindBuyerByIdUrlParams;
|
|
21
|
+
headers: FindBuyerByIdHeaders;
|
|
22
|
+
params: FindBuyerByIdParams;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export function findBuyerByIdRequest({
|
|
26
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
27
|
+
urlParams,
|
|
28
|
+
headers,
|
|
29
|
+
params,
|
|
30
|
+
}: FindBuyerByIdConfig) {
|
|
31
|
+
const includePostfix = !isNil(params.include)
|
|
32
|
+
? `?${qs.stringify({ include: params.include }, { arrayFormat: 'brackets' })}`
|
|
33
|
+
: '';
|
|
34
|
+
|
|
35
|
+
return axios
|
|
36
|
+
.get(`/api/service-request/${urlParams.id}${includePostfix}`, {
|
|
37
|
+
baseURL,
|
|
38
|
+
headers: { Accept: 'application/json', ...headers },
|
|
39
|
+
transformResponse: [
|
|
40
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
41
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
|
|
42
|
+
],
|
|
43
|
+
})
|
|
44
|
+
.then((res: FindBuyerByIdData) => res)
|
|
45
|
+
.catch((err: FindBuyerByIdError) => {
|
|
46
|
+
throw err;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import qs from 'qs';
|
|
3
|
+
import { BuyerStatusHistory } from '../../../types';
|
|
4
|
+
|
|
5
|
+
type SuccessData = { success: true; data: BuyerStatusHistory[]; pageParams: { length: number; page: number } };
|
|
6
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
7
|
+
|
|
8
|
+
type ResultData = { ids: number[]; byId: Record<string, BuyerStatusHistory>; meta: { total: number } };
|
|
9
|
+
type ResultError = string;
|
|
10
|
+
|
|
11
|
+
export type FindBuyerStatusesHeaders = { 'x-auth-hc': string };
|
|
12
|
+
export type FindBuyerStatusesParams = {
|
|
13
|
+
limits?: { page?: number; count?: number | 'all' };
|
|
14
|
+
sorting?: { type: 'changedAt' | 'deadlineAt'; direction: 'asc' | 'desc' };
|
|
15
|
+
};
|
|
16
|
+
export type FindBuyerStatusesData = AxiosResponse<ResultData>;
|
|
17
|
+
export type FindBuyerStatusesError = AxiosError<ResultError>;
|
|
18
|
+
export type FindBuyerStatusesUrlParams = { id: number };
|
|
19
|
+
export type FindBuyerStatusesConfig = {
|
|
20
|
+
baseURL?: string;
|
|
21
|
+
headers: FindBuyerStatusesHeaders;
|
|
22
|
+
urlParams: FindBuyerStatusesUrlParams;
|
|
23
|
+
params: FindBuyerStatusesParams;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function findBuyerStatusesRequest({
|
|
27
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
28
|
+
urlParams,
|
|
29
|
+
headers,
|
|
30
|
+
params,
|
|
31
|
+
}: FindBuyerStatusesConfig) {
|
|
32
|
+
return axios
|
|
33
|
+
.get(`/api/buyer/${urlParams.id}/status`, {
|
|
34
|
+
baseURL,
|
|
35
|
+
params,
|
|
36
|
+
paramsSerializer: params => qs.stringify(params, { arrayFormat: 'brackets' }),
|
|
37
|
+
headers: { Accept: 'application/json', ...headers },
|
|
38
|
+
transformResponse: [
|
|
39
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
40
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => {
|
|
41
|
+
if (data.success) {
|
|
42
|
+
const ids: ResultData['ids'] = [];
|
|
43
|
+
const byId: ResultData['byId'] = {};
|
|
44
|
+
|
|
45
|
+
data.data.forEach(entity => {
|
|
46
|
+
byId[entity.id] = entity;
|
|
47
|
+
ids.push(entity.id);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
return { ids, byId, meta: { total: data.pageParams.length } };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return data.data.error;
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
})
|
|
57
|
+
.then((res: FindBuyerStatusesData) => res)
|
|
58
|
+
.catch((err: FindBuyerStatusesError) => {
|
|
59
|
+
throw err;
|
|
60
|
+
});
|
|
61
|
+
}
|