@silexpert/core 1.1.127 → 1.1.129

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 (105) hide show
  1. package/es/api/resources/Das.d.ts +9 -0
  2. package/es/api/resources/Das.d.ts.map +1 -0
  3. package/es/api/resources/Das.js +17 -0
  4. package/es/api/resources/Das.js.map +1 -0
  5. package/es/types/Enum/Aspone.d.ts +2 -1
  6. package/es/types/Enum/Aspone.d.ts.map +1 -1
  7. package/es/types/Enum/Aspone.js +1 -0
  8. package/es/types/Enum/Aspone.js.map +1 -1
  9. package/es/types/Enum/BrandLegalstart.d.ts +16 -0
  10. package/es/types/Enum/BrandLegalstart.d.ts.map +1 -1
  11. package/es/types/Enum/BrandLegalstart.js +90 -0
  12. package/es/types/Enum/BrandLegalstart.js.map +1 -1
  13. package/es/types/Enum/CerfaType.d.ts +2 -1
  14. package/es/types/Enum/CerfaType.d.ts.map +1 -1
  15. package/es/types/Enum/CerfaType.js +1 -0
  16. package/es/types/Enum/CerfaType.js.map +1 -1
  17. package/es/types/Enum/Country.d.ts +4 -0
  18. package/es/types/Enum/Country.d.ts.map +1 -1
  19. package/es/types/Enum/Country.js +6440 -0
  20. package/es/types/Enum/Country.js.map +1 -1
  21. package/es/types/Enum/Das.d.ts +15 -0
  22. package/es/types/Enum/Das.d.ts.map +1 -0
  23. package/es/types/Enum/Das.js +22 -0
  24. package/es/types/Enum/Das.js.map +1 -0
  25. package/es/types/Enum/TimeCounterType.d.ts +7 -0
  26. package/es/types/Enum/TimeCounterType.d.ts.map +1 -1
  27. package/es/types/Enum/TimeCounterType.js +7 -0
  28. package/es/types/Enum/TimeCounterType.js.map +1 -1
  29. package/es/types/Interface/api/aspone/ReadInterchange.d.ts +1 -1
  30. package/es/types/Interface/api/aspone/ReadInterchange.d.ts.map +1 -1
  31. package/es/types/Interface/api/aspone/ReadInterchange.js.map +1 -1
  32. package/es/types/Interface/api/calendarEvent/createCalendarEvent.d.ts +1 -1
  33. package/es/types/Interface/api/calendarEvent/createCalendarEvent.d.ts.map +1 -1
  34. package/es/types/Interface/api/calendarEvent/createCalendarEvent.js +1 -1
  35. package/es/types/Interface/api/calendarEvent/createCalendarEvent.js.map +1 -1
  36. package/es/types/Interface/api/cerfa/ReadCerfa.d.ts +1 -0
  37. package/es/types/Interface/api/cerfa/ReadCerfa.d.ts.map +1 -1
  38. package/es/types/Interface/api/cerfa/ReadCerfa.js.map +1 -1
  39. package/es/types/Interface/api/cerfa/das2.d.ts +112 -0
  40. package/es/types/Interface/api/cerfa/das2.d.ts.map +1 -0
  41. package/es/types/Interface/api/cerfa/das2.js +65 -0
  42. package/es/types/Interface/api/cerfa/das2.js.map +1 -0
  43. package/es/types/Interface/models/IApiError.d.ts +2 -1
  44. package/es/types/Interface/models/IApiError.d.ts.map +1 -1
  45. package/es/types/Interface/models/IApiError.js +1 -0
  46. package/es/types/Interface/models/IApiError.js.map +1 -1
  47. package/es/types/Interface/models/IThirdParty.d.ts +1 -0
  48. package/es/types/Interface/models/IThirdParty.d.ts.map +1 -1
  49. package/es/types/Interface/models/IThirdParty.js.map +1 -1
  50. package/es/types/index.d.ts +2 -0
  51. package/es/types/index.d.ts.map +1 -1
  52. package/es/types/index.js +2 -0
  53. package/es/types/index.js.map +1 -1
  54. package/es/utils/documents.js +1 -1
  55. package/es/utils/documents.js.map +1 -1
  56. package/es/utils/phone.d.ts +1 -0
  57. package/es/utils/phone.d.ts.map +1 -1
  58. package/es/utils/phone.js +8 -0
  59. package/es/utils/phone.js.map +1 -1
  60. package/js/api/resources/Das.js +26 -0
  61. package/js/api/resources/Das.js.map +1 -0
  62. package/js/types/Enum/Aspone.js +1 -0
  63. package/js/types/Enum/Aspone.js.map +1 -1
  64. package/js/types/Enum/BrandLegalstart.js +81 -1
  65. package/js/types/Enum/BrandLegalstart.js.map +1 -1
  66. package/js/types/Enum/CerfaType.js +1 -0
  67. package/js/types/Enum/CerfaType.js.map +1 -1
  68. package/js/types/Enum/Country.js +19315 -0
  69. package/js/types/Enum/Country.js.map +1 -1
  70. package/js/types/Enum/Das.js +42 -0
  71. package/js/types/Enum/Das.js.map +1 -0
  72. package/js/types/Enum/TimeCounterType.js +7 -0
  73. package/js/types/Enum/TimeCounterType.js.map +1 -1
  74. package/js/types/Interface/api/aspone/ReadInterchange.js.map +1 -1
  75. package/js/types/Interface/api/calendarEvent/createCalendarEvent.js +1 -1
  76. package/js/types/Interface/api/calendarEvent/createCalendarEvent.js.map +1 -1
  77. package/js/types/Interface/api/cerfa/ReadCerfa.js.map +1 -1
  78. package/js/types/Interface/api/cerfa/das2.js +36 -0
  79. package/js/types/Interface/api/cerfa/das2.js.map +1 -0
  80. package/js/types/Interface/models/IApiError.js +1 -0
  81. package/js/types/Interface/models/IApiError.js.map +1 -1
  82. package/js/types/Interface/models/IThirdParty.js.map +1 -1
  83. package/js/types/index.js +20 -0
  84. package/js/types/index.js.map +1 -1
  85. package/js/utils/documents.js +1 -1
  86. package/js/utils/documents.js.map +1 -1
  87. package/js/utils/phone.js +9 -0
  88. package/js/utils/phone.js.map +1 -1
  89. package/package.json +1 -1
  90. package/ts/api/resources/Das.ts +21 -0
  91. package/ts/types/Enum/Aspone.ts +1 -0
  92. package/ts/types/Enum/BrandLegalstart.ts +91 -0
  93. package/ts/types/Enum/CerfaType.ts +1 -0
  94. package/ts/types/Enum/Country.ts +6441 -0
  95. package/ts/types/Enum/Das.ts +21 -0
  96. package/ts/types/Enum/TimeCounterType.ts +7 -0
  97. package/ts/types/Interface/api/aspone/ReadInterchange.ts +1 -1
  98. package/ts/types/Interface/api/calendarEvent/createCalendarEvent.ts +2 -2
  99. package/ts/types/Interface/api/cerfa/ReadCerfa.ts +1 -1
  100. package/ts/types/Interface/api/cerfa/das2.ts +142 -0
  101. package/ts/types/Interface/models/IApiError.ts +1 -0
  102. package/ts/types/Interface/models/IThirdParty.ts +1 -0
  103. package/ts/types/index.ts +2 -0
  104. package/ts/utils/documents.ts +1 -1
  105. package/ts/utils/phone.ts +12 -0
