@hapl/api-queries 1.0.3--canary.225.8595228.0 → 1.0.3

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.
Files changed (41) hide show
  1. package/dist/api-queries.cjs.development.js +1377 -1363
  2. package/dist/api-queries.cjs.development.js.map +1 -1
  3. package/dist/api-queries.cjs.production.min.js +1 -1
  4. package/dist/api-queries.cjs.production.min.js.map +1 -1
  5. package/dist/api-queries.esm.js +1377 -1363
  6. package/dist/api-queries.esm.js.map +1 -1
  7. package/dist/clients/v1/api/contract/updateContractDocument.d.ts +1 -1
  8. package/dist/clients/v1/api/payslip/findPayslipById.d.ts +29 -0
  9. package/dist/clients/v1/api/payslip/findPayslips.d.ts +56 -0
  10. package/dist/clients/v1/api/payslip/updatePayslip.d.ts +35 -0
  11. package/dist/clients/v1/api.d.ts +3 -2
  12. package/dist/clients/v1/dictionaries.d.ts +0 -1
  13. package/dist/clients/v1/index.d.ts +4 -3
  14. package/dist/clients/v1/types/Contract.d.ts +2 -2
  15. package/dist/clients/v1/types/Payslip.d.ts +61 -0
  16. package/dist/clients/v1/types/ServiceRequest.d.ts +1 -1
  17. package/dist/clients/v1/types.d.ts +1 -3
  18. package/package.json +1 -1
  19. package/src/clients/v1/api/contract/updateContractDocument.ts +1 -1
  20. package/src/clients/v1/api/payslip/findPayslipById.ts +36 -0
  21. package/src/clients/v1/api/payslip/findPayslips.ts +54 -0
  22. package/src/clients/v1/api/payslip/updatePayslip.ts +41 -0
  23. package/src/clients/v1/api.ts +4 -2
  24. package/src/clients/v1/dictionaries.ts +0 -1
  25. package/src/clients/v1/index.ts +19 -16
  26. package/src/clients/v1/types/Contract.ts +3 -2
  27. package/src/clients/v1/types/Payslip.ts +62 -0
  28. package/src/clients/v1/types/ServiceRequest.ts +1 -1
  29. package/src/clients/v1/types.ts +1 -3
  30. package/dist/clients/v1/api/deal/findDealExpertBonuses.d.ts +0 -60
  31. package/dist/clients/v1/api/deal/updateDealExpertBonus.d.ts +0 -33
  32. package/dist/clients/v1/dictionaries/DealExpertBonusFixedExpense.d.ts +0 -22
  33. package/dist/clients/v1/types/DealExpertBonus.d.ts +0 -15
  34. package/dist/clients/v1/types/DealExpertBonusExpenseOverrride.d.ts +0 -10
  35. package/dist/clients/v1/types/DealExpertBonusFixedExpense.d.ts +0 -26
  36. package/src/clients/v1/api/deal/findDealExpertBonuses.ts +0 -77
  37. package/src/clients/v1/api/deal/updateDealExpertBonus.ts +0 -44
  38. package/src/clients/v1/dictionaries/DealExpertBonusFixedExpense.ts +0 -26
  39. package/src/clients/v1/types/DealExpertBonus.ts +0 -17
  40. package/src/clients/v1/types/DealExpertBonusExpenseOverrride.ts +0 -11
  41. package/src/clients/v1/types/DealExpertBonusFixedExpense.ts +0 -31
