@silexpert/core 1.0.77 → 1.0.78

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 (36) hide show
  1. package/es/api/resources/Library.d.ts +2 -1
  2. package/es/api/resources/Library.d.ts.map +1 -1
  3. package/es/api/resources/Library.js +3 -0
  4. package/es/api/resources/Library.js.map +1 -1
  5. package/es/types/Interface/api/gedFile/updateGedFile.d.ts +11 -0
  6. package/es/types/Interface/api/gedFile/updateGedFile.d.ts.map +1 -0
  7. package/es/types/Interface/api/gedFile/updateGedFile.js +45 -0
  8. package/es/types/Interface/api/gedFile/updateGedFile.js.map +1 -0
  9. package/es/types/Interface/api/library/QueryLibrary.d.ts +12 -2
  10. package/es/types/Interface/api/library/QueryLibrary.d.ts.map +1 -1
  11. package/es/types/Interface/api/library/QueryLibrary.js +36 -2
  12. package/es/types/Interface/api/library/QueryLibrary.js.map +1 -1
  13. package/es/types/index.d.ts +1 -0
  14. package/es/types/index.d.ts.map +1 -1
  15. package/es/types/index.js +1 -0
  16. package/es/types/index.js.map +1 -1
  17. package/es/utils/siretValidation.d.ts +1 -0
  18. package/es/utils/siretValidation.d.ts.map +1 -1
  19. package/es/utils/siretValidation.js +13 -0
  20. package/es/utils/siretValidation.js.map +1 -1
  21. package/js/api/resources/Library.js +4 -0
  22. package/js/api/resources/Library.js.map +1 -1
  23. package/js/types/Interface/api/gedFile/updateGedFile.js +41 -0
  24. package/js/types/Interface/api/gedFile/updateGedFile.js.map +1 -0
  25. package/js/types/Interface/api/library/QueryLibrary.js +23 -3
  26. package/js/types/Interface/api/library/QueryLibrary.js.map +1 -1
  27. package/js/types/index.js +12 -0
  28. package/js/types/index.js.map +1 -1
  29. package/js/utils/siretValidation.js +17 -0
  30. package/js/utils/siretValidation.js.map +1 -1
  31. package/package.json +1 -1
  32. package/ts/api/resources/Library.ts +7 -1
  33. package/ts/types/Interface/api/gedFile/updateGedFile.ts +27 -0
  34. package/ts/types/Interface/api/library/QueryLibrary.ts +30 -4
  35. package/ts/types/index.ts +1 -0
  36. package/ts/utils/siretValidation.ts +13 -0
@@ -0,0 +1,27 @@
1
+ import { ApiPropertyOptional } from '../../../../utils';
2
+
3
+ export class UpdateGedFile {
4
+ @ApiPropertyOptional()
5
+ emissionDate: Date;
6
+
7
+ @ApiPropertyOptional()
8
+ statutFile: number;
9
+
10
+ @ApiPropertyOptional()
11
+ idTypeGedFile: number;
12
+
13
+ @ApiPropertyOptional()
14
+ idUser: number;
15
+
16
+ @ApiPropertyOptional()
17
+ idGedFolder: number;
18
+
19
+ @ApiPropertyOptional()
20
+ idSociety: number;
21
+
22
+ @ApiPropertyOptional()
23
+ idFile: number;
24
+
25
+ @ApiPropertyOptional()
26
+ idExercice: number;
27
+ }
@@ -5,14 +5,17 @@ export class QueryLibraryFile {
5
5
  @ApiProperty()
6
6
  idSociety: number;
7
7
 
8
- @ApiProperty()
9
- idGedFolder: GedFolder;
8
+ @ApiPropertyOptional()
9
+ idGedFolder?: GedFolder;
10
10
 
11
- @ApiProperty()
12
- idTypeGedFile: GedFileType;
11
+ @ApiPropertyOptional()
12
+ idTypeGedFile?: GedFileType;
13
13
 
14
14
  @ApiPropertyOptional()
15
15
  idExercice?: number;
16
+
17
+ @ApiPropertyOptional()
18
+ idFile?: number;
16
19
  }
17
20
 
18
21
  export class QueryDownloadFile {
@@ -27,4 +30,27 @@ export class QueryDownloadFile {
27
30
 
28
31
  @ApiPropertyOptional()
29
32
  idMail?: number;
33
+ }
34
+
35
+ export class UpdateOrCreateGedFile {
36
+ @ApiProperty()
37
+ idFile: number;
38
+
39
+ @ApiPropertyOptional()
40
+ emissionDate?: Date;
41
+
42
+ @ApiPropertyOptional()
43
+ idUser?: number;
44
+
45
+ @ApiProperty()
46
+ idGedFolder: number;
47
+
48
+ @ApiPropertyOptional()
49
+ idSociety?: number;
50
+
51
+ @ApiPropertyOptional()
52
+ idExercice?: number;
53
+
54
+ @ApiPropertyOptional()
55
+ idTypeGedFile?: number;
30
56
  }
package/ts/types/index.ts CHANGED
@@ -830,6 +830,7 @@ export * from './Interface/api/wallet/QueryWallet';
830
830
  export * from './Interface/api/terminationList/QueryTerminationList';
831
831
  export * from './Interface/api/terminationList/DestroyTerminationList';
832
832
  export * from './Interface/api/pdf/ReadPdfizer';
833
+ export * from './Interface/api/gedFile/updateGedFile';
833
834
 
834
835
  // Enums types
835
836
  export * from './Interface/enum/Util';
@@ -1,3 +1,6 @@
1
+ import { isDefined } from 'class-validator';
2
+ import { CountryId } from '../types/Enum/Country';
3
+
1
4
  export function validateSiret(siret: string) {
2
5
  if (!/^\d{14}$/.test(siret)) throw new Error('Invalid SIRET format');
3
6
 
@@ -31,4 +34,14 @@ export function getVatCodeBySiren(siren: string, countryCode = 'FR'): string {
31
34
  const validSiren = siren.replace(/\s/g, '');
32
35
  // @ts-ignore
33
36
  return `${countryCode}${[12 + 3 * (validSiren % 97)] % 97}${validSiren}`;
37
+ }
38
+
39
+ export function siretToSiren(siret: string, idCountry?: number): string | null {
40
+ if (typeof siret !== 'string') return null;
41
+ if (isDefined(idCountry) && idCountry !== CountryId.FRANCE) return siret;
42
+ let siren = siret.replace(/ */g, '');
43
+ if (siren && siren.length > 9) {
44
+ siren = siren.substring(0, 9);
45
+ }
46
+ return siren;
34
47
  }