@silexpert/core 1.2.88 → 1.2.89

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 (45) hide show
  1. package/dist/cjs/types/Enum/ReasonNotSubscribed.js +1 -1
  2. package/dist/cjs/types/Enum/ReasonNotSubscribed.js.map +1 -1
  3. package/dist/cjs/types/Interface/api/cerfa/2572.d.ts +77 -0
  4. package/dist/cjs/types/Interface/api/cerfa/2572.d.ts.map +1 -1
  5. package/dist/cjs/types/Interface/api/cerfa/2572.js +4 -1
  6. package/dist/cjs/types/Interface/api/cerfa/2572.js.map +1 -1
  7. package/dist/cjs/types/Interface/api/cerfa/ReadCerfa.d.ts +2 -2
  8. package/dist/cjs/types/Interface/api/cerfa/ReadCerfa.d.ts.map +1 -1
  9. package/dist/cjs/types/Interface/api/cerfa/ReadCerfa.js.map +1 -1
  10. package/dist/cjs/types/Interface/api/mail/QueryGetSignature.d.ts +1 -0
  11. package/dist/cjs/types/Interface/api/mail/QueryGetSignature.d.ts.map +1 -1
  12. package/dist/cjs/types/Interface/api/mail/QueryGetSignature.js +6 -0
  13. package/dist/cjs/types/Interface/api/mail/QueryGetSignature.js.map +1 -1
  14. package/dist/cjs/types/Interface/api/pdf/ReadPdfizer.d.ts +1 -0
  15. package/dist/cjs/types/Interface/api/pdf/ReadPdfizer.d.ts.map +1 -1
  16. package/dist/cjs/types/Interface/api/pdf/ReadPdfizer.js.map +1 -1
  17. package/dist/cjs/utils/email.d.ts.map +1 -1
  18. package/dist/cjs/utils/email.js +15 -2
  19. package/dist/cjs/utils/email.js.map +1 -1
  20. package/dist/mjs/types/Enum/ReasonNotSubscribed.js +1 -1
  21. package/dist/mjs/types/Enum/ReasonNotSubscribed.js.map +1 -1
  22. package/dist/mjs/types/Interface/api/cerfa/2572.d.ts +77 -0
  23. package/dist/mjs/types/Interface/api/cerfa/2572.d.ts.map +1 -1
  24. package/dist/mjs/types/Interface/api/cerfa/2572.js +13 -0
  25. package/dist/mjs/types/Interface/api/cerfa/2572.js.map +1 -1
  26. package/dist/mjs/types/Interface/api/cerfa/ReadCerfa.d.ts +2 -2
  27. package/dist/mjs/types/Interface/api/cerfa/ReadCerfa.d.ts.map +1 -1
  28. package/dist/mjs/types/Interface/api/cerfa/ReadCerfa.js.map +1 -1
  29. package/dist/mjs/types/Interface/api/mail/QueryGetSignature.d.ts +1 -0
  30. package/dist/mjs/types/Interface/api/mail/QueryGetSignature.d.ts.map +1 -1
  31. package/dist/mjs/types/Interface/api/mail/QueryGetSignature.js +7 -0
  32. package/dist/mjs/types/Interface/api/mail/QueryGetSignature.js.map +1 -1
  33. package/dist/mjs/types/Interface/api/pdf/ReadPdfizer.d.ts +1 -0
  34. package/dist/mjs/types/Interface/api/pdf/ReadPdfizer.d.ts.map +1 -1
  35. package/dist/mjs/types/Interface/api/pdf/ReadPdfizer.js.map +1 -1
  36. package/dist/mjs/utils/email.d.ts.map +1 -1
  37. package/dist/mjs/utils/email.js +15 -2
  38. package/dist/mjs/utils/email.js.map +1 -1
  39. package/package.json +1 -1
  40. package/ts/types/Enum/ReasonNotSubscribed.ts +1 -1
  41. package/ts/types/Interface/api/cerfa/2572.ts +80 -0
  42. package/ts/types/Interface/api/cerfa/ReadCerfa.ts +2 -4
  43. package/ts/types/Interface/api/mail/QueryGetSignature.ts +5 -0
  44. package/ts/types/Interface/api/pdf/ReadPdfizer.ts +1 -1
  45. package/ts/utils/email.ts +16 -4
