@silexpert/core 1.1.343 → 1.1.344
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/dist/cjs/api/resources/Loan.d.ts +9 -11
- package/dist/cjs/api/resources/Loan.d.ts.map +1 -1
- package/dist/cjs/api/resources/Loan.js +23 -17
- package/dist/cjs/api/resources/Loan.js.map +1 -1
- package/dist/cjs/types/Interface/api/bankAccount/Query.d.ts +1 -0
- package/dist/cjs/types/Interface/api/bankAccount/Query.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/bankAccount/Query.js +7 -0
- package/dist/cjs/types/Interface/api/bankAccount/Query.js.map +1 -1
- package/dist/cjs/types/Interface/api/exercice/ReadExercice.d.ts +7 -0
- package/dist/cjs/types/Interface/api/exercice/ReadExercice.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/exercice/ReadExercice.js +3 -0
- package/dist/cjs/types/Interface/api/exercice/ReadExercice.js.map +1 -0
- package/dist/cjs/types/Interface/api/loan/CreateLoan.d.ts +13 -2
- package/dist/cjs/types/Interface/api/loan/CreateLoan.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/loan/CreateLoan.js +53 -3
- package/dist/cjs/types/Interface/api/loan/CreateLoan.js.map +1 -1
- package/dist/cjs/types/Interface/api/loan/ReadLoan.d.ts +10 -0
- package/dist/cjs/types/Interface/api/loan/ReadLoan.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/loan/ReadLoan.js +3 -0
- package/dist/cjs/types/Interface/api/loan/ReadLoan.js.map +1 -0
- package/dist/cjs/types/Interface/api/loan/UpdateLoan.d.ts +0 -6
- package/dist/cjs/types/Interface/api/loan/UpdateLoan.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/loan/UpdateLoan.js +2 -36
- package/dist/cjs/types/Interface/api/loan/UpdateLoan.js.map +1 -1
- package/dist/cjs/types/Interface/models/ILoan.d.ts +7 -0
- package/dist/cjs/types/Interface/models/ILoan.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/ILoan.js.map +1 -1
- package/dist/cjs/types/Interface/models/ILoanEarlyRepayment.d.ts +12 -0
- package/dist/cjs/types/Interface/models/ILoanEarlyRepayment.d.ts.map +1 -0
- package/dist/cjs/types/Interface/models/ILoanEarlyRepayment.js +3 -0
- package/dist/cjs/types/Interface/models/ILoanEarlyRepayment.js.map +1 -0
- package/dist/cjs/types/index.d.ts +3 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +3 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/mjs/api/resources/Loan.d.ts +9 -11
- package/dist/mjs/api/resources/Loan.d.ts.map +1 -1
- package/dist/mjs/api/resources/Loan.js +23 -17
- package/dist/mjs/api/resources/Loan.js.map +1 -1
- package/dist/mjs/types/Interface/api/bankAccount/Query.d.ts +1 -0
- package/dist/mjs/types/Interface/api/bankAccount/Query.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/bankAccount/Query.js +8 -0
- package/dist/mjs/types/Interface/api/bankAccount/Query.js.map +1 -1
- package/dist/mjs/types/Interface/api/exercice/ReadExercice.d.ts +7 -0
- package/dist/mjs/types/Interface/api/exercice/ReadExercice.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/exercice/ReadExercice.js +2 -0
- package/dist/mjs/types/Interface/api/exercice/ReadExercice.js.map +1 -0
- package/dist/mjs/types/Interface/api/loan/CreateLoan.d.ts +13 -2
- package/dist/mjs/types/Interface/api/loan/CreateLoan.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/loan/CreateLoan.js +61 -3
- package/dist/mjs/types/Interface/api/loan/CreateLoan.js.map +1 -1
- package/dist/mjs/types/Interface/api/loan/ReadLoan.d.ts +10 -0
- package/dist/mjs/types/Interface/api/loan/ReadLoan.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/loan/ReadLoan.js +2 -0
- package/dist/mjs/types/Interface/api/loan/ReadLoan.js.map +1 -0
- package/dist/mjs/types/Interface/api/loan/UpdateLoan.d.ts +0 -6
- package/dist/mjs/types/Interface/api/loan/UpdateLoan.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/loan/UpdateLoan.js +3 -43
- package/dist/mjs/types/Interface/api/loan/UpdateLoan.js.map +1 -1
- package/dist/mjs/types/Interface/models/ILoan.d.ts +7 -0
- package/dist/mjs/types/Interface/models/ILoan.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/ILoan.js.map +1 -1
- package/dist/mjs/types/Interface/models/ILoanEarlyRepayment.d.ts +12 -0
- package/dist/mjs/types/Interface/models/ILoanEarlyRepayment.d.ts.map +1 -0
- package/dist/mjs/types/Interface/models/ILoanEarlyRepayment.js +2 -0
- package/dist/mjs/types/Interface/models/ILoanEarlyRepayment.js.map +1 -0
- package/dist/mjs/types/index.d.ts +3 -0
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +3 -0
- package/dist/mjs/types/index.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Loan.ts +28 -21
- package/ts/types/Interface/api/bankAccount/Query.ts +6 -0
- package/ts/types/Interface/api/exercice/ReadExercice.ts +6 -0
- package/ts/types/Interface/api/loan/CreateLoan.ts +45 -5
- package/ts/types/Interface/api/loan/ReadLoan.ts +9 -0
- package/ts/types/Interface/api/loan/UpdateLoan.ts +3 -31
- package/ts/types/Interface/models/ILoan.ts +7 -0
- package/ts/types/Interface/models/ILoanEarlyRepayment.ts +13 -0
- package/ts/types/index.ts +3 -0
package/ts/api/resources/Loan.ts
CHANGED
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
import { Resource } from '../Resource';
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
CreateEarlyRepayment,
|
|
4
|
+
CreateLoanForm, IAccount, ILoan, ILoanEarlyRepayment, UpdateLoanForm,
|
|
4
5
|
} from '../../types';
|
|
5
6
|
|
|
6
7
|
export class Loan extends Resource {
|
|
7
|
-
/** @deprecated use getAll() */
|
|
8
|
-
getLoans(): Promise<ILoan[]> {
|
|
9
|
-
return this.axios.$get('/loans');
|
|
10
|
-
}
|
|
11
|
-
|
|
12
8
|
getAll(idSociety: number): Promise<ILoan[]> {
|
|
13
9
|
return this.axios.$get(`/societies/${idSociety}/loans`);
|
|
14
10
|
}
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
return this.axios.$get(`/loan/${
|
|
12
|
+
get(id: number): Promise<ILoan> {
|
|
13
|
+
return this.axios.$get(`/loan/${id}`);
|
|
18
14
|
}
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
createLoan(params: CreateLoanForm): Promise<ILoan> {
|
|
16
|
+
create(idSociety: number, params: CreateLoanForm): Promise<ILoan> {
|
|
22
17
|
const formData = new FormData();
|
|
23
18
|
|
|
24
19
|
Object.entries(params).forEach(([key, value]) => {
|
|
25
|
-
if (value
|
|
20
|
+
if (value !== undefined && value !== null) {
|
|
26
21
|
formData.append(key, `${value}`);
|
|
27
22
|
}
|
|
28
23
|
});
|
|
@@ -31,23 +26,35 @@ export class Loan extends Resource {
|
|
|
31
26
|
formData.append('files', file);
|
|
32
27
|
});
|
|
33
28
|
|
|
34
|
-
return this.axios.$post(
|
|
29
|
+
return this.axios.$post(`/societies/${idSociety}/loans`, formData, { headers: { 'Content-Type': 'multipart/form-data' } });
|
|
35
30
|
}
|
|
36
31
|
|
|
37
|
-
|
|
38
|
-
return this.axios.$put(`/loan/${
|
|
32
|
+
update(id: number, payload: UpdateLoanForm): Promise<ILoan> {
|
|
33
|
+
return this.axios.$put(`/loan/${id}`, payload);
|
|
39
34
|
}
|
|
40
35
|
|
|
41
|
-
|
|
42
|
-
return this.axios.$delete(`/loan/${
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** @deprecated use getAllAccounts() */
|
|
46
|
-
accounts(): Promise<IAccount[]> {
|
|
47
|
-
return this.axios.$get('/loans/accounts');
|
|
36
|
+
delete(id: number): Promise<true> {
|
|
37
|
+
return this.axios.$delete(`/loan/${id}`);
|
|
48
38
|
}
|
|
49
39
|
|
|
50
40
|
getAllAccounts(idSociety: number): Promise<IAccount[]> {
|
|
51
41
|
return this.axios.$get(`/societies/${idSociety}/loans/accounts`);
|
|
52
42
|
}
|
|
43
|
+
|
|
44
|
+
createEarlyRepayment(idLoan: number, payload: CreateEarlyRepayment): Promise<ILoanEarlyRepayment> {
|
|
45
|
+
return this.axios.$post(`/loans/${idLoan}/early-repayments`, payload);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
deleteEarlyRepayment(idLoan: number, idEarlyRepayment: number): Promise<true> {
|
|
49
|
+
return this.axios.$delete(`/loans/${idLoan}/early-repayments/${idEarlyRepayment}`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
getDepreciationFile(idLoan: number): Promise<Buffer> {
|
|
53
|
+
return this.axios.$get(`/loans/${idLoan}/depreciation-files`, {
|
|
54
|
+
responseType: 'arraybuffer',
|
|
55
|
+
headers: {
|
|
56
|
+
Accept: 'application/pdf',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
}
|
|
53
60
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IsBoolean, IsDate, IsNumber, IsString } from 'class-validator';
|
|
2
2
|
import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
|
|
3
|
+
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
3
4
|
|
|
4
5
|
export class CreateLoanForm {
|
|
5
6
|
@ApiProperty({ description: 'Désignation' })
|
|
7
|
+
@IsString()
|
|
6
8
|
name: string;
|
|
7
9
|
|
|
8
10
|
@ApiProperty({ description: 'Désignation de l\'organisme' })
|
|
11
|
+
@IsString()
|
|
9
12
|
lenderDesignation: string;
|
|
10
13
|
|
|
11
14
|
@ApiProperty()
|
|
@@ -26,18 +29,55 @@ export class CreateLoanForm {
|
|
|
26
29
|
|
|
27
30
|
@ApiPropertyOptional()
|
|
28
31
|
@IsNumber()
|
|
29
|
-
|
|
30
|
-
monthDuration?: number;
|
|
32
|
+
monthDuration: number;
|
|
31
33
|
|
|
32
34
|
@ApiPropertyOptional()
|
|
33
35
|
@IsNumber()
|
|
34
|
-
|
|
35
|
-
rate?: number;
|
|
36
|
+
rate: number;
|
|
36
37
|
|
|
37
38
|
@ApiProperty()
|
|
38
39
|
@IsNumber()
|
|
39
40
|
idExercice: number;
|
|
40
41
|
|
|
42
|
+
@ApiProperty()
|
|
43
|
+
@IsNumber()
|
|
44
|
+
annuity: number;
|
|
45
|
+
|
|
46
|
+
@ApiProperty()
|
|
47
|
+
@IsString()
|
|
48
|
+
unlockDate: string;
|
|
49
|
+
|
|
50
|
+
@ApiProperty()
|
|
51
|
+
@IsString()
|
|
52
|
+
firstDueDate: string;
|
|
53
|
+
|
|
54
|
+
@ApiProperty()
|
|
55
|
+
@IsNumber()
|
|
56
|
+
commission: number;
|
|
57
|
+
|
|
58
|
+
@ApiProperty()
|
|
59
|
+
@IsNumber()
|
|
60
|
+
insurance: number;
|
|
61
|
+
|
|
62
|
+
@ApiProperty()
|
|
63
|
+
@IsBoolean()
|
|
64
|
+
@ToBoolean()
|
|
65
|
+
shouldProrate: boolean;
|
|
66
|
+
|
|
41
67
|
@ApiPropertyOptional()
|
|
42
68
|
files?: File[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export class CreateEarlyRepayment {
|
|
72
|
+
@ApiProperty()
|
|
73
|
+
@IsNumber()
|
|
74
|
+
amount: number;
|
|
75
|
+
|
|
76
|
+
@ApiProperty()
|
|
77
|
+
@IsDate()
|
|
78
|
+
date: Date;
|
|
79
|
+
|
|
80
|
+
@ApiProperty()
|
|
81
|
+
@IsNumber()
|
|
82
|
+
annuity: number;
|
|
43
83
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IsOptional, IsString } from 'class-validator';
|
|
2
2
|
import { ApiPropertyOptional } from '../../../../utils';
|
|
3
3
|
|
|
4
4
|
export class UpdateLoanForm {
|
|
5
5
|
@ApiPropertyOptional()
|
|
6
|
+
@IsString()
|
|
7
|
+
@IsOptional()
|
|
6
8
|
name?: string;
|
|
7
9
|
|
|
8
10
|
@ApiPropertyOptional()
|
|
@@ -14,34 +16,4 @@ export class UpdateLoanForm {
|
|
|
14
16
|
@IsString()
|
|
15
17
|
@IsOptional()
|
|
16
18
|
number?: string;
|
|
17
|
-
|
|
18
|
-
@ApiPropertyOptional()
|
|
19
|
-
@IsNumber()
|
|
20
|
-
@IsOptional()
|
|
21
|
-
amount?: number;
|
|
22
|
-
|
|
23
|
-
@ApiPropertyOptional()
|
|
24
|
-
@IsNumber()
|
|
25
|
-
@IsOptional()
|
|
26
|
-
assetBeforeExercice?: number;
|
|
27
|
-
|
|
28
|
-
@ApiPropertyOptional()
|
|
29
|
-
@IsNumber()
|
|
30
|
-
@IsOptional()
|
|
31
|
-
assetAfterExercice?: number;
|
|
32
|
-
|
|
33
|
-
@ApiPropertyOptional()
|
|
34
|
-
@IsNumber()
|
|
35
|
-
@IsOptional()
|
|
36
|
-
idExercice?: number;
|
|
37
|
-
|
|
38
|
-
@ApiPropertyOptional()
|
|
39
|
-
@IsNumber()
|
|
40
|
-
@IsOptional()
|
|
41
|
-
monthDuration?: number;
|
|
42
|
-
|
|
43
|
-
@ApiPropertyOptional()
|
|
44
|
-
@IsNumber()
|
|
45
|
-
@IsOptional()
|
|
46
|
-
rate?: number;
|
|
47
19
|
}
|
|
@@ -2,6 +2,7 @@ import { ISociety } from './ISociety';
|
|
|
2
2
|
import { IExercice } from './IExercice';
|
|
3
3
|
import { IAccount } from './IAccount';
|
|
4
4
|
import { ILoanFile } from './ILoanFile';
|
|
5
|
+
import { ILoanEarlyRepayment } from './ILoanEarlyRepayment';
|
|
5
6
|
|
|
6
7
|
export interface ILoan {
|
|
7
8
|
id?: number;
|
|
@@ -14,6 +15,11 @@ export interface ILoan {
|
|
|
14
15
|
assetAfterExercice: number;
|
|
15
16
|
monthDuration?: number;
|
|
16
17
|
rate?: number;
|
|
18
|
+
annuity: number | null;
|
|
19
|
+
unlockDate: Date | null;
|
|
20
|
+
firstDueDate: Date | null;
|
|
21
|
+
commission: number | null;
|
|
22
|
+
insurance: number | null;
|
|
17
23
|
idExercice: number;
|
|
18
24
|
idSociety: number;
|
|
19
25
|
idAccountRefund: number;
|
|
@@ -33,4 +39,5 @@ export interface ILoan {
|
|
|
33
39
|
accountCommission?: IAccount;
|
|
34
40
|
accountReleaseLoanCapital?: IAccount;
|
|
35
41
|
loanFiles?: ILoanFile[];
|
|
42
|
+
earlyRepayments?: ILoanEarlyRepayment[];
|
|
36
43
|
}
|
package/ts/types/index.ts
CHANGED
|
@@ -333,6 +333,7 @@ export * from './Interface/models/IExpertAnnuary';
|
|
|
333
333
|
export * from './Interface/models/IUserTimeSlot';
|
|
334
334
|
export * from './Interface/models/ICompanyCreationForm';
|
|
335
335
|
export * from './Interface/models/IAnnotation';
|
|
336
|
+
export * from './Interface/models/ILoanEarlyRepayment';
|
|
336
337
|
|
|
337
338
|
|
|
338
339
|
// Schemas
|
|
@@ -544,6 +545,7 @@ export * from './Enum/Contest';
|
|
|
544
545
|
export * from './Enum/LetterResponseType';
|
|
545
546
|
|
|
546
547
|
// Interfaces API
|
|
548
|
+
export * from './Interface/api/exercice/ReadExercice';
|
|
547
549
|
export * from './Interface/api/kilometricAllowance/ReadKilometricAllowance';
|
|
548
550
|
export * from './Interface/api/cashAndExpense/Query';
|
|
549
551
|
export * from './Interface/api/cerfa/das2';
|
|
@@ -814,6 +816,7 @@ export * from './Interface/api/promoCode/UpdatePromoCode';
|
|
|
814
816
|
export * from './Interface/api/promoCode/CreatePromoCode';
|
|
815
817
|
export * from './Interface/api/balanceBankAccount/CreateBudgetBalanceBankAccount';
|
|
816
818
|
export * from './Interface/api/loan/CreateLoan';
|
|
819
|
+
export * from './Interface/api/loan/ReadLoan';
|
|
817
820
|
export * from './Interface/api/stock/StocksType';
|
|
818
821
|
export * from './Interface/api/lettering/QueryRegroupLettering';
|
|
819
822
|
// export * from './Interface/api/stock/StockEntries';
|