@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.
- package/dist/{index-CfisHC_H.d.mts → index-BvApezAZ.d.mts} +37 -4
- package/dist/index-BvApezAZ.d.mts.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +80 -13
- package/dist/index.mjs.map +1 -1
- package/dist/product-BCFrBxXc.mjs +2 -0
- package/dist/product-BCFrBxXc.mjs.map +1 -0
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.d.mts.map +1 -1
- package/dist/server/index.mjs +3 -3
- package/dist/server/index.mjs.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Authenticate.ts +6 -0
- package/ts/api/resources/Follow.ts +9 -0
- package/ts/types/Enum/AIPrompt.ts +74 -7
- package/ts/types/Enum/EInvoicingReasonType.ts +3 -2
- package/ts/types/Enum/Kyc.ts +2 -0
- package/ts/types/Enum/PrestationType.ts +1 -1
- package/ts/types/Form/FormConnector.ts +2 -0
- package/ts/types/Interface/api/SocietyApproval.ts +2 -0
- package/ts/types/Interface/api/acceptance/CreateAcceptance.ts +2 -0
- package/ts/types/Interface/api/accountingTransaction/QueryTransaction.ts +2 -0
- package/ts/types/Interface/api/acd/ExportRefreshFailures.ts +15 -0
- package/ts/types/Interface/api/adjustment/Create.ts +2 -0
- package/ts/types/Interface/api/appointment/Appointment.ts +2 -0
- package/ts/types/Interface/api/authentification/ExchangeExternalAuthenticationLink.ts +9 -5
- package/ts/types/Interface/api/balanceSheet/UpdateBalanceSheet.ts +2 -0
- package/ts/types/Interface/api/bankAccount/Create.ts +2 -0
- package/ts/types/Interface/api/bankAccount/Query.ts +3 -0
- package/ts/types/Interface/api/calendarEvent/createCalendarEventForUsers.ts +2 -0
- package/ts/types/Interface/api/card/UpdateCard.ts +4 -0
- package/ts/types/Interface/api/cashAndExpense/Create.ts +3 -0
- package/ts/types/Interface/api/checklist/Query.ts +2 -0
- package/ts/types/Interface/api/checklist/Update.ts +3 -0
- package/ts/types/Interface/api/collaboraterDetail/CreateCollaboraterDetail.ts +4 -0
- package/ts/types/Interface/api/commercialManagement/Create.ts +5 -0
- package/ts/types/Interface/api/commercialManagement/Query.ts +4 -0
- package/ts/types/Interface/api/companyCreationForm/CreateCompanyCreationForm.ts +14 -0
- package/ts/types/Interface/api/connector/CreateConnector.ts +2 -0
- package/ts/types/Interface/api/connector/QueryConnector.ts +2 -0
- package/ts/types/Interface/api/customerProviderOperation/CreateCustomerProviderOperation.ts +2 -0
- package/ts/types/Interface/api/dashboard/QueryTopProviders.ts +2 -0
- package/ts/types/Interface/api/docoon/Create.ts +5 -1
- package/ts/types/Interface/api/documentRequest/Create.ts +2 -0
- package/ts/types/Interface/api/documentRequest/Query.ts +3 -0
- package/ts/types/Interface/api/documentRequest/Update.ts +2 -0
- package/ts/types/Interface/api/exercice/Create.ts +2 -0
- package/ts/types/Interface/api/exercice/UpdateExercice.ts +2 -0
- package/ts/types/Interface/api/generalLedger/QueryGeneralLedgerAuxiliary.ts +2 -0
- package/ts/types/Interface/api/humanResourceLibrary/CreateHumanResourceLibrary.ts +2 -0
- package/ts/types/Interface/api/humanResourceLibrary/QueryPaginatedHumanResourceLibrary.ts +2 -0
- package/ts/types/Interface/api/immobilization/CreateImmobilization.ts +2 -0
- package/ts/types/Interface/api/informationRequest/Create.ts +2 -0
- package/ts/types/Interface/api/informationRequest/Update.ts +3 -0
- package/ts/types/Interface/api/library/QueryLibrary.ts +4 -0
- package/ts/types/Interface/api/notification/CreateNotification.ts +2 -0
- package/ts/types/Interface/api/notificationSetting/CreateNotificationSetting.ts +2 -0
- package/ts/types/Interface/api/notificationSetting/UpdateNotificationSetting.ts +2 -0
- package/ts/types/Interface/api/partner/CreatePartner.ts +2 -0
- package/ts/types/Interface/api/partner/UpdatePartner.ts +2 -0
- package/ts/types/Interface/api/paymentExpectation/CreatePaymentExpecation.ts +2 -0
- package/ts/types/Interface/api/previsionalForm/CreatePrevisionalForm.ts +4 -0
- package/ts/types/Interface/api/registration/CreateRegistration.ts +3 -0
- package/ts/types/Interface/api/registration/DeclareRegistration.ts +2 -0
- package/ts/types/Interface/api/registration/QueryRegistration.ts +2 -0
- package/ts/types/Interface/api/regulation/Create.ts +2 -0
- package/ts/types/Interface/api/revenue/revenueMovement.ts +3 -0
- package/ts/types/Interface/api/revisionGuide/CreateRevisionGuide.ts +3 -0
- package/ts/types/Interface/api/society/CreateTestSociety.ts +9 -0
- package/ts/types/Interface/api/societyConfigBalanceSheet/QueryGetAllSocietyConfigBalanceSheet.ts +2 -0
- package/ts/types/Interface/api/statutsGeneration/CreateBusinessPartnersAndUsersParams.ts +2 -0
- package/ts/types/Interface/api/survey/QuerySurveys.ts +2 -0
- package/ts/types/Interface/api/tax/CreateTax.ts +4 -0
- package/ts/types/Interface/api/taxDeadline/QueryTaxDeadline.ts +3 -0
- package/ts/types/Interface/api/textMessage/Create.ts +2 -0
- package/ts/types/Interface/api/thirdParty/CreateThirdPartyForm.ts +3 -0
- package/ts/types/Interface/api/thirdParty/UpdateThirdPartyForm.ts +2 -0
- package/ts/types/Interface/api/timeTracking/Create.ts +2 -0
- package/ts/types/Interface/api/user/Query.ts +2 -0
- package/ts/types/Interface/api/user/RegisterProspect.ts +7 -0
- package/ts/types/Interface/api/user/UpdateCoworker.ts +2 -0
- package/ts/types/Interface/api/usersHistory/Create.ts +2 -0
- package/ts/types/Interface/api/usersHistory/Update.ts +2 -0
- package/ts/types/Interface/api/vatDeclaration/QueryVatDeclaration.ts +3 -0
- package/ts/types/Interface/api/visualizedInformation/Query.ts +2 -0
- package/ts/types/Interface/api/visualizedInformation/Update.ts +2 -0
- package/ts/types/Interface/models/ISociety.ts +4 -0
- package/ts/types/index.ts +1 -0
- package/ts/utils/amount.ts +82 -55
- package/ts/utils/commercialManagement/document.ts +1 -0
- package/ts/utils/index.ts +1 -0
- package/ts/utils/societyApproval.ts +2 -2
- package/ts/utils/tests/document.spec.ts +41 -0
- package/ts/utils/transforms/numericEnum.transform.ts +9 -0
- package/dist/index-CfisHC_H.d.mts.map +0 -1
- package/dist/product-CG6avfN0.mjs +0 -2
- 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 };
|