@silexpert/core 2.0.119-tsdown.0 → 2.0.120

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 (97) hide show
  1. package/dist/{index-CfisHC_H.d.mts → index-BvApezAZ.d.mts} +37 -4
  2. package/dist/index-BvApezAZ.d.mts.map +1 -0
  3. package/dist/index.d.mts +2 -2
  4. package/dist/index.mjs +80 -13
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/product-BCFrBxXc.mjs +2 -0
  7. package/dist/product-BCFrBxXc.mjs.map +1 -0
  8. package/dist/server/index.d.mts +1 -1
  9. package/dist/server/index.d.mts.map +1 -1
  10. package/dist/server/index.mjs +3 -3
  11. package/dist/server/index.mjs.map +1 -1
  12. package/package.json +1 -1
  13. package/ts/api/resources/Authenticate.ts +6 -0
  14. package/ts/api/resources/Follow.ts +9 -0
  15. package/ts/types/Enum/AIPrompt.ts +74 -7
  16. package/ts/types/Enum/EInvoicingReasonType.ts +3 -2
  17. package/ts/types/Enum/Kyc.ts +2 -0
  18. package/ts/types/Enum/PrestationType.ts +1 -1
  19. package/ts/types/Form/FormConnector.ts +2 -0
  20. package/ts/types/Interface/api/SocietyApproval.ts +2 -0
  21. package/ts/types/Interface/api/acceptance/CreateAcceptance.ts +2 -0
  22. package/ts/types/Interface/api/accountingTransaction/QueryTransaction.ts +2 -0
  23. package/ts/types/Interface/api/acd/ExportRefreshFailures.ts +15 -0
  24. package/ts/types/Interface/api/adjustment/Create.ts +2 -0
  25. package/ts/types/Interface/api/appointment/Appointment.ts +2 -0
  26. package/ts/types/Interface/api/authentification/ExchangeExternalAuthenticationLink.ts +9 -5
  27. package/ts/types/Interface/api/balanceSheet/UpdateBalanceSheet.ts +2 -0
  28. package/ts/types/Interface/api/bankAccount/Create.ts +2 -0
  29. package/ts/types/Interface/api/bankAccount/Query.ts +3 -0
  30. package/ts/types/Interface/api/calendarEvent/createCalendarEventForUsers.ts +2 -0
  31. package/ts/types/Interface/api/card/UpdateCard.ts +4 -0
  32. package/ts/types/Interface/api/cashAndExpense/Create.ts +3 -0
  33. package/ts/types/Interface/api/checklist/Query.ts +2 -0
  34. package/ts/types/Interface/api/checklist/Update.ts +3 -0
  35. package/ts/types/Interface/api/collaboraterDetail/CreateCollaboraterDetail.ts +4 -0
  36. package/ts/types/Interface/api/commercialManagement/Create.ts +5 -0
  37. package/ts/types/Interface/api/commercialManagement/Query.ts +4 -0
  38. package/ts/types/Interface/api/companyCreationForm/CreateCompanyCreationForm.ts +14 -0
  39. package/ts/types/Interface/api/connector/CreateConnector.ts +2 -0
  40. package/ts/types/Interface/api/connector/QueryConnector.ts +2 -0
  41. package/ts/types/Interface/api/customerProviderOperation/CreateCustomerProviderOperation.ts +2 -0
  42. package/ts/types/Interface/api/dashboard/QueryTopProviders.ts +2 -0
  43. package/ts/types/Interface/api/docoon/Create.ts +5 -1
  44. package/ts/types/Interface/api/documentRequest/Create.ts +2 -0
  45. package/ts/types/Interface/api/documentRequest/Query.ts +3 -0
  46. package/ts/types/Interface/api/documentRequest/Update.ts +2 -0
  47. package/ts/types/Interface/api/exercice/Create.ts +2 -0
  48. package/ts/types/Interface/api/exercice/UpdateExercice.ts +2 -0
  49. package/ts/types/Interface/api/generalLedger/QueryGeneralLedgerAuxiliary.ts +2 -0
  50. package/ts/types/Interface/api/humanResourceLibrary/CreateHumanResourceLibrary.ts +2 -0
  51. package/ts/types/Interface/api/humanResourceLibrary/QueryPaginatedHumanResourceLibrary.ts +2 -0
  52. package/ts/types/Interface/api/immobilization/CreateImmobilization.ts +2 -0
  53. package/ts/types/Interface/api/informationRequest/Create.ts +2 -0
  54. package/ts/types/Interface/api/informationRequest/Update.ts +3 -0
  55. package/ts/types/Interface/api/library/QueryLibrary.ts +4 -0
  56. package/ts/types/Interface/api/notification/CreateNotification.ts +2 -0
  57. package/ts/types/Interface/api/notificationSetting/CreateNotificationSetting.ts +2 -0
  58. package/ts/types/Interface/api/notificationSetting/UpdateNotificationSetting.ts +2 -0
  59. package/ts/types/Interface/api/partner/CreatePartner.ts +2 -0
  60. package/ts/types/Interface/api/partner/UpdatePartner.ts +2 -0
  61. package/ts/types/Interface/api/paymentExpectation/CreatePaymentExpecation.ts +2 -0
  62. package/ts/types/Interface/api/previsionalForm/CreatePrevisionalForm.ts +4 -0
  63. package/ts/types/Interface/api/registration/CreateRegistration.ts +3 -0
  64. package/ts/types/Interface/api/registration/DeclareRegistration.ts +2 -0
  65. package/ts/types/Interface/api/registration/QueryRegistration.ts +2 -0
  66. package/ts/types/Interface/api/regulation/Create.ts +2 -0
  67. package/ts/types/Interface/api/revenue/revenueMovement.ts +3 -0
  68. package/ts/types/Interface/api/revisionGuide/CreateRevisionGuide.ts +3 -0
  69. package/ts/types/Interface/api/society/CreateTestSociety.ts +9 -0
  70. package/ts/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.ts +2 -0
  71. package/ts/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.ts +2 -0
  72. package/ts/types/Interface/api/survey/QuerySurveys.ts +2 -0
  73. package/ts/types/Interface/api/tax/CreateTax.ts +4 -0
  74. package/ts/types/Interface/api/taxDeadline/QueryTaxDeadline.ts +3 -0
  75. package/ts/types/Interface/api/textMessage/Create.ts +2 -0
  76. package/ts/types/Interface/api/thirdParty/CreateThirdPartyForm.ts +3 -0
  77. package/ts/types/Interface/api/thirdParty/UpdateThirdPartyForm.ts +2 -0
  78. package/ts/types/Interface/api/timeTracking/Create.ts +2 -0
  79. package/ts/types/Interface/api/user/Query.ts +2 -0
  80. package/ts/types/Interface/api/user/RegisterProspect.ts +7 -0
  81. package/ts/types/Interface/api/user/UpdateCoworker.ts +2 -0
  82. package/ts/types/Interface/api/usersHistory/Create.ts +2 -0
  83. package/ts/types/Interface/api/usersHistory/Update.ts +2 -0
  84. package/ts/types/Interface/api/vatDeclaration/QueryVatDeclaration.ts +3 -0
  85. package/ts/types/Interface/api/visualizedInformation/Query.ts +2 -0
  86. package/ts/types/Interface/api/visualizedInformation/Update.ts +2 -0
  87. package/ts/types/Interface/models/ISociety.ts +4 -0
  88. package/ts/types/index.ts +1 -0
  89. package/ts/utils/amount.ts +82 -55
  90. package/ts/utils/commercialManagement/document.ts +1 -0
  91. package/ts/utils/index.ts +1 -0
  92. package/ts/utils/societyApproval.ts +2 -2
  93. package/ts/utils/tests/document.spec.ts +41 -0
  94. package/ts/utils/transforms/numericEnum.transform.ts +9 -0
  95. package/dist/index-CfisHC_H.d.mts.map +0 -1
  96. package/dist/product-CG6avfN0.mjs +0 -2
  97. package/dist/product-CG6avfN0.mjs.map +0 -1