@@ -0,0 +1,21 @@
1
+ export enum DasNature {
2
+ FEE = 'H',
3
+ COMMISSION = 'C',
4
+ BROKERAGE = 'CO',
5
+ REBATE = 'R',
6
+ ATTENDANCE_FEE = 'JP',
7
+ COPYRIGHT = 'DA',
8
+ INVENTOR_RIGHT = 'DI',
9
+ OTHER = 'AR',
10
+ }
11
+
12
+ export const DasNatureList: Array<{ label: string; id: DasNature }> = [
13
+ { label: 'Honoraires et vacations', id: DasNature.FEE },
14
+ { label: 'Commissions', id: DasNature.COMMISSION },
15
+ { label: 'Courtages', id: DasNature.BROKERAGE },
16
+ { label: 'Ristournes', id: DasNature.REBATE },
17
+ { label: 'Jetons de présence', id: DasNature.ATTENDANCE_FEE },
18
+ { label: 'Droits d\'auteur', id: DasNature.COPYRIGHT },
19
+ { label: 'Droits d\'inventeur', id: DasNature.INVENTOR_RIGHT },
20
+ { label: 'Autres rémunérations', id: DasNature.OTHER },
21
+ ];
@@ -260,4 +260,11 @@ export const TimeCounterType = {
260
260
  limitedRoles: null,
261
261
  color: 'fern-dark',
262
262
  },
263
+ CONNECTION: {
264
+ id: 38,
265
+ label: 'Connection',
266
+ aberrantTime: 15,
267
+ limitedRoles: null,
268
+ color: 'success',
269
+ },
263
270
  };
@@ -58,7 +58,7 @@ export class Redactor {
58
58
  referenceDossier: string;
59
59
  }
60
60
 
