@silexpert/core 0.4.255 → 0.4.258

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 (72) hide show
  1. package/es/api/resources/Loan.d.ts +1 -1
  2. package/es/api/resources/Loan.d.ts.map +1 -1
  3. package/es/api/resources/Loan.js +13 -2
  4. package/es/api/resources/Loan.js.map +1 -1
  5. package/es/types/Enum/FolderFile.d.ts +6 -0
  6. package/es/types/Enum/FolderFile.d.ts.map +1 -0
  7. package/es/types/Enum/FolderFile.js +7 -0
  8. package/es/types/Enum/FolderFile.js.map +1 -0
  9. package/es/types/Enum/Ged.d.ts +2 -1
  10. package/es/types/Enum/Ged.d.ts.map +1 -1
  11. package/es/types/Enum/Ged.js +2 -2
  12. package/es/types/Enum/Ged.js.map +1 -1
  13. package/es/types/Enum/Office.d.ts +19 -0
  14. package/es/types/Enum/Office.d.ts.map +1 -0
  15. package/es/types/Enum/Office.js +19 -0
  16. package/es/types/Enum/Office.js.map +1 -0
  17. package/es/types/Interface/api/accountingTransaction/DeleteInvoices.d.ts +2 -2
  18. package/es/types/Interface/api/accountingTransaction/DeleteInvoices.d.ts.map +1 -1
  19. package/es/types/Interface/api/accountingTransaction/DeleteInvoices.js +5 -5
  20. package/es/types/Interface/api/accountingTransaction/DeleteInvoices.js.map +1 -1
  21. package/es/types/Interface/api/loan/CreateLoan.d.ts +3 -0
  22. package/es/types/Interface/api/loan/CreateLoan.d.ts.map +1 -1
  23. package/es/types/Interface/api/loan/CreateLoan.js +23 -1
  24. package/es/types/Interface/api/loan/CreateLoan.js.map +1 -1
  25. package/es/types/Interface/api/loan/UpdateLoan.d.ts +2 -0
  26. package/es/types/Interface/api/loan/UpdateLoan.d.ts.map +1 -1
  27. package/es/types/Interface/api/loan/UpdateLoan.js +25 -0
  28. package/es/types/Interface/api/loan/UpdateLoan.js.map +1 -1
  29. package/es/types/Interface/models/ILoan.d.ts +4 -0
  30. package/es/types/Interface/models/ILoan.d.ts.map +1 -1
  31. package/es/types/Interface/models/ILoan.js.map +1 -1
  32. package/es/types/Interface/models/ILoanFile.d.ts +12 -0
  33. package/es/types/Interface/models/ILoanFile.d.ts.map +1 -0
  34. package/es/types/Interface/models/ILoanFile.js +2 -0
  35. package/es/types/Interface/models/ILoanFile.js.map +1 -0
  36. package/es/types/Interface/models/ILog.d.ts +2 -0
  37. package/es/types/Interface/models/ILog.d.ts.map +1 -1
  38. package/es/types/Interface/models/ILog.js.map +1 -1
  39. package/es/types/index.d.ts +3 -0
  40. package/es/types/index.d.ts.map +1 -1
  41. package/es/types/index.js +3 -0
  42. package/es/types/index.js.map +1 -1
  43. package/js/api/resources/Loan.js +19 -2
  44. package/js/api/resources/Loan.js.map +1 -1
  45. package/js/types/Enum/FolderFile.js +13 -0
  46. package/js/types/Enum/FolderFile.js.map +1 -0
  47. package/js/types/Enum/Ged.js +2 -2
  48. package/js/types/Enum/Ged.js.map +1 -1
  49. package/js/types/Enum/Office.js +24 -0
  50. package/js/types/Enum/Office.js.map +1 -0
  51. package/js/types/Interface/api/accountingTransaction/DeleteInvoices.js +2 -2
  52. package/js/types/Interface/api/accountingTransaction/DeleteInvoices.js.map +1 -1
  53. package/js/types/Interface/api/loan/CreateLoan.js +13 -5
  54. package/js/types/Interface/api/loan/CreateLoan.js.map +1 -1
  55. package/js/types/Interface/api/loan/UpdateLoan.js +12 -6
  56. package/js/types/Interface/api/loan/UpdateLoan.js.map +1 -1
  57. package/js/types/Interface/models/ILoanFile.js +6 -0
  58. package/js/types/Interface/models/ILoanFile.js.map +1 -0
  59. package/js/types/index.js +36 -0
  60. package/js/types/index.js.map +1 -1
  61. package/package.json +1 -1
  62. package/ts/api/resources/Loan.ts +14 -2
  63. package/ts/types/Enum/FolderFile.ts +5 -0
  64. package/ts/types/Enum/Ged.ts +3 -3
  65. package/ts/types/Enum/Office.ts +18 -0
  66. package/ts/types/Interface/api/accountingTransaction/DeleteInvoices.ts +5 -5
  67. package/ts/types/Interface/api/loan/CreateLoan.ts +20 -1
  68. package/ts/types/Interface/api/loan/UpdateLoan.ts +23 -0
  69. package/ts/types/Interface/models/ILoan.ts +4 -0
  70. package/ts/types/Interface/models/ILoanFile.ts +14 -0
  71. package/ts/types/Interface/models/ILog.ts +2 -0
  72. package/ts/types/index.ts +3 -0