@@ -63,6 +63,47 @@ const payloadWithoutSellerAddress = {
63
63
  } as unknown as CreateInvoiceDocument;
64
64
 
65
65
  describe('generateCommercialDocument', () => {
66
+ test('should not throw when cgv is omitted and invoiceCgv is enabled', () => {
67
+ const payload: CreateInvoiceDocument = {
68
+ ...payloadWithoutSellerAddress,
69
+ settings: { invoiceCgv: true },
70
+ };
71
+ Reflect.deleteProperty(payload, 'cgv');
72
+
73
+ expect(() => generateCommercialDocument(EstimateInvoiceType.FACTURE, payload)).not.toThrow();
74
+ expect(generateCommercialDocument(EstimateInvoiceType.FACTURE, payload).data.cgv).toBeNull();
75
+ });
76
+
77
+ test.each([undefined, null])(
78
+ 'should not throw when cgv is explicitly %s and invoiceCgv is enabled',
79
+ (cgv: string | null | undefined): void => {
80
+ const payload = {
81
+ ...payloadWithoutSellerAddress,
82
+ cgv,
83
+ settings: { invoiceCgv: true },
84
+ } as CreateInvoiceDocument;
85
+
86
+ expect(() => generateCommercialDocument(EstimateInvoiceType.FACTURE, payload)).not.toThrow();
87
+ expect(generateCommercialDocument(EstimateInvoiceType.FACTURE, payload).data.cgv).toBeNull();
88
+ },
89
+ );
90
+
91
+ test.each([true, false])(
92
+ 'should render CGV HTML only when invoiceCgv is enabled (%s)',
93
+ (invoiceCgv: boolean): void => {
94
+ const cgv = '<p>Conditions de vente <strong>applicables</strong></p>';
95
+ const payload: CreateInvoiceDocument = {
96
+ ...payloadWithoutSellerAddress,
97
+ cgv,
98
+ settings: { invoiceCgv },
99
+ };
100
+
101
+ const result = generateCommercialDocument(EstimateInvoiceType.FACTURE, payload);
102
+
103
+ expect(result.body.includes(cgv)).toBe(invoiceCgv);
104
+ },
105
+ );
106
+
66
107
  test('should not throw when seller address fields are missing from the payload', () => {
67
108
  expect(() => generateCommercialDocument(EstimateInvoiceType.FACTURE, payloadWithoutSellerAddress)).not.toThrow();
68
109
  });
@@ -0,0 +1,9 @@
1
+ import { Transform } from 'class-transformer';
2
+
3
+ // Mirrors `enableImplicitConversion` for numeric enums: isolated transpilers (oxc) emit the enum object instead of `Number` as `design:type`.
4
+ const ToNumericEnum = () =>
5
+ Transform(({ value }: { value: unknown }) => (typeof value === 'string' ? Number(value) : value), {
6
+ toClassOnly: true,
7
+ });
8
+
9
+ export { ToNumericEnum };