@@ -14,7 +14,7 @@ export declare type UpdateContractDocumentUrlParams = {
14
14
  export declare type UpdateContractDocumentHeaders = {
15
15
  'x-auth-hc': string;
16
16
  };
17
- export declare type UpdateContractDocumentBody = Omit<ContractDocument, 'type' | 'contractNumber' | 'requisites'>;
17
+ export declare type UpdateContractDocumentBody = Omit<ContractDocument, 'contractNumber' | 'requisites'>;
18
18
  export declare type UpdateContractDocumentData = AxiosResponse<ResultData>;
19
19
  export declare type UpdateContractDocumentError = AxiosError<ResultError>;
20
20
  export declare type UpdateContractDocumentConfig = {
@@ -0,0 +1,29 @@
1
+ import { AxiosResponse, AxiosError } from 'axios';
2
+ import { Payslip } from '../../types';
3
+ declare type SuccessData = {
4
+ success: true;
5
+ data: Payslip;
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 FindPayslipByIdUrlParams = {
16
+ id: number;
17
+ };
18
+ export declare type FindPayslipByIdHeaders = {
19
+ 'x-auth-hc': string;
20
+ };
21
+ export declare type FindPayslipByIdData = AxiosResponse<ResultData>;
22
+ export declare type FindPayslipByIdError = AxiosError<ResultError>;
23
+ export declare type FindPayslipByIdConfig = {
24
+ baseURL?: string;
25
+ urlParams: FindPayslipByIdUrlParams;
26
+ headers: FindPayslipByIdHeaders;
27
+ };
28
+ export declare function findPayslipByIdRequest({ baseURL, urlParams, headers }: FindPayslipByIdConfig): Promise<FindPayslipByIdData>;
29
+ export {};
@@ -0,0 +1,56 @@
1
+ import { AxiosResponse, AxiosError } from 'axios';
2
+ import { Payslip } from '../../types';
3
+ declare type SuccessData = {
4
+ success: true;
5
+ data: Payslip[];
6
+ pageParams: {
7
+ page: number;
8
+ length: number;
9
+ };
10
+ };
11
+ declare type ErrorData = {
12
+ success: false;
13
+ data: {
14
+ error: string;
15
+ };
16
+ };
17
+ declare type ResultData = {
18
+ data: SuccessData['data'];
19
+ meta: {
20
+ total: number;
21
+ };
22
+ };
23
+ declare type ResultError = ErrorData['data']['error'];
24
+ export declare type FindPayslipsParams = {
25
+ filter?: {
26
+ dealId?: string | string[];
27
+ 'serviceRequest.id'?: string | string[];
28
+ 'serviceRequest.contract.formalId'?: string;
29
+ 'serviceRequest.curator.id'?: string;
30
+ 'serviceRequest.curator.supervisor.id'?: string;
31
+ closingDate?: string | {
32
+ from?: string;
33
+ to?: string;
34
+ };
35
+ };
36
+ sorting?: {
37
+ type: 'closingDate';
38
+ direction: 'asc' | 'desc';
39
+ };
40
+ limits?: {
41
+ page?: number;
42
+ count?: number | 'all';
43
+ };
44
+ };
45
+ export declare type FindPayslipsHeaders = {
46
+ 'x-auth-hc': string;
47
+ };
48
+ export declare type FindPayslipsData = AxiosResponse<ResultData>;
49
+ export declare type FindPayslipsError = AxiosError<ResultError>;
50
+ export declare type FindPayslipsConfig = {
51
+ baseURL?: string;
52
+ params: FindPayslipsParams;
53
+ headers: FindPayslipsHeaders;
54
+ };
55
+ export declare function findPayslipsRequest({ baseURL, headers, params }: FindPayslipsConfig): Promise<FindPayslipsData>;
56
+ export {};
@@ -0,0 +1,35 @@
1
+ import { AxiosResponse, AxiosError } from 'axios';
2
+ import { Payslip } from '../../types';
3
+ declare type SuccessData = {
4
+ success: true;
5
+ data: Payslip;
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 UpdatePayslipHeaders = {
16
+ 'x-auth-hc': string;
17
+ };
18
+ export declare type UpdatePayslipUrlParams = {
19
+ id: number;
20
+ };
21
+ export declare type UpdatePayslipBody = {
22
+ financeAdjustment?: number;
23
+ financeComment?: string;
24
+ ifFinalNotification: boolean;
25
+ };
26
+ export declare type UpdatePayslipData = AxiosResponse<ResultData>;
27
+ export declare type UpdatePayslipError = AxiosError<ResultError>;
28
+ export declare type UpdatePayslipConfig = {
29
+ baseURL?: string;
30
+ body: UpdatePayslipBody;
31
+ urlParams: UpdatePayslipUrlParams;
32
+ headers: UpdatePayslipHeaders;
33
+ };
34
+ export declare function updatePayslipRequest({ baseURL, urlParams, body, headers }: UpdatePayslipConfig): Promise<UpdatePayslipData>;
35
+ export {};
@@ -85,7 +85,6 @@ export * from './api/deal/createDealInvestPrepayment';
85
85
  export * from './api/deal/deleteDealCategorizedFile';
86
86
  export * from './api/deal/findDealById';
87
87
  export * from './api/deal/findDealCategorizedFiles';
88
- export * from './api/deal/findDealExpertBonuses';
89
88
  export * from './api/deal/findDealExpertStatistics';
90
89
  export * from './api/deal/findDeals';
91
90
  export * from './api/deal/setDealClassificationScore';
@@ -99,7 +98,6 @@ export * from './api/deal/setDealSignPlannedState';
99
98
  export * from './api/deal/setDealSignedState';
100
99
  export * from './api/deal/terminateDeal';
101
100
  export * from './api/deal/updateDeal';
102
- export * from './api/deal/updateDealExpertBonus';
103
101
  export * from './api/debt/createDebts';
104
102
  export * from './api/debt/deleteDebt';
105
103
  export * from './api/debt/findDebts';
@@ -141,6 +139,9 @@ export * from './api/leadAssignmentBlock/updateLeadAssignmentBlock';
141
139
  export * from './api/motivation/findMotivationGlossary';
142
140
  export * from './api/motivation/findMotivationStatusByExpertId';
143
141
  export * from './api/motivation/сalculateMotivationCommission';
142
+ export * from './api/payslip/findPayslips';
143
+ export * from './api/payslip/findPayslipById';
144
+ export * from './api/payslip/updatePayslip';
144
145
  export * from './api/phone/findPhones';
145
146
  export * from './api/phone/callbackPhone';
146
147
  export * from './api/phone/blockPhone';
@@ -13,7 +13,6 @@ export * from './dictionaries/CrossSale';
13
13
  export * from './dictionaries/Currency';
14
14
  export * from './dictionaries/Deal';
15
15
  export * from './dictionaries/DealCategorizedFile';
16
- export * from './dictionaries/DealExpertBonusFixedExpense';
17
16
  export * from './dictionaries/DealParticipant';
18
17
  export * from './dictionaries/Debt';
19
18
  export * from './dictionaries/ExpertCategory';
@@ -89,7 +89,6 @@ export declare class Api {
89
89
  deleteDealCategorizedFile: (urlParams: api.DeleteDealCategorizedFileUrlParams, headers: api.DeleteDealCategorizedFileHeaders) => Promise<api.DeleteDealCategorizedFileData>;
90
90
  findDealById: (urlParams: api.FindDealByIdUrlParams, headers: api.FindDealByIdHeaders) => Promise<api.FindDealByIdData>;
91
91
  findDealCategorizedFiles: (urlParams: api.FindDealCategorizedFilesUrlParams, params: api.FindDealCategorizedFilesParams, headers: api.FindDealCategorizedFilesHeaders) => Promise<api.FindDealCategorizedFilesData>;
92
- findDealExpertBonuses: (params: api.FindDealExpertBonusesParams, headers: api.FindDealExpertBonusesHeaders) => Promise<api.FindDealExpertBonusesData>;
93
92
  findDealExpertStatistics: (urlParams: api.FindDealExpertStatisticsUrlParams, params: api.FindDealExpertStatisticsParams, headers: api.FindDealExpertStatisticsHeaders) => Promise<api.FindDealExpertStatisticsData>;
94
93
  findDeals: (params: api.FindDealsParams, headers: api.FindDealsHeaders) => Promise<api.FindDealsData>;
95
94
  setDealClassificationScore: (urlParams: api.SetDealClassificationScoreUrlParams, body: api.SetDealClassificationScoreBody, headers: api.SetDealClassificationScoreHeaders) => Promise<api.SetDealClassificationScoreData>;
@@ -103,7 +102,6 @@ export declare class Api {
103
102
  setDealSignPlannedState: (urlParams: api.SetDealSignPlannedStateUrlParams, body: api.SetDealSignPlannedStateBody, headers: api.SetDealSignPlannedStateHeaders) => Promise<api.SetDealSignPlannedStateData>;
104
103
  terminateDeal: (urlParams: api.TerminateDealUrlParams, body: api.TerminateDealBody, headers: api.TerminateDealHeaders) => Promise<api.TerminateDealData>;
105
104
  updateDeal: (urlParams: api.UpdateDealUrlParams, body: api.UpdateDealBody, headers: api.UpdateDealHeaders) => Promise<api.UpdateDealData>;
106
- updateDealExpertBonus: (urlParams: api.UpdateDealExpertBonusUrlParams, body: api.UpdateDealExpertBonusBody, headers: api.UpdateDealExpertBonusHeaders) => Promise<api.UpdateDealExpertBonusData>;
107
105
  createDebts: (body: api.CreateDebtsBody, headers: api.CreateDebtsHeaders) => Promise<api.CreateDebtsData>;
108
106
  deleteDebt: (urlParams: api.DeleteDebtUrlParams, headers: api.DeleteDebtHeaders) => Promise<api.DeleteDebtData>;
109
107
  findDebts: (params: api.FindDebtsParams, headers: api.FindDebtsHeaders) => Promise<api.FindDebtsData>;
@@ -145,9 +143,12 @@ export declare class Api {
145
143
  calculateMotivationCommission: (body: api.CalculateMotivationCommissionBody, headers: api.CalculateMotivationCommissionHeaders) => Promise<api.CalculateMotivationCommissionData>;
146
144
  findMotivationGlossary: (headers: api.FindMotivationGlossaryHeaders) => Promise<api.FindMotivationGlossaryData>;
147
145
  findMotivationStatusByExpertId: (urlParams: api.FindMotivationStatusByExpertIdUrlParams, headers: api.FindMotivationStatusByExpertIdHeaders) => Promise<api.FindMotivationStatusByExpertIdData>;
146
+ findPayslips: (params: api.FindPayslipsParams, headers: api.FindPayslipsHeaders) => Promise<api.FindPayslipsData>;
147
+ findPayslipById: (urlParams: api.FindPayslipByIdUrlParams, headers: api.FindPayslipByIdHeaders) => Promise<api.FindPayslipByIdData>;
148
+ updatePayslip: (urlParams: api.UpdatePayslipUrlParams, body: api.UpdatePayslipBody, headers: api.UpdatePayslipHeaders) => Promise<api.UpdatePayslipData>;
148
149
  blockPhone: (urlParams: api.BlockPhoneUrlParams, headers: api.BlockPhoneHeaders) => Promise<api.BlockPhoneData>;
149
150
  callbackPhone: (urlParams: api.CallbackPhoneUrlParams, headers: api.CallbackPhoneHeaders) => Promise<api.CallbackPhoneData>;
150
- findPhones: (params: api.FindPhonesParams, headers: api.FindPhonesHeaders) => Promise<api.FindPhonesData>;
151
+ findPhones: (params: api.FindPhonesParams, headers: api.FindPayslipsHeaders) => Promise<api.FindPhonesData>;
151
152
  unblockPhone: (urlParams: api.UnblockPhoneUrlParams, headers: api.UnblockPhoneHeaders) => Promise<api.UnblockPhoneData>;
152
153
  createPhoneBookContact: (body: api.CreatePhoneBookContactBody, headers: api.CreatePhoneBookContactHeaders) => Promise<api.CreatePhoneBookContactData>;
153
154
  findPhoneBookContacts: (params: api.FindPhoneBookContactsParams, headers: api.FindPhoneBookContactsHeaders) => Promise<api.FindPhoneBookContactsData>;
@@ -30,8 +30,6 @@ export declare enum ContractKind {
30
30
  export declare type Contract = {
31
31
  amount: MoneyAmount;
32
32
  createdAt: string;
33
- duration: number;
34
- expiresAt: string;
35
33
  formalId: string;
36
34
  id: number;
37
35
  isFixedCashCommission: boolean;
@@ -49,6 +47,8 @@ export declare type Contract = {
49
47
  canTerminate?: boolean;
50
48
  deal?: Partial<Omit<Deal, 'contract'>> & Required<Pick<Deal, 'id'>>;
51
49
  declinedAt?: string;
50
+ duration?: number;
51
+ expiresAt?: string;
52
52
  reason?: string;
53
53
  signPlannedAt?: string;
54
54
  signedAt?: string;
@@ -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
+ };
@@ -79,7 +79,6 @@ export declare enum ServiceRequestSource {
79
79
  Other = "other"
80
80
  }
81
81
  export declare type ServiceRequest = {
82
- advLink?: string;
83
82
  buyParams: {
84
83
  budget?: number;
85
84
  place?: string;
@@ -116,6 +115,7 @@ export declare type ServiceRequest = {
116
115
  id: number;
117
116
  };
118
117
  verificationStatus: ServiceRequestVerificationStatus;
118
+ advLink?: string;
119
119
  appointment?: Partial<Appointment> & Required<Pick<Appointment, 'id'>>;
120
120
  canBePublishedAt?: string;
121
121
  checkList?: Pick<Checklist, 'id' | 'isComplete' | 'problemCount'>;
@@ -24,9 +24,6 @@ export * from './types/CrossSale';
24
24
  export * from './types/Currency';
25
25
  export * from './types/Deal';
26
26
  export * from './types/DealCategorizedFile';
27
- export * from './types/DealExpertBonus';
28
- export * from './types/DealExpertBonusExpenseOverrride';
29
- export * from './types/DealExpertBonusFixedExpense';
30
27
  export * from './types/DealParticipant';
31
28
  export * from './types/Debt';
32
29
  export * from './types/Event';
@@ -41,6 +38,7 @@ export * from './types/Income';
41
38
  export * from './types/InternalCrossSale';
42
39
  export * from './types/LeadAssignmentBlock';
43
40
  export * from './types/Motivation';
41
+ export * from './types/Payslip';
44
42
  export * from './types/Phone';
45
43
  export * from './types/PhoneBookContact';
46
44
  export * from './types/PhotoOrder';
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.3--canary.225.8595228.0",
2
+ "version": "1.0.3",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -10,7 +10,7 @@ type ResultError = ErrorData['data']['error'];
10
10
 
11
11
  export type UpdateContractDocumentUrlParams = { id: number };
12
12
  export type UpdateContractDocumentHeaders = { 'x-auth-hc': string };
13
- export type UpdateContractDocumentBody = Omit<ContractDocument, 'type' | 'contractNumber' | 'requisites'>;
13
+ export type UpdateContractDocumentBody = Omit<ContractDocument, 'contractNumber' | 'requisites'>;
14
14
 
15
15
  export type UpdateContractDocumentData = AxiosResponse<ResultData>;
16
16
  export type UpdateContractDocumentError = AxiosError<ResultError>;
@@ -0,0 +1,36 @@
1
+ import axios, { AxiosResponse, AxiosError, AxiosResponseTransformer } from 'axios';
2
+ import { Payslip } from '../../types';
3
+ import { DEFAULT_BASE_URL } from '../../../constants';
4
+
5
+ type SuccessData = { success: true; data: Payslip };
6
+ type ErrorData = { success: false; data: { error: string } };
7
+
8
+ type ResultData = SuccessData['data'];
9
+ type ResultError = ErrorData['data']['error'];
10
+
11
+ export type FindPayslipByIdUrlParams = { id: number };
12
+ export type FindPayslipByIdHeaders = { 'x-auth-hc': string };
13
+ export type FindPayslipByIdData = AxiosResponse<ResultData>;
14
+ export type FindPayslipByIdError = AxiosError<ResultError>;
15
+
16
+ export type FindPayslipByIdConfig = {
17
+ baseURL?: string;
18
+ urlParams: FindPayslipByIdUrlParams;
19
+ headers: FindPayslipByIdHeaders;
20
+ };
21
+
22
+ export function findPayslipByIdRequest({ baseURL = DEFAULT_BASE_URL, urlParams, headers }: FindPayslipByIdConfig) {
23
+ return axios
24
+ .get(`/api/payslip/${urlParams.id}`, {
25
+ baseURL,
26
+ headers: { Accept: 'application/json', ...headers },
27
+ transformResponse: [
28
+ ...(axios.defaults.transformResponse as AxiosResponseTransformer[]),
29
+ (data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
30
+ ],
31
+ })
32
+ .then((res: FindPayslipByIdData) => res)
33
+ .catch((err: FindPayslipByIdError) => {
34
+ throw err;
35
+ });
36
+ }
@@ -0,0 +1,54 @@
1
+ import axios, { AxiosResponse, AxiosError, AxiosResponseTransformer } from 'axios';
2
+ import qs from 'qs';
3
+ import { Payslip } from '../../types';
4
+ import { DEFAULT_BASE_URL } from '../../../constants';
5
+
6
+ type SuccessData = { success: true; data: Payslip[]; pageParams: { page: number; length: number } };
7
+ type ErrorData = { success: false; data: { error: string } };
8
+
9
+ type ResultData = { data: SuccessData['data']; meta: { total: number } };
10
+ type ResultError = ErrorData['data']['error'];
11
+
12
+ export type FindPayslipsParams = {
13
+ filter?: {
14
+ dealId?: string | string[];
15
+ 'serviceRequest.id'?: string | string[];
16
+ 'serviceRequest.contract.formalId'?: string;
17
+ 'serviceRequest.curator.id'?: string;
18
+ 'serviceRequest.curator.supervisor.id'?: string;
19
+ closingDate?: string | { from?: string; to?: string };
20
+ };
21
+ sorting?: { type: 'closingDate'; direction: 'asc' | 'desc' };
22
+ limits?: { page?: number; count?: number | 'all' };
23
+ };
24
+
25
+ export type FindPayslipsHeaders = { 'x-auth-hc': string };
26
+ export type FindPayslipsData = AxiosResponse<ResultData>;
27
+ export type FindPayslipsError = AxiosError<ResultError>;
28
+ export type FindPayslipsConfig = {
29
+ baseURL?: string;
30
+ params: FindPayslipsParams;
31
+ headers: FindPayslipsHeaders;
32
+ };
33
+
34
+ export function findPayslipsRequest({ baseURL = DEFAULT_BASE_URL, headers, params }: FindPayslipsConfig) {
35
+ return axios
36
+ .get('/api/payslip', {
37
+ baseURL,
38
+ params,
39
+ paramsSerializer: params => qs.stringify(params, { arrayFormat: 'brackets' }),
40
+ headers: { Accept: 'application/json', ...headers },
41
+ transformResponse: [
42
+ ...(axios.defaults.transformResponse as AxiosResponseTransformer[]),
43
+ (data: SuccessData | ErrorData): ResultData | ResultError => {
44
+ if (!data.success) return data.data.error;
45
+
46
+ return { data: data.data, meta: { total: data.pageParams.length } };
47
+ },
48
+ ],
49
+ })
50
+ .then((res: FindPayslipsData) => res)
51
+ .catch((err: FindPayslipsError) => {
52
+ throw err;
53
+ });
54
+ }
@@ -0,0 +1,41 @@
1
+ import axios, { AxiosResponse, AxiosError, AxiosResponseTransformer } from 'axios';
2
+ import { Payslip } from '../../types';
3
+ import { DEFAULT_BASE_URL } from '../../../constants';
4
+
5
+ type SuccessData = { success: true; data: Payslip };
6
+ type ErrorData = { success: false; data: { error: string } };
7
+
8
+ type ResultData = SuccessData['data'];
9
+ type ResultError = ErrorData['data']['error'];
10
+
11
+ export type UpdatePayslipHeaders = { 'x-auth-hc': string };
12
+ export type UpdatePayslipUrlParams = { id: number };
13
+ export type UpdatePayslipBody = {
14
+ financeAdjustment?: number;
15
+ financeComment?: string;
16
+ ifFinalNotification: boolean;
17
+ };
18
+ export type UpdatePayslipData = AxiosResponse<ResultData>;
19
+ export type UpdatePayslipError = AxiosError<ResultError>;
20
+ export type UpdatePayslipConfig = {
21
+ baseURL?: string;
22
+ body: UpdatePayslipBody;
23
+ urlParams: UpdatePayslipUrlParams;
24
+ headers: UpdatePayslipHeaders;
25
+ };
26
+
27
+ export function updatePayslipRequest({ baseURL = DEFAULT_BASE_URL, urlParams, body, headers }: UpdatePayslipConfig) {
28
+ return axios
29
+ .post(`/api/payslip/${urlParams.id}`, body, {
30
+ baseURL,
31
+ headers: { Accept: 'application/json', 'Content-Type': 'application/json', ...headers },
32
+ transformResponse: [
33
+ ...(axios.defaults.transformResponse as AxiosResponseTransformer[]),
34
+ (data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
35
+ ],
36
+ })
37
+ .then((res: UpdatePayslipData) => res)
38
+ .catch((err: UpdatePayslipError) => {
39
+ throw err;
40
+ });
41
+ }
@@ -101,7 +101,6 @@ export * from './api/deal/createDealInvestPrepayment';
101
101
  export * from './api/deal/deleteDealCategorizedFile';
102
102
  export * from './api/deal/findDealById';
103
103
  export * from './api/deal/findDealCategorizedFiles';
104
- export * from './api/deal/findDealExpertBonuses';
105
104
  export * from './api/deal/findDealExpertStatistics';
106
105
  export * from './api/deal/findDeals';
107
106
  export * from './api/deal/setDealClassificationScore';
@@ -115,7 +114,6 @@ export * from './api/deal/setDealSignPlannedState';
115
114
  export * from './api/deal/setDealSignedState';
116
115
  export * from './api/deal/terminateDeal';
117
116
  export * from './api/deal/updateDeal';
118
- export * from './api/deal/updateDealExpertBonus';
119
117
 
120
118
  export * from './api/debt/createDebts';
121
119
  export * from './api/debt/deleteDebt';
@@ -169,6 +167,10 @@ export * from './api/motivation/findMotivationGlossary';
169
167
  export * from './api/motivation/findMotivationStatusByExpertId';
170
168
  export * from './api/motivation/сalculateMotivationCommission';
171
169
 
170
+ export * from './api/payslip/findPayslips';
171
+ export * from './api/payslip/findPayslipById';
172
+ export * from './api/payslip/updatePayslip';
173
+
172
174
  export * from './api/phone/findPhones';
173
175
  export * from './api/phone/callbackPhone';
174
176
  export * from './api/phone/blockPhone';
@@ -13,7 +13,6 @@ export * from './dictionaries/CrossSale';
13
13
  export * from './dictionaries/Currency';
14
14
  export * from './dictionaries/Deal';
15
15
  export * from './dictionaries/DealCategorizedFile';
16
- export * from './dictionaries/DealExpertBonusFixedExpense';
17
16
  export * from './dictionaries/DealParticipant';
18
17
  export * from './dictionaries/Debt';
19
18
  export * from './dictionaries/ExpertCategory';
@@ -531,13 +531,6 @@ export class Api {
531
531
  return api.findDealCategorizedFilesRequest({ urlParams, params, headers, baseURL: await this.baseURL });
532
532
  };
533
533
 
534
- findDealExpertBonuses = async (
535
- params: api.FindDealExpertBonusesParams,
536
- headers: api.FindDealExpertBonusesHeaders
537
- ) => {
538
- return api.findDealExpertBonusesRequest({ params, headers, baseURL: await this.baseURL });
539
- };
540
-
541
534
  findDealExpertStatistics = async (
542
535
  urlParams: api.FindDealExpertStatisticsUrlParams,
543
536
  params: api.FindDealExpertStatisticsParams,
@@ -629,14 +622,6 @@ export class Api {
629
622
  return api.updateDealRequest({ urlParams, body, headers, baseURL: await this.baseURL });
630
623
  };
631
624
 
632
- updateDealExpertBonus = async (
633
- urlParams: api.UpdateDealExpertBonusUrlParams,
634
- body: api.UpdateDealExpertBonusBody,
635
- headers: api.UpdateDealExpertBonusHeaders
636
- ) => {
637
- return api.updateDealExpertBonusRequest({ urlParams, body, headers, baseURL: await this.baseURL });
638
- };
639
-
640
625
  // debt
641
626
 
642
627
  createDebts = async (body: api.CreateDebtsBody, headers: api.CreateDebtsHeaders) => {
@@ -890,6 +875,24 @@ export class Api {
890
875
  return api.findMotivationStatusByExpertIdRequest({ urlParams, headers, baseURL: await this.baseURL });
891
876
  };
892
877
 
878
+ // payslip
879
+
880
+ findPayslips = async (params: api.FindPayslipsParams, headers: api.FindPayslipsHeaders) => {
881
+ return api.findPayslipsRequest({ params, headers, baseURL: await this.baseURL });
882
+ };
883
+
884
+ findPayslipById = async (urlParams: api.FindPayslipByIdUrlParams, headers: api.FindPayslipByIdHeaders) => {
885
+ return api.findPayslipByIdRequest({ urlParams, headers, baseURL: await this.baseURL });
886
+ };
887
+
888
+ updatePayslip = async (
889
+ urlParams: api.UpdatePayslipUrlParams,
890
+ body: api.UpdatePayslipBody,
891
+ headers: api.UpdatePayslipHeaders
892
+ ) => {
893
+ return api.updatePayslipRequest({ urlParams, body, headers, baseURL: await this.baseURL });
894
+ };
895
+
893
896
  // phone
894
897
 
895
898
  blockPhone = async (urlParams: api.BlockPhoneUrlParams, headers: api.BlockPhoneHeaders) => {
@@ -900,7 +903,7 @@ export class Api {
900
903
  return api.callbackPhoneRequest({ urlParams, headers, baseURL: await this.baseURL });
901
904
  };
902
905
 
903
- findPhones = async (params: api.FindPhonesParams, headers: api.FindPhonesHeaders) => {
906
+ findPhones = async (params: api.FindPhonesParams, headers: api.FindPayslipsHeaders) => {
904
907
  return api.findPhonesRequest({ params, headers, baseURL: await this.baseURL });
905
908
  };
906
909
 
@@ -34,8 +34,6 @@ export enum ContractKind {
34
34
  export type Contract = {
35
35
  amount: MoneyAmount;
36
36
  createdAt: string;
37
- duration: number;
38
- expiresAt: string;
39
37
  formalId: string;
40
38
  id: number;
41
39
  isFixedCashCommission: boolean;
@@ -44,6 +42,7 @@ export type Contract = {
44
42
  serviceRequest: Partial<Omit<ServiceRequest, 'contract'>> & Required<Pick<ServiceRequest, 'id'>>;
45
43
  status: ContractStatus;
46
44
  type: ContractType;
45
+
47
46
  accountingDoc?: string;
48
47
  amountDue?: number;
49
48
  amountPenalty?: MoneyAmount;
@@ -53,6 +52,8 @@ export type Contract = {
53
52
  canTerminate?: boolean;
54
53
  deal?: Partial<Omit<Deal, 'contract'>> & Required<Pick<Deal, 'id'>>;
55
54
  declinedAt?: string;
55
+ duration?: number;
56
+ expiresAt?: string;
56
57
  reason?: string;
57
58
  signPlannedAt?: string;
58
59
  signedAt?: string;
@@ -0,0 +1,62 @@
1
+ export type PayslipLevel = {
2
+ number: number;
3
+ revenue: number;
4
+ percent?: number;
5
+ baseCommissionSum?: number;
6
+ bonus?: number;
7
+ };
8
+
9
+ export type Payslip = {
10
+ serviceRequestId: number;
11
+ advanceDate?: string;
12
+ allRelevantDeals?: number[];
13
+ baseBonusAll?: number;
14
+ baseBonusPercentAll?: number;
15
+ baseComission?: number;
16
+ basePercent?: number;
17
+ chargesComissionAboveTargetPercentAll?: number;
18
+ chargesComissionBelowMinimumAll?: number;
19
+ chargesComissionBelowTargetPercentAll?: number;
20
+ closingDate?: string;
21
+ comissionAboveTargetPercent?: number;
22
+ comissionBelowMinimum?: number;
23
+ comissionBelowTargetPercent?: number;
24
+ createdAt?: string;
25
+ curatorId?: number;
26
+ dealDate?: string;
27
+ dealId?: number;
28
+ dealStatus?: string;
29
+ dealType?: string;
30
+ effectiveBonusAll?: number;
31
+ effectiveBonusPercentAll?: number;
32
+ effectivePercent?: number;
33
+ expectedExpertPayoutDate?: string;
34
+ extraPercent?: number;
35
+ finalBonus?: number;
36
+ finalPrice?: number;
37
+ financeAdjustment?: number;
38
+ financeComment?: string;
39
+ formalId?: string;
40
+ grossRevenue4MAll?: number;
41
+ ifAmnesty?: boolean;
42
+ ifBelowMinimum?: boolean;
43
+ ifFinalNotification?: boolean;
44
+ lawyerId?: number;
45
+ legalCharges?: number;
46
+ levels?: Array<PayslipLevel>;
47
+ mentorId?: number;
48
+ minNetComission?: number;
49
+ negativeAdjustmentFact?: number;
50
+ netComission?: number;
51
+ partnerCommission?: number;
52
+ payslipMeta?: {
53
+ createdAt: string;
54
+ updatedAt?: string;
55
+ };
56
+ plannedCommission?: number;
57
+ signedAt?: string;
58
+ supervisorId?: number;
59
+ targetPercentFrom?: number;
60
+ targetPercentTo?: number;
61
+ traineeAdjustmentFact?: number;
62
+ };