@@ -1,3 +1,4 @@
1
+ import { forEach } from 'lodash';
1
2
  import { Resource } from '../Resource';
2
3
  import {
3
4
  CreateLoanForm, IAccount, ILoan, UpdateLoanForm,
@@ -12,8 +13,19 @@ export class Loan extends Resource {
12
13
  return this.axios.$get(`/loan/${params.idLoan}`);
13
14
  }
14
15
 
15
- createLoan(payload: CreateLoanForm): Promise<ILoan> {
16
- return this.axios.$post('/loan', payload);
16
+ createLoan(params: CreateLoanForm): Promise<ILoan> {
17
+ const formData = new FormData();
18
+
19
+ forEach(params, (value, key) => {
20
+ if (value) {
21
+ formData.append(key, `${value}`);
22
+ }
23
+ });
24
+ params.files?.forEach((file) => {
25
+ formData.append('files', file);
26
+ });
27
+
28
+ return this.axios.$post('/loan', formData, { headers: { 'Content-Type': 'multipart/form-data' } });
17
29
  }
18
30
 
19
31
  updateLoan(idLoan: number, payload: UpdateLoanForm): Promise<ILoan> {
@@ -0,0 +1,5 @@
1
+ export enum FolderFile {
2
+ ACCOUNTING = 4,
3
+ GED = 6,
4
+ ESTIMATE = 16,
5
+ }
@@ -28,8 +28,8 @@ export enum GedFolder {
28
28
  // Insurance = 22,
29
29
  CABINET_INVOICES = 23,
30
30
  OTHER = 24,
31
- Vehicles = 25,
32
- // Borrowing tables = 26,
31
+ VEHICLES = 25,
32
+ BORROWING_TABLES = 26,
33
33
  // RSI & URSSAF = 27,
34
34
  // Previous GA balance & PV = 28,
35
35
  // Slips for the CFE = 29,
@@ -68,4 +68,4 @@ export enum GedFileType {
68
68
  REVISION_GUIDE = 18,
69
69
  SUMMARY_NOTE = 19,
70
70
  BALANCESHEET_NOTE = 20,
71
- }
71
+ }
@@ -0,0 +1,18 @@
1
+ export const Office = {
2
+ LAXOU: {
3
+ id: 1,
4
+ name: 'Laxou',
5
+ },
6
+ PARIS: {
7
+ id: 2,
8
+ name: 'Paris',
9
+ },
10
+ MARSEILLE: {
11
+ id: 3,
12
+ name: 'Marseille',
13
+ },
14
+ EPINAL: {
15
+ id: 4,
16
+ name: 'Epinal',
17
+ },
18
+ };
@@ -1,5 +1,5 @@
1
1
  import {
2
- IsBoolean, IsDate, IsIn, IsNumber, IsOptional,
2
+ IsBoolean, IsDateString, IsIn, IsNumber, IsOptional,
3
3
  } from 'class-validator';
4
4
  import { AccountingJournal } from '../../..';
5
5
  import { ApiProperty, ApiPropertyOptional } from '../../../..';
@@ -7,12 +7,12 @@ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
7
7
 
8
8
  export class QueryDeleteInvoices {
9
9
  @ApiProperty()
10
- @IsDate()
11
- startDate: Date;
10
+ @IsDateString()
11
+ startDate: string;
12
12
 
13
13
  @ApiProperty()
14
- @IsDate()
15
- endDate: Date;
14
+ @IsDateString()
15
+ endDate: string;
16
16
 
17
17
  @ApiProperty()
18
18
  @IsNumber()
@@ -1,4 +1,5 @@
1
- import { ApiProperty } from '../../../../utils';
1
+ import { IsNumber, IsOptional } from 'class-validator';
2
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
2
3
 
3
4
  export class CreateLoanForm {
4
5
  @ApiProperty({ description: 'Désignation' })
@@ -8,17 +9,35 @@ export class CreateLoanForm {
8
9
  lenderDesignation: string;
9
10
 
10
11
  @ApiProperty()
12
+ @IsNumber()
11
13
  number: number;
12
14
 
13
15
  @ApiProperty()
16
+ @IsNumber()
14
17
  amount: number;
15
18
 
16
19
  @ApiProperty()
20
+ @IsNumber()
17
21
  assetBeforeExercice: number;
18
22
 
19
23
  @ApiProperty()
24
+ @IsNumber()
20
25
  assetAfterExercice: number;
21
26
 
27
+ @ApiPropertyOptional()
28
+ @IsNumber()
29
+ @IsOptional()
30
+ monthDuration?: number;
31
+
32
+ @ApiPropertyOptional()
33
+ @IsNumber()
34
+ @IsOptional()
35
+ rate?: number;
36
+
22
37
  @ApiProperty()
38
+ @IsNumber()
23
39
  idExercice: number;
40
+
41
+ @ApiPropertyOptional()
42
+ files?: File[];
24
43
  }
@@ -1,3 +1,4 @@
1
+ import { IsNumber, IsOptional, IsString } from 'class-validator';
1
2
  import { ApiPropertyOptional } from '../../../../utils';
2
3
 
3
4
  export class UpdateLoanForm {
@@ -5,20 +6,42 @@ export class UpdateLoanForm {
5
6
  name?: string;
6
7
 
7
8
  @ApiPropertyOptional()
9
+ @IsString()
10
+ @IsOptional()
8
11
  lenderDesignation?: string;
9
12
 
10
13
  @ApiPropertyOptional()
14
+ @IsNumber()
15
+ @IsOptional()
11
16
  number?: number;
12
17
 
13
18
  @ApiPropertyOptional()
19
+ @IsNumber()
20
+ @IsOptional()
14
21
  amount?: number;
15
22
 
16
23
  @ApiPropertyOptional()
24
+ @IsNumber()
25
+ @IsOptional()
17
26
  assetBeforeExercice?: number;
18
27
 
19
28
  @ApiPropertyOptional()
29
+ @IsNumber()
30
+ @IsOptional()
20
31
  assetAfterExercice?: number;
21
32
 
22
33
  @ApiPropertyOptional()
34
+ @IsNumber()
35
+ @IsOptional()
23
36
  idExercice?: number;
37
+
38
+ @ApiPropertyOptional()
39
+ @IsNumber()
40
+ @IsOptional()
41
+ monthDuration?: number;
42
+
43
+ @ApiPropertyOptional()
44
+ @IsNumber()
45
+ @IsOptional()
46
+ rate?: number;
24
47
  }
@@ -1,6 +1,7 @@
1
1
  import { ISociety } from './ISociety';
2
2
  import { IExercice } from './IExercice';
3
3
  import { IAccount } from './IAccount';
4
+ import { ILoanFile } from './ILoanFile';
4
5
 
5
6
  export interface ILoan {
6
7
  id?: number;
@@ -11,6 +12,8 @@ export interface ILoan {
11
12
  amount: number;
12
13
  assetBeforeExercice: number;
13
14
  assetAfterExercice: number;
15
+ monthDuration?: number;
16
+ rate?: number;
14
17
  idExercice: number;
15
18
  idSociety: number;
16
19
  idAccountRefund: number;
@@ -27,4 +30,5 @@ export interface ILoan {
27
30
  accountBenefit?: IAccount;
28
31
  accountInsurance?: IAccount;
29
32
  accountCommission?: IAccount;
33
+ loanFiles?: ILoanFile[];
30
34
  }
@@ -0,0 +1,14 @@
1
+ import { IFile } from './IFile';
2
+ import { ILoan } from './ILoan';
3
+
4
+ export interface ILoanFile {
5
+ id: number;
6
+ idFile: number;
7
+ idLoan: number;
8
+ createdAt?: Date | null;
9
+ updatedAt?: Date | null;
10
+
11
+ // Associations
12
+ loan: ILoan;
13
+ file: IFile;
14
+ }
@@ -9,6 +9,8 @@ export interface ILog {
9
9
  payload: string | null;
10
10
  ip: string | null;
11
11
  idAction: number;
12
+ navigator: string | null
13
+ device: string | null
12
14
  idSource: number;
13
15
  idExercice: number | null;
14
16
  idSociety: number | null;
package/ts/types/index.ts CHANGED
@@ -310,6 +310,7 @@ export * from './Interface/models/ITask';
310
310
  export * from './Interface/models/IMobileNotificationLog';
311
311
  export * from './Interface/models/IMobileNotificationSetting';
312
312
  export * from './Interface/models/ITimeRecorder';
313
+ export * from './Interface/models/ILoanFile';
313
314
 
314
315
  // Forms
315
316
  export * from './Form/FormAuthenticate';
@@ -327,6 +328,7 @@ export * from './Enum/Quality';
327
328
  export * from './Enum/AbsenceType';
328
329
  export * from './Enum/Role';
329
330
  export * from './Enum/RoleDetail';
331
+ export * from './Enum/Office';
330
332
  export * from './Enum/PrestationOption';
331
333
  export * from './Enum/TimeCounterType';
332
334
  export * from './Enum/MailAuto';
@@ -428,6 +430,7 @@ export * from './Enum/InternalService';
428
430
  export * from './Enum/SocietyTypeEvent';
429
431
  export * from './Enum/Call';
430
432
  export * from './Enum/ConnectionError';
433
+ export * from './Enum/FolderFile';
431
434
 
432
435
  // Interfaces API
433
436
  export * from './Interface/api/partnerTransactionType/ReadPartnerTransactionType';