@silexpert/core 1.3.204 → 1.3.205-2

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 (103) hide show
  1. package/dist/cjs/api/resources/Transaction.d.ts +1 -0
  2. package/dist/cjs/api/resources/Transaction.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/Transaction.js +3 -0
  4. package/dist/cjs/api/resources/Transaction.js.map +1 -1
  5. package/dist/cjs/api/resources/UsersHistory.d.ts +11 -0
  6. package/dist/cjs/api/resources/UsersHistory.d.ts.map +1 -0
  7. package/dist/cjs/api/resources/UsersHistory.js +26 -0
  8. package/dist/cjs/api/resources/UsersHistory.js.map +1 -0
  9. package/dist/cjs/api/resources.d.ts +2 -0
  10. package/dist/cjs/api/resources.d.ts.map +1 -1
  11. package/dist/cjs/api/resources.js +2 -0
  12. package/dist/cjs/api/resources.js.map +1 -1
  13. package/dist/cjs/types/Enum/PrestationType.d.ts +11 -0
  14. package/dist/cjs/types/Enum/PrestationType.d.ts.map +1 -1
  15. package/dist/cjs/types/Enum/PrestationType.js +84 -68
  16. package/dist/cjs/types/Enum/PrestationType.js.map +1 -1
  17. package/dist/cjs/types/Enum/SocietyApproval.js +6 -6
  18. package/dist/cjs/types/Enum/SocietyApproval.js.map +1 -1
  19. package/dist/cjs/types/Enum/UsersHistory.d.ts +16 -0
  20. package/dist/cjs/types/Enum/UsersHistory.d.ts.map +1 -0
  21. package/dist/cjs/types/Enum/UsersHistory.js +38 -0
  22. package/dist/cjs/types/Enum/UsersHistory.js.map +1 -0
  23. package/dist/cjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.d.ts +13 -0
  24. package/dist/cjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.d.ts.map +1 -1
  25. package/dist/cjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.js +14 -1
  26. package/dist/cjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.js.map +1 -1
  27. package/dist/cjs/types/Interface/api/usersHistory/Create.d.ts +8 -0
  28. package/dist/cjs/types/Interface/api/usersHistory/Create.d.ts.map +1 -0
  29. package/dist/cjs/types/Interface/api/usersHistory/Create.js +35 -0
  30. package/dist/cjs/types/Interface/api/usersHistory/Create.js.map +1 -0
  31. package/dist/cjs/types/Interface/api/usersHistory/Update.d.ts +7 -0
  32. package/dist/cjs/types/Interface/api/usersHistory/Update.d.ts.map +1 -0
  33. package/dist/cjs/types/Interface/api/usersHistory/Update.js +31 -0
  34. package/dist/cjs/types/Interface/api/usersHistory/Update.js.map +1 -0
  35. package/dist/cjs/types/Interface/models/IUsersHistory.d.ts +14 -0
  36. package/dist/cjs/types/Interface/models/IUsersHistory.d.ts.map +1 -0
  37. package/dist/cjs/types/Interface/models/IUsersHistory.js +3 -0
  38. package/dist/cjs/types/Interface/models/IUsersHistory.js.map +1 -0
  39. package/dist/cjs/types/index.d.ts +4 -0
  40. package/dist/cjs/types/index.d.ts.map +1 -1
  41. package/dist/cjs/types/index.js +4 -0
  42. package/dist/cjs/types/index.js.map +1 -1
  43. package/dist/cjs/utils/societyApproval.d.ts.map +1 -1
  44. package/dist/cjs/utils/societyApproval.js +22 -19
  45. package/dist/cjs/utils/societyApproval.js.map +1 -1
  46. package/dist/mjs/api/resources/Transaction.d.ts +1 -0
  47. package/dist/mjs/api/resources/Transaction.d.ts.map +1 -1
  48. package/dist/mjs/api/resources/Transaction.js +3 -0
  49. package/dist/mjs/api/resources/Transaction.js.map +1 -1
  50. package/dist/mjs/api/resources/UsersHistory.d.ts +11 -0
  51. package/dist/mjs/api/resources/UsersHistory.d.ts.map +1 -0
  52. package/dist/mjs/api/resources/UsersHistory.js +28 -0
  53. package/dist/mjs/api/resources/UsersHistory.js.map +1 -0
  54. package/dist/mjs/api/resources.d.ts +2 -0
  55. package/dist/mjs/api/resources.d.ts.map +1 -1
  56. package/dist/mjs/api/resources.js +2 -0
  57. package/dist/mjs/api/resources.js.map +1 -1
  58. package/dist/mjs/types/Enum/PrestationType.d.ts +11 -0
  59. package/dist/mjs/types/Enum/PrestationType.d.ts.map +1 -1
  60. package/dist/mjs/types/Enum/PrestationType.js +83 -67
  61. package/dist/mjs/types/Enum/PrestationType.js.map +1 -1
  62. package/dist/mjs/types/Enum/SocietyApproval.js +6 -6
  63. package/dist/mjs/types/Enum/SocietyApproval.js.map +1 -1
  64. package/dist/mjs/types/Enum/UsersHistory.d.ts +16 -0
  65. package/dist/mjs/types/Enum/UsersHistory.d.ts.map +1 -0
  66. package/dist/mjs/types/Enum/UsersHistory.js +35 -0
  67. package/dist/mjs/types/Enum/UsersHistory.js.map +1 -0
  68. package/dist/mjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.d.ts +13 -0
  69. package/dist/mjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.d.ts.map +1 -1
  70. package/dist/mjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.js +16 -2
  71. package/dist/mjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.js.map +1 -1
  72. package/dist/mjs/types/Interface/api/usersHistory/Create.d.ts +8 -0
  73. package/dist/mjs/types/Interface/api/usersHistory/Create.d.ts.map +1 -0
  74. package/dist/mjs/types/Interface/api/usersHistory/Create.js +34 -0
  75. package/dist/mjs/types/Interface/api/usersHistory/Create.js.map +1 -0
  76. package/dist/mjs/types/Interface/api/usersHistory/Update.d.ts +7 -0
  77. package/dist/mjs/types/Interface/api/usersHistory/Update.d.ts.map +1 -0
  78. package/dist/mjs/types/Interface/api/usersHistory/Update.js +29 -0
  79. package/dist/mjs/types/Interface/api/usersHistory/Update.js.map +1 -0
  80. package/dist/mjs/types/Interface/models/IUsersHistory.d.ts +14 -0
  81. package/dist/mjs/types/Interface/models/IUsersHistory.d.ts.map +1 -0
  82. package/dist/mjs/types/Interface/models/IUsersHistory.js +2 -0
  83. package/dist/mjs/types/Interface/models/IUsersHistory.js.map +1 -0
  84. package/dist/mjs/types/index.d.ts +4 -0
  85. package/dist/mjs/types/index.d.ts.map +1 -1
  86. package/dist/mjs/types/index.js +4 -0
  87. package/dist/mjs/types/index.js.map +1 -1
  88. package/dist/mjs/utils/societyApproval.d.ts.map +1 -1
  89. package/dist/mjs/utils/societyApproval.js +6 -3
  90. package/dist/mjs/utils/societyApproval.js.map +1 -1
  91. package/package.json +1 -1
  92. package/ts/api/resources/Transaction.ts +3 -0
  93. package/ts/api/resources/UsersHistory.ts +35 -0
  94. package/ts/api/resources.ts +2 -0
  95. package/ts/types/Enum/PrestationType.ts +84 -67
  96. package/ts/types/Enum/SocietyApproval.ts +6 -6
  97. package/ts/types/Enum/UsersHistory.ts +38 -0
  98. package/ts/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.ts +18 -2
  99. package/ts/types/Interface/api/usersHistory/Create.ts +21 -0
  100. package/ts/types/Interface/api/usersHistory/Update.ts +17 -0
  101. package/ts/types/Interface/models/IUsersHistory.ts +17 -0
  102. package/ts/types/index.ts +5 -0
  103. package/ts/utils/societyApproval.ts +10 -3