61
- type Tag = 'Valeur' | 'AdresseVille' | 'AdresseVoie' | 'AdresseCodePays' | 'AdresseComplement' | 'AdresseCodePostal' | 'AdresseHameau' | 'Telephone' | 'Designation' | 'DesignationSuite1' | 'DesignationSuite2' | 'Identifiant' | 'TexteLibre1' | 'TexteLibre2' | 'TexteLibre3' | 'TexteLibre4' | 'TexteLibre5' | 'DesignationSuite3' | 'AdresseNumero' | 'Iban' | 'Bic' | 'TitulaireDesignation' | 'TitulaireDesignationSuite';
61
+ type Tag = 'ContactDesignation' | 'AdresseDivisionTerritoriale' | 'AdresseCodeDivisionTerritoriale' | 'Email' | 'Valeur' | 'AdresseVille' | 'AdresseVoie' | 'AdresseCodePays' | 'AdresseComplement' | 'AdresseCodePostal' | 'AdresseHameau' | 'Telephone' | 'Designation' | 'DesignationSuite1' | 'DesignationSuite2' | 'Identifiant' | 'TexteLibre1' | 'TexteLibre2' | 'TexteLibre3' | 'TexteLibre4' | 'TexteLibre5' | 'DesignationSuite3' | 'AdresseNumero' | 'Iban' | 'Bic' | 'TitulaireDesignation' | 'TitulaireDesignationSuite';
62
62
  type Tags = Array<{ description: string; tag: Tag; value: any }>;
63
63
 