@@ -1,5 +1,7 @@
1
1
  import { Termination, CerfaAddress } from './ReadCerfa';
2
2
 
3
+ export type AnyCerfa2572Century = Cerfa2572_2022 | Cerfa2572_2023 | Cerfa2572_2024 | Cerfa2572_2025;
4
+
3
5
  type BaseAndAmount = {
4
6
  base: number;
5
7
  amount: number;
@@ -213,6 +215,70 @@ type Debts_2024 = {
213
215
  taxAmount: number;
214
216
  };
215
217
 
218
+ type Debts_2025 = {
219
+ onCompanyTax: number;
220
+ notOnCompanyTax: number;
221
+ VEL: number;
222
+ PRE: number;
223
+ new: number;
224
+ companyTaxAfterImputation: number;
225
+ reducedTax: {
226
+ inEurope: number;
227
+ amount: number;
228
+ };
229
+ balanceInPreviousExercises: number;
230
+ jobCredit: PreFinancingWithAmount;
231
+ jobCreditForLongExercises: PreFinancingWithAmount;
232
+ jobCreditForPreviousExercises: number;
233
+ corse: number;
234
+ CORInPreviousExercise: number;
235
+ deficit: number;
236
+ RADInPreviousExercise: number;
237
+ CIRcredit: number;
238
+ CIRsolde: number;
239
+ CRCcredit: number;
240
+ CRCsolde: number;
241
+ LIcredit: number;
242
+ LIsolde: number;
243
+ reportedInLine2B11: number;
244
+ subTotal1: number;
245
+ subTotal: number;
246
+ inDepositLimit: number;
247
+ balanceDebtInPreviousExercises: number;
248
+ reducedTaxOuterSea: number;
249
+ balanceInPreviousExercisesOuterSea: number;
250
+ onLoanAtZeroRate: number;
251
+ balanceOnLoanAtZeroRate: number;
252
+ FOR: number;
253
+ RAC: number;
254
+ FAM: number;
255
+ CIN: number;
256
+ BIO: number;
257
+ PHO: number;
258
+ AUD: number;
259
+ ART: number;
260
+ CJV: number;
261
+ CPE: number;
262
+ CCI: number;
263
+ PTR: number;
264
+ CIO: PreFinancingWithAmount;
265
+ COL: PreFinancingWithAmount;
266
+ CSV: number;
267
+ REB: number;
268
+ RTD: number;
269
+ CPG: number;
270
+ HVE: number;
271
+ EOM: number;
272
+ '3IV': number;
273
+ PAM: number;
274
+ newUnlistedReceivables: number;
275
+ inLine2C22: number;
276
+ subTotal2: number;
277
+ afterImputation: number;
278
+ payment: number;
279
+ taxAmount: number;
280
+ };
281
+
216
282
  type SocialContribution = {
217
283
  CSB: BaseAndAmount;
218
284
  strangers: number;
@@ -315,6 +381,20 @@ export class Cerfa2572_2024 {
315
381
  };
316
382
  }
317
383
 
384
+ export class Cerfa2572_2025 {
385
+ siren: string;
386
+ exercice: Exercice;
387
+ society: Society;
388
+ tax: Tax_2023;
389
+ debts: Debts_2025;
390
+ socialContribution: SocialContribution;
391
+ yearlyContribution: YearlyContribution;
392
+ summary: Summary;
393
+ payment: Payment;
394
+ administration?: Administration;
395
+ termination: Termination;
396
+ }
397
+
318
398
  export type Prepare2572Params = {
319
399
  idSociety: number;
320
400
  idExercice: number;
@@ -1,6 +1,7 @@
1
1
  import { CerfaType } from '../../../Enum/CerfaType';
2
2
  import {
3
3
  AnyCerfa2033Century,
4
+ AnyCerfa2572Century,
4
5
  Cerfa2031,
5
6
  Cerfa2031_2024,
6
7
  Cerfa2065,
@@ -8,9 +9,6 @@ import {
8
9
  Cerfa2069RCI_2024,
9
10
  Cerfa2571_2023,
10
11
  Cerfa2571_2024,
11
- Cerfa2572_2022,
12
- Cerfa2572_2023,
13
- Cerfa2572_2024,
14
12
  Cerfa2573_2024,
15
13
  Cerfa3519_2017,
16
14
  FieldForGeneration,
@@ -122,7 +120,7 @@ export type AsponeFormField = { name: string; fields: FieldForGeneration[] };
122
120
 
123
121
  export interface RegistrationPayload {
124
122
  cerfa2573?: Cerfa2573_2024;
125
- cerfa2572?: Cerfa2572_2022 | Cerfa2572_2023 | Cerfa2572_2024;
123
+ cerfa2572?: AnyCerfa2572Century;
126
124
  cerfa2571?: Cerfa2571_2023 | Cerfa2571_2024;
127
125
  cerfa2031?: Cerfa2031 | Cerfa2031_2024;
128
126
  cerfa2033?: AnyCerfa2033Century;
@@ -12,6 +12,11 @@ export class QueryGetSignature {
12
12
  @IsInt()
13
13
  idTypeBrand?: number;
14
14
 
15
+ @ApiPropertyOptional()
16
+ @IsOptional()
17
+ @IsString()
18
+ fromAddress?: string;
19
+
15
20
  @ApiPropertyOptional()
16
21
  @IsOptional()
17
22
  @IsString()
@@ -5,7 +5,7 @@ export interface ReadPdfizer {
5
5
  Bucket: string;
6
6
  }
7
7
 
8
- export type PdfContent = { body: string; header?: string; footer?: string };
8
+ export type PdfContent = { body: string; header?: string; footer?: string; filePath?: string };
9
9
  export type PdfOptions = {
10
10
  margins?: { left?: string; top?: string; right?: string; bottom?: string };
11
11
  folder?: string;
package/ts/utils/email.ts CHANGED
@@ -15,7 +15,6 @@ function getRoleSignature(user: any) {
15
15
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
16
16
  if (user.positionLabel) return user.positionLabel;
17
17
 
18
-
19
18
  const isStagiaireOrAlternant =
20
19
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
21
20
  user.roles.map((r: any) => r.id).includes(Role.INTERN) || user.roles.map((r: any) => r.id).includes(Role.ALTERNATE);
@@ -213,7 +212,6 @@ function getMailSignature(user: any, idTypeBrand: number) {
213
212
  }
214
213
 
215
214
  function getPhoneSignature(user: any) {
216
-
217
215
  if (user.phone !== '0383931414') {
218
216
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
219
217
  return user.phone.replace(/\B(?=(\d{2})+(?!\d))/g, ' ');
@@ -222,8 +220,8 @@ function getPhoneSignature(user: any) {
222
220
  }
223
221
 
224
222
  export function generateSignature(params: any): string {
225
- const { forceRole = null, idTypeBrand = 1, society, ...otherParams } = params;
226
- let { user } = otherParams;
223
+ const { fromAddress = null, idTypeBrand = 1, society, ...otherParams } = params;
224
+ let { user, forceRole = null } = otherParams;
227
225
 
228
226
  const hostS3 = getBrandConfig({
229
227
  idTypeBrand,
@@ -303,6 +301,20 @@ export function generateSignature(params: any): string {
303
301
  objectWaited: 'listPhones.social',
304
302
  }) as unknown as string;
305
303
 
304
+ // Pour les cas hybrides des personnes ayant plusieurs rôles
305
+ // Comme Morgane (Facturation + Satisfaction) et qui peut choisir plusieurs emails d'expédition
306
+ // Il faut que la signature corresponde à l'adresse d'expédition
307
+ // donc actuellement, on ne gère que satisfaction/resiliation/facturation
308
+ const listGenericEmails: { email: string; forceRole: string }[] = [
309
+ { email: satisfactionMail, forceRole: 'satisfaction' },
310
+ { email: resiliationMail, forceRole: 'resiliation' },
311
+ { email: facturationMail, forceRole: 'facturation' },
312
+ ];
313
+ const genericEmailUsed = listGenericEmails.find((e) => e.email === fromAddress);
314
+ if(genericEmailUsed){
315
+ forceRole = genericEmailUsed.forceRole;
316
+ }
317
+
306
318
  let roleSignature: string | null;
307
319
  let mailSignature: string | null;
308
320
  let phoneSignature: string | null;