@@ -1,7 +1,7 @@
1
- import { IsBoolean, IsNumber, IsOptional } from 'class-validator';
1
+ import { IsArray, IsBoolean, IsInt, IsNumber, IsOptional } from 'class-validator';
2
2
  import { IAccountingTransaction, IImmobilization } from '../../..';
3
3
  import { IThirdParty } from '../../models/IThirdParty';
4
- import { ApiPropertyOptional } from '../../../../utils';
4
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
5
5
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
6
6
 
7
7
  export type FormImmobilization = IImmobilization;
@@ -58,6 +58,22 @@ export class UpdateAccountingTransaction {
58
58
  idAccountant?: number;
59
59
  }
60
60
 
61
+ export class UpdateAllAccountingTransaction {
62
+ @ApiProperty()
63
+ @IsArray()
64
+ @IsInt({ each: true })
65
+ ids: number[];
66
+
67
+ @ApiProperty()
68
+ data: UpdateAccountingTransaction;
69
+ }
70
+
71
+ export interface UpdatedAccountingTransactions {
72
+ processed: number;
73
+ errors: Array<{ id: number; message: string; code: string }>;
74
+ updatedTransactions: ReadFormattedAccountingTransaction[];
75
+ }
76
+
61
77
  export interface UploadedAccountingFileInfos {
62
78
  location: string;
63
79
  idFile: number;
@@ -0,0 +1,21 @@
1
+ import { IsEnum, IsInt, IsOptional, IsString } from 'class-validator';
2
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils/decorators';
3
+ import { TypeUserHistory } from '../../../Enum/UsersHistory';
4
+ import { IUsersHistory } from '../../models/IUsersHistory';
5
+
6
+ export class CreateUsersHistory implements Omit<IUsersHistory, 'id' | 'createdAt' | 'updatedAt' | 'idAuthor'> {
7
+ @ApiProperty()
8
+ @IsInt()
9
+ idUser: number;
10
+
11
+
12
+
13
+ @ApiPropertyOptional()
14
+ @IsOptional()
15
+ @IsString()
16
+ comment?: string;
17
+
18
+ @ApiProperty()
19
+ @IsEnum(TypeUserHistory)
20
+ actionType: TypeUserHistory;
21
+ }
@@ -0,0 +1,17 @@
1
+ import { IsEnum, IsOptional, IsString } from 'class-validator';
2
+ import { ApiPropertyOptional } from '../../../../utils/decorators';
3
+ import { TypeUserHistory } from '../../../Enum/UsersHistory';
4
+ import { IUsersHistory } from '../../models/IUsersHistory';
5
+
6
+
7
+ export class UpdateUsersHistory implements Partial<Omit<IUsersHistory, 'id' | 'idUser' | 'idAuthor'>> {
8
+ @ApiPropertyOptional()
9
+ @IsOptional()
10
+ @IsString()
11
+ comment?: string;
12
+
13
+ @ApiPropertyOptional()
14
+ @IsOptional()
15
+ @IsEnum(TypeUserHistory)
16
+ actionType?: TypeUserHistory;
17
+ }
@@ -0,0 +1,17 @@
1
+ import { IUser } from './IUser';
2
+ import { TypeUserHistory } from '../../Enum/UsersHistory';
3
+
4
+ export interface IUsersHistory {
5
+ id?: number;
6
+ idUser: number;
7
+ idAuthor?: number | null;
8
+ comment?: string | null;
9
+ actionType: TypeUserHistory;
10
+ createdAt?: Date | null;
11
+ updatedAt?: Date | null;
12
+
13
+
14
+ // Relations
15
+ user?: IUser;
16
+ author?: IUser;
17
+ }
package/ts/types/index.ts CHANGED
@@ -329,6 +329,7 @@ export * from './Interface/models/IDocumentRequest';
329
329
  export * from './Interface/models/IInformationRequest';
330
330
  export * from './Interface/models/IRevenueMovement';
331
331
  export * from './Interface/models/IRevenueSnapshot';
332
+ export * from './Interface/models/IUsersHistory';
332
333
 
333
334
  // Schemas
334
335
  export * from './Interface/schemas/IRegistrationDetail';
@@ -568,6 +569,7 @@ export * from './Enum/InformationRequestType';
568
569
  export * from './Enum/InformationRequestState';
569
570
  export * from './Enum/Revenue';
570
571
  export * from './Enum/EbookIntention';
572
+ export * from './Enum/UsersHistory';
571
573
 
572
574
  // Interfaces API
573
575
  export * from './Interface/api/authentification/AuthenticationResponse';
@@ -792,6 +794,9 @@ export * from './Interface/api/constitutionHistory/QueryPaginatedConstitutionHis
792
794
  export * from './Interface/api/userSpecialDay/BodyUserSpecialDay';
793
795
  export * from './Interface/api/userSpecialDay/QueryUserSpecialDay';
794
796
  export * from './Interface/api/oldExportInfo/OldExpertInfos';
797
+ export * from './Interface/api/usersHistory/Create';
798
+ export * from './Interface/api/usersHistory/Update';
799
+
795
800
 
796
801
  // export * from './Interface/api/survey/QuerySurvey';
797
802
  export * from './Interface/api/survey/ReadSurvey';
@@ -81,8 +81,15 @@ export function getApprovalDocumentInfos(
81
81
  * @returns L'objet de données formaté pour le template
82
82
  */
83
83
  export function buildApprovalTemplateData(existingApproval: ISocietyApproval, style: string): Record<string, any> {
84
- const yearInText = convertNumberToLetter(+dayjs().format('YYYY')).toLowerCase();
85
- const dayAndMonthInText = `${convertNumberToLetter(+dayjs().format('D'))} ${dayjs().locale('fr').format('MMMM').toLowerCase()}`;
84
+ const yearInText = convertNumberToLetter(
85
+ +dayjs(existingApproval?.generatingDatas?.approvalDate || null).format('YYYY'),
86
+ ).toLowerCase();
87
+ const dayAndMonthInText = `${convertNumberToLetter(+dayjs(existingApproval?.generatingDatas?.approvalDate || null).format('D'))} ${dayjs(
88
+ existingApproval?.generatingDatas?.approvalDate || null,
89
+ )
90
+ .locale('fr')
91
+ .format('MMMM')
92
+ .toLowerCase()}`;
86
93
  const brand = getBrand();
87
94
  return {
88
95
  // Variables globales
@@ -131,7 +138,7 @@ export function buildApprovalTemplateData(existingApproval: ISocietyApproval, st
131
138
  ...existingApproval?.exercice?.society,
132
139
  cityOfGreffe: getCityOfGreffeName(existingApproval?.exercice?.society?.idCityOfGreffe).toUpperCase(),
133
140
  siren: existingApproval?.exercice?.society?.siret
134
- ? siretToSiren(existingApproval.exercice.society.siret)
141
+ ? siretToSiren(existingApproval.exercice.society.siret)?.replace(/(\d{3})(\d{3})(\d{3})/, '$1 $2 $3') ?? null
135
142
  : null,
136
143
  },
137
144
  endDate: dayjs(existingApproval?.exercice?.endDate).locale('fr').format('DD MMMM YYYY').toLowerCase(),