64
64
  export interface FieldForGeneration {
@@ -22,8 +22,8 @@ export class createCalendarEvent {
22
22
  @ApiPropertyOptional()
23
23
  idColor?: number;
24
24
 
25
- @ApiProperty()
26
- idSociety: number;
25
+ @ApiPropertyOptional()
26
+ idSociety?: number;
27
27
 
28
28
  @ApiPropertyOptional()
29
29
  idExercice?: number;
@@ -99,5 +99,5 @@ export type Termination = {
99
99
  date: string | null
100
100
  };
101
101
 
102
- export type AsponeFormFields = Array<{ name: string; fields: FieldForGeneration[] }>;
102
+ export type AsponeFormFields = Array<{ name: string; fields: FieldForGeneration[], index?: number }>;
103
103
  export type AsponeFormField = { name: string; fields: FieldForGeneration[] };
@@ -0,0 +1,142 @@
1
+ import { IsArray, IsBoolean, IsDateString, IsObject, IsOptional } from 'class-validator';
2
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
3
+ import { DasNature } from '../../../Enum/Das';
4
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
5
+
6
+ export interface Das2ThirdPartyPersonnalizedData {
7
+ amount: number;
8
+ nature: DasNature;
9
+ }
10
+
11
+ export interface Das2ThirdParty {
12
+ totalTaxIncluded: number;
13
+ fullnameOrCompany: string;
14
+ address: {
15
+ number: string | null;
16
+ street: string | null;
17
+ zipCode: string | null;
18
+ city: string | null;
19
+ };
20
+ legalForm: number;
21
+ siret: string | null;
22
+ other: Das2ThirdPartyPersonnalizedData[];
23
+ nature: {
24
+ value: number;
25
+ food: number;
26
+ };
27
+ indemnities: {
28
+ amount: number;
29
+ letter: string | null;
30
+ };
31
+ vat: number[];
32
+ source: {
33
+ amount: number;
34
+ letter: string | null;
35
+ }
36
+
37
+ // Déterminé automatiquement
38
+ isPhysical?: boolean;
39
+ firstname?: string | null;
40
+ lastname?: string | null;
41
+ occupation?: string | null;
42
+ inseeNumber?: string | null;
43
+ distributor?: string | null;
44
+ name?: string | null;
45
+ }
46
+ export interface Das2PdfForm {
47
+ header: {
48
+ firstname: string | null;
49
+ siret: string | null;
50
+ apeCode: string | null;
51
+ name: string | null;
52
+ endDate: {
53
+ day: string | null;
54
+ month: string | null;
55
+ };
56
+ activity: string | null;
57
+ address: {
58
+ complement: string | null;
59
+ number: string | null;
60
+ street: string | null;
61
+ zipCode: string | null;
62
+ city: string | null;
63
+ insee: string | null;
64
+ distributor: string | null;
65
+ };
66
+ establishment: {
67
+ name: string | null;
68
+ address: {
69
+ number: string | null;
70
+ street: string | null;
71
+ zipCode: string | null;
72
+ city: string | null;
73
+ }
74
+ };
75
+ sign: {
76
+ date: string | null;
77
+ place: string | null;
78
+ }
79
+ contact: {
80
+ firstname: string | null;
81
+ email: {
82
+ part2: string | null;
83
+ part1: string | null;
84
+ }
85
+ lastname: string | null;
86
+ phone: string | null;
87
+ }
88
+ }
89
+ thirdParties: Das2ThirdParty[];
90
+ exercice: { startDate: string; endDate: string; year: string; }
91
+ total: {
92
+ case4: number;
93
+ case5: number;
94
+ case6: number;
95
+ case7: number;
96
+ case9: number;
97
+ }
98
+ }
99
+
100
+ export class QueryDasTransaction {
101
+ @ApiProperty()
102
+ @IsDateString()
103
+ startDate: string;
104
+
105
+ @ApiProperty()
106
+ @IsDateString()
107
+ endDate: string;
108
+ }
109
+
110
+ export class DeclareDasRegistration {
111
+ @ApiPropertyOptional()
112
+ @IsOptional()
113
+ @IsBoolean()
114
+ @ToBoolean()
115
+ isTestMode?: boolean;
116
+ }
117
+
118
+ export class CreateDasRegistration {
119
+ @ApiProperty()
120
+ @IsArray()
121
+ thirdParties: Das2ThirdParty[];
122
+
123
+ @ApiPropertyOptional()
124
+ @IsBoolean()
125
+ @ToBoolean()
126
+ @IsOptional()
127
+ isTestingMode?: boolean;
128
+
129
+ @ApiProperty()
130
+ @IsDateString()
131
+ startDate: string;
132
+
133
+ @ApiProperty()
134
+ @IsDateString()
135
+ endDate: string;
136
+ }
137
+
138
+ export class QueryDasPreview {
139
+ @ApiProperty()
140
+ @IsObject()
141
+ payload: Das2PdfForm;
142
+ }
@@ -191,6 +191,7 @@ export enum Code {
191
191
 
192
192
  // Expense Notes
193
193
  LIMIT_MONTH_REACHED = 'limit_month_reached',
194
+ REQUIRED_PARAM_IS_MISSING = 'required_param_is_missing',
194
195
  }
195
196
 
196
197
  export interface IApiError {
@@ -17,6 +17,7 @@ export interface IThirdParty {
17
17
  phone?: string | null;
18
18
  email?: string | null;
19
19
  nSiret?: string | null;
20
+ legalForm?: number | null;
20
21
  nTva?: string | null;
21
22
  soldeInit: number;
22
23
  state?: boolean | null;
package/ts/types/index.ts CHANGED
@@ -320,6 +320,7 @@ export * from './Form/FormAuthenticate';
320
320
  export * from './Form/FormConnector';
321
321
 
322
322
  // Enums
323
+ export * from './Enum/Das';
323
324
  export * from './Enum/ChangeLog';
324
325
  export * from './Enum/VisualizedInformation';
325
326
  export * from './Enum/NafCode';
@@ -490,6 +491,7 @@ export * from './Enum/MissionAcceptation';
490
491
  export * from './Enum/Bank';
491
492
 
492
493
  // Interfaces API
494
+ export * from './Interface/api/cerfa/das2';
493
495
  export * from './Interface/api/adjustment/Query';
494
496
  export * from './Interface/api/adjustment/Read';
495
497
  export * from './Interface/api/vatDeclaration/ReadVatDeclaration';
@@ -3,7 +3,7 @@ import { LegalForm } from '../types/Enum/LegalForm';
3
3
 
4
4
  const requiredListDocs = (idLegalForm: number, isOnlyPrevi?: boolean, isOnlyJuridic?: boolean, isOnlySocial?: boolean, isCreation?: boolean): GedFileType[] => {
5
5
  if (isOnlyPrevi) {
6
- return [GedFileType.IDENTITY_CARD, GedFileType.PLAQUETTE, GedFileType.RIB, GedFileType.SEPA];
6
+ return [GedFileType.IDENTITY_CARD, GedFileType.PLAQUETTE];
7
7
  }
8
8
  if (isCreation || isOnlyJuridic || isOnlySocial) {
9
9
  return [GedFileType.RIB, GedFileType.PLAQUETTE];
package/ts/utils/phone.ts CHANGED
@@ -62,4 +62,16 @@ export function getPhoneNumberFromRoles(roles: number[], attribute: 'phoneNumber
62
62
  }
63
63
 
64
64
  return null;
65
+ }
66
+
67
+ export function formatPhoneNumberToNational(phoneNumber: string): string {
68
+
69
+ const phoneWithoutSpace = phoneNumber.replace(/ /g, '');
70
+
71
+ if (phoneWithoutSpace?.startsWith('+33')) {
72
+ return phoneWithoutSpace.replace('+33', '0');
73
+ }
74
+
75
+ // Fonction à mettre à jour en fonction des cas de notre bdd
76
+ return phoneWithoutSpace;
65
77
  }