@silexpert/core 2.0.3 → 2.0.5

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 (46) hide show
  1. package/dist/api/resources/CustomerActivity.d.ts +1 -1
  2. package/dist/api/resources/CustomerActivity.d.ts.map +1 -1
  3. package/dist/api/resources/CustomerActivity.js.map +1 -1
  4. package/dist/types/Enum/AIPrompt.js +1 -1
  5. package/dist/types/Enum/AIPrompt.js.map +1 -1
  6. package/dist/types/Interface/api/oldExportInfo/OldExpertInfos.d.ts +2 -2
  7. package/dist/types/Interface/api/oldExportInfo/OldExpertInfos.d.ts.map +1 -1
  8. package/dist/types/Interface/api/oldExportInfo/OldExpertInfos.js +3 -3
  9. package/dist/types/Interface/api/oldExportInfo/OldExpertInfos.js.map +1 -1
  10. package/dist/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.d.ts +2 -0
  11. package/dist/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.d.ts.map +1 -1
  12. package/dist/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.js +14 -0
  13. package/dist/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.js.map +1 -1
  14. package/dist/types/Interface/api/statutsGeneration/CreatePrestationPayload.d.ts +6 -0
  15. package/dist/types/Interface/api/statutsGeneration/CreatePrestationPayload.d.ts.map +1 -0
  16. package/dist/types/Interface/api/statutsGeneration/CreatePrestationPayload.js +2 -0
  17. package/dist/types/Interface/api/statutsGeneration/CreatePrestationPayload.js.map +1 -0
  18. package/dist/types/Interface/api/statutsGeneration/UpsertBusinessPartnerResult.d.ts +8 -0
  19. package/dist/types/Interface/api/statutsGeneration/UpsertBusinessPartnerResult.d.ts.map +1 -0
  20. package/dist/types/Interface/api/statutsGeneration/UpsertBusinessPartnerResult.js +2 -0
  21. package/dist/types/Interface/api/statutsGeneration/UpsertBusinessPartnerResult.js.map +1 -0
  22. package/dist/types/index.d.ts +2 -0
  23. package/dist/types/index.d.ts.map +1 -1
  24. package/dist/types/index.js +2 -0
  25. package/dist/types/index.js.map +1 -1
  26. package/dist/utils/email/templates/signature.d.ts +1 -1
  27. package/dist/utils/email/templates/signature.js +1 -1
  28. package/dist/utils/email/templates/signature.js.map +1 -1
  29. package/dist/utils/email.d.ts +1 -1
  30. package/dist/utils/email.d.ts.map +1 -1
  31. package/dist/utils/email.js +4 -1
  32. package/dist/utils/email.js.map +1 -1
  33. package/dist/utils/vat/3517/century26.d.ts.map +1 -1
  34. package/dist/utils/vat/3517/century26.js +9 -7
  35. package/dist/utils/vat/3517/century26.js.map +1 -1
  36. package/package.json +1 -1
  37. package/ts/api/resources/CustomerActivity.ts +1 -1
  38. package/ts/types/Enum/AIPrompt.ts +1 -1
  39. package/ts/types/Interface/api/oldExportInfo/OldExpertInfos.ts +5 -5
  40. package/ts/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.ts +10 -0
  41. package/ts/types/Interface/api/statutsGeneration/CreatePrestationPayload.ts +6 -0
  42. package/ts/types/Interface/api/statutsGeneration/UpsertBusinessPartnerResult.ts +7 -0
  43. package/ts/types/index.ts +2 -0
  44. package/ts/utils/email/templates/signature.ts +1 -1
  45. package/ts/utils/email.ts +6 -1
  46. package/ts/utils/vat/3517/century26.ts +10 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "Silex Core perform HTTP Request and object binding. Silex core helps developers to retrieve and return formatted object",
5
5
  "homepage": "https://gitlab.compta-clementine.fr/dev/silex-api",
