@hapl/api-queries 0.1.111 → 0.1.112
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 +116 -4
- 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 +116 -4
- package/dist/api-queries.esm.js.map +1 -1
- package/dist/clients/v1/api/index.d.ts +2 -0
- package/dist/clients/v1/api/serviceRequest/createServiceRequestActivity/index.d.ts +33 -0
- package/dist/clients/v1/api/serviceRequest/findServiceRequestActivities/index.d.ts +36 -0
- package/dist/clients/v1/dictionaries/ServiceRequestActivity.d.ts +24 -0
- package/dist/clients/v1/dictionaries/index.d.ts +1 -0
- package/dist/clients/v1/index.d.ts +2 -0
- package/dist/clients/v1/types/ServiceRequestActivity.d.ts +38 -0
- package/dist/clients/v1/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/clients/v1/api/index.ts +2 -0
- package/src/clients/v1/api/serviceRequest/createServiceRequestActivity/index.ts +43 -0
- package/src/clients/v1/api/serviceRequest/findServiceRequestActivities/index.ts +62 -0
- package/src/clients/v1/dictionaries/ServiceRequestActivity.ts +25 -0
- package/src/clients/v1/dictionaries/index.ts +1 -0
- package/src/clients/v1/index.ts +14 -0
- package/src/clients/v1/types/ServiceRequestActivity.ts +38 -0
- package/src/clients/v1/types/index.ts +1 -0
|
@@ -29,11 +29,13 @@ export * from './experts/updateExpertCase';
|
|
|
29
29
|
export * from './serviceRequest/closeServiceRequest';
|
|
30
30
|
export * from './serviceRequest/completeServiceRequestModeration';
|
|
31
31
|
export * from './serviceRequest/createServiceRequest';
|
|
32
|
+
export * from './serviceRequest/createServiceRequestActivity';
|
|
32
33
|
export * from './serviceRequest/createServiceRequestCategorizedFile';
|
|
33
34
|
export * from './serviceRequest/deferServiceRequest';
|
|
34
35
|
export * from './serviceRequest/deleteServiceRequestCategorizedFile';
|
|
35
36
|
export * from './serviceRequest/deleteServiceRequestReportForSeller';
|
|
36
37
|
export * from './serviceRequest/extendServiceRequestByRealty';
|
|
38
|
+
export * from './serviceRequest/findServiceRequestActivities';
|
|
37
39
|
export * from './serviceRequest/findServiceRequestById';
|
|
38
40
|
export * from './serviceRequest/findServiceRequestDuplicates';
|
|
39
41
|
export * from './serviceRequest/findServiceRequests';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AxiosResponse, AxiosError } from 'axios';
|
|
2
|
+
import { ServiceRequestActivity, ServiceRequestActivityType } from '../../../types';
|
|
3
|
+
declare type SuccessData = {
|
|
4
|
+
success: true;
|
|
5
|
+
data: ServiceRequestActivity;
|
|
6
|
+
};
|
|
7
|
+
declare type ErrorData = {
|
|
8
|
+
success: false;
|
|
9
|
+
data: {
|
|
10
|
+
error: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
declare type ResultData = SuccessData['data'];
|
|
14
|
+
declare type ResultError = ErrorData['data']['error'];
|
|
15
|
+
export declare type CreateServiceRequestActivityHeaders = {
|
|
16
|
+
'x-auth-hc': string;
|
|
17
|
+
};
|
|
18
|
+
export declare type CreateServiceRequestActivityBody = {
|
|
19
|
+
serviceRequest: {
|
|
20
|
+
id: number;
|
|
21
|
+
};
|
|
22
|
+
text: string;
|
|
23
|
+
type: ServiceRequestActivityType;
|
|
24
|
+
};
|
|
25
|
+
export declare type CreateServiceRequestActivityData = AxiosResponse<ResultData>;
|
|
26
|
+
export declare type CreateServiceRequestActivityError = AxiosError<ResultError>;
|
|
27
|
+
export declare type CreateServiceRequestActivityConfig = {
|
|
28
|
+
baseURL?: string;
|
|
29
|
+
headers: CreateServiceRequestActivityHeaders;
|
|
30
|
+
body: CreateServiceRequestActivityBody;
|
|
31
|
+
};
|
|
32
|
+
export declare function createServiceRequestActivityRequest({ baseURL, body, headers, }: CreateServiceRequestActivityConfig): Promise<CreateServiceRequestActivityData>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AxiosResponse, AxiosError } from 'axios';
|
|
2
|
+
import { ServiceRequestActivity, ServiceRequestActivityType } from '../../../types';
|
|
3
|
+
declare type ResultData = {
|
|
4
|
+
ids: number[];
|
|
5
|
+
byId: Record<string, ServiceRequestActivity>;
|
|
6
|
+
meta: {
|
|
7
|
+
total: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
declare type ResultError = string;
|
|
11
|
+
export declare type FindServiceRequestActivitiesHeaders = {
|
|
12
|
+
'x-auth-hc': string;
|
|
13
|
+
};
|
|
14
|
+
export declare type FindServiceRequestActivitiesParams = {
|
|
15
|
+
filter?: {
|
|
16
|
+
'serviceRequest.id': number;
|
|
17
|
+
type?: ServiceRequestActivityType;
|
|
18
|
+
};
|
|
19
|
+
limits?: {
|
|
20
|
+
page?: number;
|
|
21
|
+
count: number | 'all';
|
|
22
|
+
};
|
|
23
|
+
sorting?: {
|
|
24
|
+
direction: 'asc' | 'desc';
|
|
25
|
+
type: 'createdAt';
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare type FindServiceRequestActivitiesData = AxiosResponse<ResultData>;
|
|
29
|
+
export declare type FindServiceRequestActivitiesError = AxiosError<ResultError>;
|
|
30
|
+
export declare type FindServiceRequestActivitiesConfig = {
|
|
31
|
+
baseURL?: string;
|
|
32
|
+
headers: FindServiceRequestActivitiesHeaders;
|
|
33
|
+
params: FindServiceRequestActivitiesParams;
|
|
34
|
+
};
|
|
35
|
+
export declare function findServiceRequestActivitiesRequest({ baseURL, headers, params, }: FindServiceRequestActivitiesConfig): Promise<FindServiceRequestActivitiesData>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ServiceRequestActivityType } from '../types';
|
|
2
|
+
export declare const ServiceRequestActivityDictionary: {
|
|
3
|
+
Type: {
|
|
4
|
+
comment: string;
|
|
5
|
+
edit: string;
|
|
6
|
+
call: string;
|
|
7
|
+
task: string;
|
|
8
|
+
status: string;
|
|
9
|
+
object_request: string;
|
|
10
|
+
contract: string;
|
|
11
|
+
publish: string;
|
|
12
|
+
"publication-problem": string;
|
|
13
|
+
"contract-expired": string;
|
|
14
|
+
"marked-up": string;
|
|
15
|
+
"expert-created": string;
|
|
16
|
+
"price-changed": string;
|
|
17
|
+
"request-price-down": string;
|
|
18
|
+
"call-task-created": string;
|
|
19
|
+
"realty-show-scheduled": string;
|
|
20
|
+
"realty-show-rescheduled": string;
|
|
21
|
+
"realty-show-completed": string;
|
|
22
|
+
"realty-show-cancelled": string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -11,6 +11,7 @@ export * from './File';
|
|
|
11
11
|
export * from './GalleryImage';
|
|
12
12
|
export * from './Realty';
|
|
13
13
|
export * from './ServiceRequest';
|
|
14
|
+
export * from './ServiceRequestActivity';
|
|
14
15
|
export * from './ServiceRequestCategorizedFile';
|
|
15
16
|
export * from './Shape';
|
|
16
17
|
export * from './Task';
|
|
@@ -33,11 +33,13 @@ export declare class Api {
|
|
|
33
33
|
closeServiceRequest: (urlParams: api.CloseServiceRequestUrlParams, body: api.CloseServiceRequestBody, headers: api.CloseServiceRequestHeaders) => Promise<api.CloseServiceRequestData>;
|
|
34
34
|
completeServiceRequestModeration: (urlParams: api.CompleteServiceRequestModerationUrlParams, headers: api.CompleteServiceRequestModerationHeaders) => Promise<api.CompleteServiceRequestModerationData>;
|
|
35
35
|
createServiceRequest: (body: api.CreateServiceRequestBody, headers: api.CreateServiceRequestHeaders) => Promise<api.CreateServiceRequestData>;
|
|
36
|
+
createServiceRequestActivity: (body: api.CreateServiceRequestActivityBody, headers: api.CreateServiceRequestActivityHeaders) => Promise<api.CreateServiceRequestActivityData>;
|
|
36
37
|
createServiceRequestCategorizedFile: (urlParams: api.CreateServiceRequestCategorizedFileUrlParams, body: api.CreateServiceRequestCategorizedFileBody, headers: api.CreateServiceRequestCategorizedFileHeaders) => Promise<api.CreateServiceRequestCategorizedFileData>;
|
|
37
38
|
deferServiceRequest: (body: api.DeferServiceRequestBody, headers: api.DeferServiceRequestHeaders) => Promise<api.DeferServiceRequestData>;
|
|
38
39
|
deleteServiceRequestCategorizedFile: (urlParams: api.DeleteServiceRequestCategorizedFileUrlParams, headers: api.DeleteServiceRequestCategorizedFileHeaders) => Promise<api.DeleteServiceRequestCategorizedFileData>;
|
|
39
40
|
deleteServiceRequestReportForSeller: (urlParams: api.DeleteServiceRequestReportForSellerUrlParams, headers: api.DeleteServiceRequestReportForSellerHeaders) => Promise<api.DeleteServiceRequestReportForSellerData>;
|
|
40
41
|
extendServiceRequestByRealty: (urlParams: api.ExtendServiceRequestByRealtyUrlParams, body: api.ExtendServiceRequestByRealtyBody, headers: api.ExtendServiceRequestByRealtyHeaders) => Promise<api.ExtendServiceRequestByRealtyData>;
|
|
42
|
+
findServiceRequestActivities: (params: api.FindServiceRequestActivitiesParams, headers: api.FindServiceRequestActivitiesHeaders) => Promise<api.FindServiceRequestActivitiesData>;
|
|
41
43
|
findServiceRequestById: (urlParams: api.FindServiceRequestByIdUrlParams, headers: api.FindServiceRequestByIdHeaders) => Promise<api.FindServiceRequestByIdData>;
|
|
42
44
|
findServiceRequestDuplicates: (body: api.FindServiceRequestDuplicatesBody, headers: api.FindServiceRequestDuplicatesHeaders) => Promise<api.FindServiceRequestDuplicatesData>;
|
|
43
45
|
findServiceRequests: (params: api.FindServiceRequestsParams, headers: api.FindServiceRequestsHeaders) => Promise<api.FindServiceRequestsData>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Call } from './Call';
|
|
2
|
+
import { ServiceRequest } from './ServiceRequest';
|
|
3
|
+
import { User } from './User';
|
|
4
|
+
export declare enum ServiceRequestActivityType {
|
|
5
|
+
Comment = "comment",
|
|
6
|
+
Edit = "edit",
|
|
7
|
+
Call = "call",
|
|
8
|
+
Task = "task",
|
|
9
|
+
Status = "status",
|
|
10
|
+
ObjectRequest = "object_request",
|
|
11
|
+
Contract = "contract",
|
|
12
|
+
Publish = "publish",
|
|
13
|
+
PublicationProblem = "publication-problem",
|
|
14
|
+
ContractExpired = "contract-expired",
|
|
15
|
+
MarkedUp = "marked-up",
|
|
16
|
+
ExpertCreated = "expert-created",
|
|
17
|
+
PriceChanged = "price-changed",
|
|
18
|
+
RequestPriceDown = "request-price-down",
|
|
19
|
+
CallTaskCreated = "call-task-created",
|
|
20
|
+
RealtyShowScheduled = "realty-show-scheduled",
|
|
21
|
+
RealtyShowRescheduled = "realty-show-rescheduled",
|
|
22
|
+
RealtyShowCompleted = "realty-show-completed",
|
|
23
|
+
RealtyShowCancelled = "realty-show-cancelled"
|
|
24
|
+
}
|
|
25
|
+
export declare type ServiceRequestActivity = {
|
|
26
|
+
createdAt: string;
|
|
27
|
+
id: number;
|
|
28
|
+
text: string;
|
|
29
|
+
type: ServiceRequestActivityType;
|
|
30
|
+
author?: Partial<User> & Required<Pick<User, 'id'>>;
|
|
31
|
+
buyer?: {
|
|
32
|
+
name: string;
|
|
33
|
+
};
|
|
34
|
+
call?: Partial<Call> & Required<Pick<Call, 'id'>>;
|
|
35
|
+
serviceRequest?: Partial<ServiceRequest> & Required<Pick<ServiceRequest, 'id'>>;
|
|
36
|
+
user?: Partial<User> & Required<Pick<User, 'id'>>;
|
|
37
|
+
viewedAt?: string;
|
|
38
|
+
};
|
|
@@ -17,6 +17,7 @@ export * from './Income';
|
|
|
17
17
|
export * from './Realty';
|
|
18
18
|
export * from './RealtyOffer';
|
|
19
19
|
export * from './ServiceRequest';
|
|
20
|
+
export * from './ServiceRequestActivity';
|
|
20
21
|
export * from './ServiceRequestShortInfo';
|
|
21
22
|
export * from './ServiceRequestCategorizedFile';
|
|
22
23
|
export * from './Shape';
|
package/package.json
CHANGED
|
@@ -37,11 +37,13 @@ export * from './experts/updateExpertCase';
|
|
|
37
37
|
export * from './serviceRequest/closeServiceRequest';
|
|
38
38
|
export * from './serviceRequest/completeServiceRequestModeration';
|
|
39
39
|
export * from './serviceRequest/createServiceRequest';
|
|
40
|
+
export * from './serviceRequest/createServiceRequestActivity';
|
|
40
41
|
export * from './serviceRequest/createServiceRequestCategorizedFile';
|
|
41
42
|
export * from './serviceRequest/deferServiceRequest';
|
|
42
43
|
export * from './serviceRequest/deleteServiceRequestCategorizedFile';
|
|
43
44
|
export * from './serviceRequest/deleteServiceRequestReportForSeller';
|
|
44
45
|
export * from './serviceRequest/extendServiceRequestByRealty';
|
|
46
|
+
export * from './serviceRequest/findServiceRequestActivities';
|
|
45
47
|
export * from './serviceRequest/findServiceRequestById';
|
|
46
48
|
export * from './serviceRequest/findServiceRequestDuplicates';
|
|
47
49
|
export * from './serviceRequest/findServiceRequests';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { ServiceRequestActivity, ServiceRequestActivityType } from '../../../types';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true; data: ServiceRequestActivity };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = SuccessData['data'];
|
|
8
|
+
type ResultError = ErrorData['data']['error'];
|
|
9
|
+
|
|
10
|
+
export type CreateServiceRequestActivityHeaders = { 'x-auth-hc': string };
|
|
11
|
+
export type CreateServiceRequestActivityBody = {
|
|
12
|
+
serviceRequest: { id: number };
|
|
13
|
+
text: string;
|
|
14
|
+
type: ServiceRequestActivityType;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type CreateServiceRequestActivityData = AxiosResponse<ResultData>;
|
|
18
|
+
export type CreateServiceRequestActivityError = AxiosError<ResultError>;
|
|
19
|
+
export type CreateServiceRequestActivityConfig = {
|
|
20
|
+
baseURL?: string;
|
|
21
|
+
headers: CreateServiceRequestActivityHeaders;
|
|
22
|
+
body: CreateServiceRequestActivityBody;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export function createServiceRequestActivityRequest({
|
|
26
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
27
|
+
body,
|
|
28
|
+
headers,
|
|
29
|
+
}: CreateServiceRequestActivityConfig) {
|
|
30
|
+
return axios
|
|
31
|
+
.post('/api/service-request/activity', body, {
|
|
32
|
+
baseURL,
|
|
33
|
+
headers: { Accept: 'application/json', 'Content-Type': 'application/json', ...headers },
|
|
34
|
+
transformResponse: [
|
|
35
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
36
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
|
|
37
|
+
],
|
|
38
|
+
})
|
|
39
|
+
.then((res: CreateServiceRequestActivityData) => res)
|
|
40
|
+
.catch((err: CreateServiceRequestActivityError) => {
|
|
41
|
+
throw err;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import qs from 'qs';
|
|
3
|
+
import { ServiceRequestActivity, ServiceRequestActivityType } from '../../../types';
|
|
4
|
+
|
|
5
|
+
type SuccessData = { success: true; data: ServiceRequestActivity[]; pageParams: { page: number; length: number } };
|
|
6
|
+
type ErrorData = { success: false; data: Record<'error' | 'message', string> };
|
|
7
|
+
|
|
8
|
+
type ResultData = { ids: number[]; byId: Record<string, ServiceRequestActivity>; meta: { total: number } };
|
|
9
|
+
type ResultError = string;
|
|
10
|
+
|
|
11
|
+
export type FindServiceRequestActivitiesHeaders = { 'x-auth-hc': string };
|
|
12
|
+
export type FindServiceRequestActivitiesParams = {
|
|
13
|
+
filter?: {
|
|
14
|
+
'serviceRequest.id': number;
|
|
15
|
+
type?: ServiceRequestActivityType;
|
|
16
|
+
};
|
|
17
|
+
limits?: { page?: number; count: number | 'all' };
|
|
18
|
+
sorting?: { direction: 'asc' | 'desc'; type: 'createdAt' };
|
|
19
|
+
};
|
|
20
|
+
export type FindServiceRequestActivitiesData = AxiosResponse<ResultData>;
|
|
21
|
+
export type FindServiceRequestActivitiesError = AxiosError<ResultError>;
|
|
22
|
+
export type FindServiceRequestActivitiesConfig = {
|
|
23
|
+
baseURL?: string;
|
|
24
|
+
headers: FindServiceRequestActivitiesHeaders;
|
|
25
|
+
params: FindServiceRequestActivitiesParams;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export function findServiceRequestActivitiesRequest({
|
|
29
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
30
|
+
headers,
|
|
31
|
+
params,
|
|
32
|
+
}: FindServiceRequestActivitiesConfig) {
|
|
33
|
+
return axios
|
|
34
|
+
.get('/api/service-request/activity', {
|
|
35
|
+
baseURL,
|
|
36
|
+
params,
|
|
37
|
+
paramsSerializer: params => qs.stringify(params, { arrayFormat: 'brackets' }),
|
|
38
|
+
headers: { Accept: 'application/json', ...headers },
|
|
39
|
+
transformResponse: [
|
|
40
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
41
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => {
|
|
42
|
+
if (data.success) {
|
|
43
|
+
const ids: ResultData['ids'] = [];
|
|
44
|
+
const byId: ResultData['byId'] = {};
|
|
45
|
+
|
|
46
|
+
data.data.forEach(entity => {
|
|
47
|
+
byId[entity.id] = entity;
|
|
48
|
+
ids.push(entity.id);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
return { ids, byId, meta: { total: data.pageParams.length } };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return data.data.error || data.data.message;
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
})
|
|
58
|
+
.then((res: FindServiceRequestActivitiesData) => res)
|
|
59
|
+
.catch((err: FindServiceRequestActivitiesError) => {
|
|
60
|
+
throw err;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ServiceRequestActivityType } from '../types';
|
|
2
|
+
|
|
3
|
+
export const ServiceRequestActivityDictionary = {
|
|
4
|
+
Type: {
|
|
5
|
+
[ServiceRequestActivityType.Comment]: 'Коментарий',
|
|
6
|
+
[ServiceRequestActivityType.Edit]: 'Изменения',
|
|
7
|
+
[ServiceRequestActivityType.Call]: 'Звонок',
|
|
8
|
+
[ServiceRequestActivityType.Task]: 'Задача',
|
|
9
|
+
[ServiceRequestActivityType.Status]: 'Статус',
|
|
10
|
+
[ServiceRequestActivityType.ObjectRequest]: 'Обращение на объект',
|
|
11
|
+
[ServiceRequestActivityType.Contract]: 'Контракт',
|
|
12
|
+
[ServiceRequestActivityType.Publish]: 'Публикация',
|
|
13
|
+
[ServiceRequestActivityType.PublicationProblem]: 'Ошибка при публикации',
|
|
14
|
+
[ServiceRequestActivityType.ContractExpired]: 'Срок контракта истекает',
|
|
15
|
+
[ServiceRequestActivityType.MarkedUp]: 'Разметка',
|
|
16
|
+
[ServiceRequestActivityType.ExpertCreated]: 'Создан эксперт',
|
|
17
|
+
[ServiceRequestActivityType.PriceChanged]: 'Изменена цена',
|
|
18
|
+
[ServiceRequestActivityType.RequestPriceDown]: 'Запрос на снижение цены цены',
|
|
19
|
+
[ServiceRequestActivityType.CallTaskCreated]: 'Обращениие создано',
|
|
20
|
+
[ServiceRequestActivityType.RealtyShowScheduled]: 'Показ объекта запланирован',
|
|
21
|
+
[ServiceRequestActivityType.RealtyShowRescheduled]: 'Показ объекта перенесен',
|
|
22
|
+
[ServiceRequestActivityType.RealtyShowCompleted]: 'Показ объекта выполнен',
|
|
23
|
+
[ServiceRequestActivityType.RealtyShowCancelled]: 'Показ объекта отменен',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -11,6 +11,7 @@ export * from './File';
|
|
|
11
11
|
export * from './GalleryImage';
|
|
12
12
|
export * from './Realty';
|
|
13
13
|
export * from './ServiceRequest';
|
|
14
|
+
export * from './ServiceRequestActivity';
|
|
14
15
|
export * from './ServiceRequestCategorizedFile';
|
|
15
16
|
export * from './Shape';
|
|
16
17
|
export * from './Task';
|
package/src/clients/v1/index.ts
CHANGED
|
@@ -186,6 +186,13 @@ export class Api {
|
|
|
186
186
|
return api.createServiceRequestRequest({ body, headers, baseURL: this.baseURL });
|
|
187
187
|
};
|
|
188
188
|
|
|
189
|
+
createServiceRequestActivity = (
|
|
190
|
+
body: api.CreateServiceRequestActivityBody,
|
|
191
|
+
headers: api.CreateServiceRequestActivityHeaders
|
|
192
|
+
) => {
|
|
193
|
+
return api.createServiceRequestActivityRequest({ body, headers, baseURL: this.baseURL });
|
|
194
|
+
};
|
|
195
|
+
|
|
189
196
|
createServiceRequestCategorizedFile = (
|
|
190
197
|
urlParams: api.CreateServiceRequestCategorizedFileUrlParams,
|
|
191
198
|
body: api.CreateServiceRequestCategorizedFileBody,
|
|
@@ -220,6 +227,13 @@ export class Api {
|
|
|
220
227
|
return api.extendServiceRequestByRealtyRequest({ urlParams, body, headers, baseURL: this.baseURL });
|
|
221
228
|
};
|
|
222
229
|
|
|
230
|
+
findServiceRequestActivities = (
|
|
231
|
+
params: api.FindServiceRequestActivitiesParams,
|
|
232
|
+
headers: api.FindServiceRequestActivitiesHeaders
|
|
233
|
+
) => {
|
|
234
|
+
return api.findServiceRequestActivitiesRequest({ params, headers, baseURL: this.baseURL });
|
|
235
|
+
};
|
|
236
|
+
|
|
223
237
|
findServiceRequestById = (
|
|
224
238
|
urlParams: api.FindServiceRequestByIdUrlParams,
|
|
225
239
|
headers: api.FindServiceRequestByIdHeaders
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Call } from './Call';
|
|
2
|
+
import { ServiceRequest } from './ServiceRequest';
|
|
3
|
+
import { User } from './User';
|
|
4
|
+
|
|
5
|
+
export enum ServiceRequestActivityType {
|
|
6
|
+
Comment = 'comment',
|
|
7
|
+
Edit = 'edit',
|
|
8
|
+
Call = 'call',
|
|
9
|
+
Task = 'task',
|
|
10
|
+
Status = 'status',
|
|
11
|
+
ObjectRequest = 'object_request',
|
|
12
|
+
Contract = 'contract',
|
|
13
|
+
Publish = 'publish',
|
|
14
|
+
PublicationProblem = 'publication-problem',
|
|
15
|
+
ContractExpired = 'contract-expired',
|
|
16
|
+
MarkedUp = 'marked-up',
|
|
17
|
+
ExpertCreated = 'expert-created',
|
|
18
|
+
PriceChanged = 'price-changed',
|
|
19
|
+
RequestPriceDown = 'request-price-down',
|
|
20
|
+
CallTaskCreated = 'call-task-created',
|
|
21
|
+
RealtyShowScheduled = 'realty-show-scheduled',
|
|
22
|
+
RealtyShowRescheduled = 'realty-show-rescheduled',
|
|
23
|
+
RealtyShowCompleted = 'realty-show-completed',
|
|
24
|
+
RealtyShowCancelled = 'realty-show-cancelled',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type ServiceRequestActivity = {
|
|
28
|
+
createdAt: string;
|
|
29
|
+
id: number;
|
|
30
|
+
text: string;
|
|
31
|
+
type: ServiceRequestActivityType;
|
|
32
|
+
author?: Partial<User> & Required<Pick<User, 'id'>>;
|
|
33
|
+
buyer?: { name: string };
|
|
34
|
+
call?: Partial<Call> & Required<Pick<Call, 'id'>>;
|
|
35
|
+
serviceRequest?: Partial<ServiceRequest> & Required<Pick<ServiceRequest, 'id'>>;
|
|
36
|
+
user?: Partial<User> & Required<Pick<User, 'id'>>;
|
|
37
|
+
viewedAt?: string;
|
|
38
|
+
};
|
|
@@ -17,6 +17,7 @@ export * from './Income';
|
|
|
17
17
|
export * from './Realty';
|
|
18
18
|
export * from './RealtyOffer';
|
|
19
19
|
export * from './ServiceRequest';
|
|
20
|
+
export * from './ServiceRequestActivity';
|
|
20
21
|
export * from './ServiceRequestShortInfo';
|
|
21
22
|
export * from './ServiceRequestCategorizedFile';
|
|
22
23
|
export * from './Shape';
|