6
6
  "type": "module",
@@ -24,7 +24,7 @@ export class CustomerActivity extends Resource {
24
24
  return this.axios.$post('/customers-acceptances', params);
25
25
  }
26
26
 
27
- annualReporting(idSociety: number, idExercice: number): Promise<void> {
27
+ annualReporting(idSociety: number, idExercice: number): Promise<Buffer> {
28
28
  return this.axios.$get(`/customer-activities/societies/${idSociety}/exercices/${idExercice}/annual-report`, {
29
29
  responseType: 'arraybuffer',
30
30
  });
@@ -19,7 +19,7 @@ export const AIPrompt: Record<AIPromptKey, AIPromptInfo> = {
19
19
  Analysez ce relevé de compte bancaire et extrayez toutes les transactions sous forme d'un objet JSON structuré.
20
20
  Le relevé peut contenir des informations telles que la date de la transaction, le libellé, le montant débité et le montant crédité (ou alors un montant en positif pour le crédit et un montant en négatif pour le débit).
21
21
  Garder exactement le même ordre de transaction que dans le relevé.
22
- Le format attendu est le suivant :
22
+ Le format attendu est le suivant (sans mettre de clé "transactions" devant) :
23
23
  [
24
24
  {
25
25
  "dateValue": string (format : YYYY-MM-DD correspondant à la date de la transaction),
@@ -1,4 +1,4 @@
1
- import { IsBoolean, IsDate, IsInt, IsOptional, IsString } from 'class-validator';
1
+ import { IsBoolean, IsDateString, IsInt, IsOptional, IsString } from 'class-validator';
2
2
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
3
3
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform.js';
4
4
 
@@ -40,8 +40,8 @@ export class CreateOldExpertInfo {
40
40
 
41
41
  @ApiPropertyOptional()
42
42
  @IsOptional()
43
- @IsDate()
44
- recoveryDate: Date | null;
43
+ @IsDateString()
44
+ recoveryDate: string | null;
45
45
 
46
46
  @ApiPropertyOptional()
47
47
  @IsOptional()
@@ -50,8 +50,8 @@ export class CreateOldExpertInfo {
50
50
 
51
51
  @ApiPropertyOptional()
52
52
  @IsOptional()
53
- @IsDate()
54
- dateSendReprise: Date | null;
53
+ @IsDateString()
54
+ dateSendReprise: string | null;
55
55
 
56
56
  @ApiProperty()
57
57
  @IsBoolean()
@@ -81,6 +81,16 @@ export class CreateBusinessPartnersAndUsersParams {
81
81
  @ToBoolean()
82
82
  isPhysical?: boolean;
83
83
 
84
+ @ApiPropertyOptional()
85
+ @IsOptional()
86
+ @IsInt()
87
+ idBusinessPartner?: number;
88
+
89
+ @ApiPropertyOptional()
90
+ @IsOptional()
91
+ @IsInt()
92
+ idDirectorBusinessPartner?: number;
93
+
84
94
  @ApiPropertyOptional()
85
95
  @IsOptional()
86
96
  @IsString()
@@ -0,0 +1,6 @@
1
+ import { IPrestation } from '../../models/IPrestation.js';
2
+
3
+ export interface CreatePrestationPayload extends IPrestation {
4
+ idExercice: number;
5
+ amount?: number;
6
+ }
@@ -0,0 +1,7 @@
1
+ export interface UpsertBusinessPartnerResult {
2
+ index: number;
3
+ idBusinessPartner: number;
4
+ action: 'created' | 'updated';
5
+ idDirectorBusinessPartner?: number;
6
+ isPhysical: boolean;
7
+ }
package/ts/types/index.ts CHANGED
@@ -731,6 +731,8 @@ export * from './Interface/api/statutsGeneration/QueryGetUser.js';
731
731
  export * from './Interface/api/statutsGeneration/IntentToPayPrestationParams.js';
732
732
  export * from './Interface/api/statutsGeneration/SendInviteMailParams.js';
733
733
  export * from './Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.js';
734
+ export * from './Interface/api/statutsGeneration/CreatePrestationPayload.js';
735
+ export * from './Interface/api/statutsGeneration/UpsertBusinessPartnerResult.js';
734
736
  export * from './Interface/api/accountingIncome/ReadAccountingIncome.js';
735
737
  export * from './Interface/api/ocr/OcrTransactions.js';
736
738
  export * from './Interface/api/bankStatement/QueryBankStatement.js';
@@ -175,7 +175,7 @@ class="signatureClementine">
175
175
  <% if(phoneSignature && phoneSignature !== standardPhoneSignature) { %>
176
176
  Ligne directe : <%- phoneSignature %><br/>
177
177
  <% } %>
178
- Nos horaires : <%= horaires %>
178
+ Nos horaires : <%- horaires %>
179
179
 
180
180
  <% if(['Pourcentage ECE - AMEX', 'Pourcentage ECF'].includes(brandName)) { %>
181
181
  <br/>Adresse : 35, avenue Jean Médecin - 06000 NICE
package/ts/utils/email.ts CHANGED
@@ -5,6 +5,7 @@ import { IUser } from '../types/Interface/models/IUser.js';
5
5
  import { getBrand, getBrandConfig } from './brands.js';
6
6
  import { signatureTemplate } from './email/templates/signature.js';
7
7
  import { intersection } from './noLodash.js';
8
+ import { IRole } from '../types/Interface/models/IRole.js';
8
9
 
9
10
  function getRoleSignature(user: any) {
10
11
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
@@ -140,7 +141,11 @@ export function getHoraires(user: IUser) {
140
141
  // return 'Du lundi au vendredi de 9h à 18h';
141
142
  // }
142
143
 
143
- return 'Du lundi au vendredi de 9h à 18h';
144
+ if (user?.roles?.map((r: IRole) => r.id).includes(Role.COMMERCIAL)) {
145
+ return 'Du lundi au vendredi de 9h à 18h';
146
+ }
147
+
148
+ return 'Du lundi au jeudi de 9h à 17h<br/>Le vendredi de 9h à 12h';
144
149
 
145
150
  // if (!intersection([user.roles.map((r: any) => r.id), [Role.FRONT_OFFICE, Role.FRONT_OFFICE_EXPRESS, Role.COMMERCIAL]]).length) return 'Du lundi au vendredi de 9h à 18h';
146
151
 
@@ -633,13 +633,6 @@ export function getCerfa3517Century26RegistrationField(data: Cerfa3517_2026): As
633
633
  description: "Total de la taxe annuelle à l'essieu due (1a + 1b + 2a + 2b + 3) 910778 70A",
634
634
  value: data.tax.onYearly,
635
635
  },
636
- {
637
- key: 'BD',
638
- isMultiple: false,
639
- tag: 'Valeur',
640
- description: 'Taxe annuelle sur les émissions de polluants atmosphériques des véhicules de tourisme',
641
- value: data.tax.oldVehicle,
642
- },
643
636
  {
644
637
  key: 'BG',
645
638
  isMultiple: false,
@@ -1711,6 +1704,16 @@ export function getCerfa3517Century26RegistrationField(data: Cerfa3517_2026): As
1711
1704
  });
1712
1705
  }
1713
1706
 
1707
+ if (data.tax.oldVehicle && data.tax.oldVehicle > 0) {
1708
+ fields.push({
1709
+ key: 'BD',
1710
+ isMultiple: false,
1711
+ tag: 'Valeur',
1712
+ description: 'Taxe annuelle sur les émissions de polluants atmosphériques des véhicules de tourisme',
1713
+ value: data.tax.oldVehicle,
1714
+ });
1715
+ }
1716
+
1714
1717
  return [
1715
1718
  {
1716
1719
  name: '3517SCA12',