@silexpert/core 1.3.204 → 1.3.205-2
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/cjs/api/resources/Transaction.d.ts +1 -0
- package/dist/cjs/api/resources/Transaction.d.ts.map +1 -1
- package/dist/cjs/api/resources/Transaction.js +3 -0
- package/dist/cjs/api/resources/Transaction.js.map +1 -1
- package/dist/cjs/api/resources/UsersHistory.d.ts +11 -0
- package/dist/cjs/api/resources/UsersHistory.d.ts.map +1 -0
- package/dist/cjs/api/resources/UsersHistory.js +26 -0
- package/dist/cjs/api/resources/UsersHistory.js.map +1 -0
- package/dist/cjs/api/resources.d.ts +2 -0
- package/dist/cjs/api/resources.d.ts.map +1 -1
- package/dist/cjs/api/resources.js +2 -0
- package/dist/cjs/api/resources.js.map +1 -1
- package/dist/cjs/types/Enum/PrestationType.d.ts +11 -0
- package/dist/cjs/types/Enum/PrestationType.d.ts.map +1 -1
- package/dist/cjs/types/Enum/PrestationType.js +84 -68
- package/dist/cjs/types/Enum/PrestationType.js.map +1 -1
- package/dist/cjs/types/Enum/SocietyApproval.js +6 -6
- package/dist/cjs/types/Enum/SocietyApproval.js.map +1 -1
- package/dist/cjs/types/Enum/UsersHistory.d.ts +16 -0
- package/dist/cjs/types/Enum/UsersHistory.d.ts.map +1 -0
- package/dist/cjs/types/Enum/UsersHistory.js +38 -0
- package/dist/cjs/types/Enum/UsersHistory.js.map +1 -0
- package/dist/cjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.d.ts +13 -0
- package/dist/cjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.js +14 -1
- package/dist/cjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.js.map +1 -1
- package/dist/cjs/types/Interface/api/usersHistory/Create.d.ts +8 -0
- package/dist/cjs/types/Interface/api/usersHistory/Create.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/usersHistory/Create.js +35 -0
- package/dist/cjs/types/Interface/api/usersHistory/Create.js.map +1 -0
- package/dist/cjs/types/Interface/api/usersHistory/Update.d.ts +7 -0
- package/dist/cjs/types/Interface/api/usersHistory/Update.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/usersHistory/Update.js +31 -0
- package/dist/cjs/types/Interface/api/usersHistory/Update.js.map +1 -0
- package/dist/cjs/types/Interface/models/IUsersHistory.d.ts +14 -0
- package/dist/cjs/types/Interface/models/IUsersHistory.d.ts.map +1 -0
- package/dist/cjs/types/Interface/models/IUsersHistory.js +3 -0
- package/dist/cjs/types/Interface/models/IUsersHistory.js.map +1 -0
- package/dist/cjs/types/index.d.ts +4 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +4 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/utils/societyApproval.d.ts.map +1 -1
- package/dist/cjs/utils/societyApproval.js +22 -19
- package/dist/cjs/utils/societyApproval.js.map +1 -1
- package/dist/mjs/api/resources/Transaction.d.ts +1 -0
- package/dist/mjs/api/resources/Transaction.d.ts.map +1 -1
- package/dist/mjs/api/resources/Transaction.js +3 -0
- package/dist/mjs/api/resources/Transaction.js.map +1 -1
- package/dist/mjs/api/resources/UsersHistory.d.ts +11 -0
- package/dist/mjs/api/resources/UsersHistory.d.ts.map +1 -0
- package/dist/mjs/api/resources/UsersHistory.js +28 -0
- package/dist/mjs/api/resources/UsersHistory.js.map +1 -0
- package/dist/mjs/api/resources.d.ts +2 -0
- package/dist/mjs/api/resources.d.ts.map +1 -1
- package/dist/mjs/api/resources.js +2 -0
- package/dist/mjs/api/resources.js.map +1 -1
- package/dist/mjs/types/Enum/PrestationType.d.ts +11 -0
- package/dist/mjs/types/Enum/PrestationType.d.ts.map +1 -1
- package/dist/mjs/types/Enum/PrestationType.js +83 -67
- package/dist/mjs/types/Enum/PrestationType.js.map +1 -1
- package/dist/mjs/types/Enum/SocietyApproval.js +6 -6
- package/dist/mjs/types/Enum/SocietyApproval.js.map +1 -1
- package/dist/mjs/types/Enum/UsersHistory.d.ts +16 -0
- package/dist/mjs/types/Enum/UsersHistory.d.ts.map +1 -0
- package/dist/mjs/types/Enum/UsersHistory.js +35 -0
- package/dist/mjs/types/Enum/UsersHistory.js.map +1 -0
- package/dist/mjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.d.ts +13 -0
- package/dist/mjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.js +16 -2
- package/dist/mjs/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.js.map +1 -1
- package/dist/mjs/types/Interface/api/usersHistory/Create.d.ts +8 -0
- package/dist/mjs/types/Interface/api/usersHistory/Create.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/usersHistory/Create.js +34 -0
- package/dist/mjs/types/Interface/api/usersHistory/Create.js.map +1 -0
- package/dist/mjs/types/Interface/api/usersHistory/Update.d.ts +7 -0
- package/dist/mjs/types/Interface/api/usersHistory/Update.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/usersHistory/Update.js +29 -0
- package/dist/mjs/types/Interface/api/usersHistory/Update.js.map +1 -0
- package/dist/mjs/types/Interface/models/IUsersHistory.d.ts +14 -0
- package/dist/mjs/types/Interface/models/IUsersHistory.d.ts.map +1 -0
- package/dist/mjs/types/Interface/models/IUsersHistory.js +2 -0
- package/dist/mjs/types/Interface/models/IUsersHistory.js.map +1 -0
- package/dist/mjs/types/index.d.ts +4 -0
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +4 -0
- package/dist/mjs/types/index.js.map +1 -1
- package/dist/mjs/utils/societyApproval.d.ts.map +1 -1
- package/dist/mjs/utils/societyApproval.js +6 -3
- package/dist/mjs/utils/societyApproval.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Transaction.ts +3 -0
- package/ts/api/resources/UsersHistory.ts +35 -0
- package/ts/api/resources.ts +2 -0
- package/ts/types/Enum/PrestationType.ts +84 -67
- package/ts/types/Enum/SocietyApproval.ts +6 -6
- package/ts/types/Enum/UsersHistory.ts +38 -0
- package/ts/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.ts +18 -2
- package/ts/types/Interface/api/usersHistory/Create.ts +21 -0
- package/ts/types/Interface/api/usersHistory/Update.ts +17 -0
- package/ts/types/Interface/models/IUsersHistory.ts +17 -0
- package/ts/types/index.ts +5 -0
- package/ts/utils/societyApproval.ts +10 -3
|
@@ -62,8 +62,11 @@ export function getApprovalDocumentInfos(idLegalForm, idDocumentType) {
|
|
|
62
62
|
* @returns L'objet de données formaté pour le template
|
|
63
63
|
*/
|
|
64
64
|
export function buildApprovalTemplateData(existingApproval, style) {
|
|
65
|
-
const yearInText = convertNumberToLetter(+dayjs().format('YYYY')).toLowerCase();
|
|
66
|
-
const dayAndMonthInText = `${convertNumberToLetter(+dayjs().format('D'))} ${dayjs()
|
|
65
|
+
const yearInText = convertNumberToLetter(+dayjs(existingApproval?.generatingDatas?.approvalDate || null).format('YYYY')).toLowerCase();
|
|
66
|
+
const dayAndMonthInText = `${convertNumberToLetter(+dayjs(existingApproval?.generatingDatas?.approvalDate || null).format('D'))} ${dayjs(existingApproval?.generatingDatas?.approvalDate || null)
|
|
67
|
+
.locale('fr')
|
|
68
|
+
.format('MMMM')
|
|
69
|
+
.toLowerCase()}`;
|
|
67
70
|
const brand = getBrand();
|
|
68
71
|
return {
|
|
69
72
|
// Variables globales
|
|
@@ -110,7 +113,7 @@ export function buildApprovalTemplateData(existingApproval, style) {
|
|
|
110
113
|
...existingApproval?.exercice?.society,
|
|
111
114
|
cityOfGreffe: getCityOfGreffeName(existingApproval?.exercice?.society?.idCityOfGreffe).toUpperCase(),
|
|
112
115
|
siren: existingApproval?.exercice?.society?.siret
|
|
113
|
-
? siretToSiren(existingApproval.exercice.society.siret)
|
|
116
|
+
? siretToSiren(existingApproval.exercice.society.siret)?.replace(/(\d{3})(\d{3})(\d{3})/, '$1 $2 $3') ?? null
|
|
114
117
|
: null,
|
|
115
118
|
},
|
|
116
119
|
endDate: dayjs(existingApproval?.exercice?.endDate).locale('fr').format('DD MMMM YYYY').toLowerCase(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"societyApproval.js","sourceRoot":"","sources":["../../../ts/utils/societyApproval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAGL,mCAAmC,GAEpC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAA8B,EAAE,WAAmB,EAAE;IACpF,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,WAAW,CAAC,EAAE,IAAI,IAAI,QAAQ,CAAC;AACxF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAC7C,WAA8B;IAE9B,OAAO,mCAAmC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,KAAK,WAAW,CAAC,CAAC;AAClG,CAAC;AAED;;;;;GAKG;AACH,kDAAkD;AAClD,MAAM,UAAU,+BAA+B,CAC7C,WAA8B,EAC9B,cAA2C;IAE3C,MAAM,MAAM,GAAG,+BAA+B,C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KAAK,CAAC,gBAAgB,EAAE,eAAe,EAAE,YAAY,CAAC;yBACjE,MAAM,CAAC,IAAI,CAAC;yBACZ,MAAM,CAAC,cAAc,CAAC;yBACtB,WAAW,EAAE;iBACjB;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,gBAAgB,EAAE,eAAe,EAAE,4BAA4B;gBACjE,CAAC,CAAC;oBACE,4BAA4B,EAAE,KAAK,CAAC,gBAAgB,EAAE,eAAe,EAAE,4BAA4B,CAAC;yBACjG,MAAM,CAAC,IAAI,CAAC;yBACZ,MAAM,CAAC,cAAc,CAAC;iBAC1B;gBACH,CAAC,CAAC,EAAE,CAAC;SACR;QACD,QAAQ,EAAE;YACR,GAAG,gBAAgB,EAAE,QAAQ;YAC7B,OAAO,EAAE;gBACP,GAAG,gBAAgB,EAAE,QAAQ,EAAE,OAAO;gBACtC,YAAY,EAAE,mBAAmB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,WAAW,EAAE;gBACpG,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK;oBAC/C,CAAC,CAAC,YAAY,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC;oBACvD,CAAC,CAAC,IAAI;aACT;YACD,OAAO,EAAE,KAAK,CAAC,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,WAAW,EAAE;SACtG;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { LegalForm, LegalFormTypeEnum } from '../types/Enum/LegalForm';\nimport {\n SocietyApprovalDocumentType,\n SocietyApprovalDocumentConfig,\n SocietyApprovalDocumentsByLegalForm,\n SocietyApprovalDocumentTemplate,\n} from '../types/Enum/SocietyApproval';\nimport { ISocietyApproval } from '../types/Interface/models/ISocietyApproval';\nimport { QualityList } from '../types/Enum/Quality';\nimport { getBrand } from './brands';\nimport { convertNumberToLetter } from './amount';\nimport * as dayjs from 'dayjs';\nimport { CityOfGreffeDetail } from '../types/Enum/CityOfGreffe';\nimport { siretToSiren } from './siretValidation';\n\n/**\n * Récupère le nom de la forme juridique\n * @param idLegalForm - L'identifiant de la forme juridique\n * @param fallback - Valeur par défaut si non trouvée\n * @returns Le nom de la forme juridique\n */\nexport function getLegalFormName(idLegalForm: LegalFormTypeEnum, fallback: string = ''): string {\n return Object.values(LegalForm).find((lf) => lf.id === idLegalForm)?.name ?? fallback;\n}\n\n/**\n * Récupère la configuration des documents d'approbation pour une forme juridique donnée\n * @param idLegalForm - L'identifiant de la forme juridique\n * @returns La configuration des documents ou undefined si non trouvée\n */\nexport function getApprovalDocumentsByLegalForm(\n idLegalForm: LegalFormTypeEnum,\n): SocietyApprovalDocumentConfig | undefined {\n return SocietyApprovalDocumentsByLegalForm.find((config) => config.idLegalForm === idLegalForm);\n}\n\n/**\n * Récupère le nom du template pour un document spécifique et une forme juridique\n * @param idLegalForm - L'identifiant de la forme juridique\n * @param idDocumentType - Le type de document d'approbation\n * @returns Le nom du template ou undefined si non trouvé\n */\n//@deprecated use getApprovalDocumentInfos instead\nexport function getApprovalDocumentTemplateName(\n idLegalForm: LegalFormTypeEnum,\n idDocumentType: SocietyApprovalDocumentType,\n): string | undefined {\n const config = getApprovalDocumentsByLegalForm(idLegalForm);\n const document = config?.documents.find((doc) => doc.idDocumentType === idDocumentType);\n return document?.templateName;\n}\n\n/**\n * Récupère le texte de la ville du greffe\n * @param idCityOfGreffe - L'identifiant de la ville du greffe\n * @returns Le texte de la ville ou une chaîne vide\n */\nfunction getCityOfGreffeName(idCityOfGreffe: number | null | undefined): string {\n if (!idCityOfGreffe) return '';\n return CityOfGreffeDetail.find((c) => c.id === idCityOfGreffe)?.text ?? '';\n}\n\n/**\n * Récupère le nom du template pour un document spécifique et une forme juridique\n * @param idLegalForm - L'identifiant de la forme juridique\n * @param idDocumentType - Le type de document d'approbation\n * @returns Le nom du template ou undefined si non trouvé\n */\nexport function getApprovalDocumentInfos(\n idLegalForm: LegalFormTypeEnum,\n idDocumentType: SocietyApprovalDocumentType,\n): SocietyApprovalDocumentTemplate | undefined {\n const config = getApprovalDocumentsByLegalForm(idLegalForm);\n return config?.documents.find((doc) => doc.idDocumentType === idDocumentType);\n}\n\n/**\n * Construit les données formatées pour le template d'approbation\n * @param existingApproval - Les données d'approbation de la société\n * @param style - Le style HTML pour le document\n * @returns L'objet de données formaté pour le template\n */\nexport function buildApprovalTemplateData(existingApproval: ISocietyApproval, style: string): Record<string, any> {\n const yearInText = convertNumberToLetter(+dayjs().format('YYYY')).toLowerCase();\n const dayAndMonthInText = `${convertNumberToLetter(+dayjs().format('D'))} ${dayjs().locale('fr').format('MMMM').toLowerCase()}`;\n const brand = getBrand();\n return {\n // Variables globales\n style,\n yearInText,\n dayAndMonthInText,\n date: dayjs().locale('fr').format('DD MMMM YYYY'),\n companyInformation: {\n rcs: brand?.companyInformation?.rcs,\n nomRaisonSociale: brand?.companyInformation?.nomRaisonSociale,\n city: brand?.companyInformation?.city,\n postalAddress: brand?.companyInformation?.postalAddress,\n montantCapital: brand?.companyInformation?.montantCapital,\n statut: brand?.companyInformation?.statut,\n ECOrderCity: brand?.companyInformation?.ECOrderCity,\n },\n owner: {\n identity: `${existingApproval?.exercice?.society?.users?.[0]?.idCivility === 1 ? 'Monsieur' : 'Madame'} ${existingApproval?.exercice?.society?.users?.[0]?.firstname} ${existingApproval?.exercice?.society?.users?.[0]?.lastname} `,\n quality: QualityList.find(\n (ql) => ql.id === existingApproval?.exercice?.society?.users?.[0]?.businessPartners?.[0]?.idQuality,\n )?.label,\n },\n // Variables stockées en base\n ...existingApproval,\n generatingDatas: {\n ...existingApproval?.generatingDatas,\n ...(existingApproval?.generatingDatas?.approvalDate\n ? {\n approvalDate: dayjs(existingApproval?.generatingDatas?.approvalDate)\n .locale('fr')\n .format('DD MMMM YYYY')\n .toUpperCase(),\n }\n : {}),\n ...(existingApproval?.generatingDatas?.approvalDividendsPaymentDate\n ? {\n approvalDividendsPaymentDate: dayjs(existingApproval?.generatingDatas?.approvalDividendsPaymentDate)\n .locale('fr')\n .format('DD MMMM YYYY'),\n }\n : {}),\n },\n exercice: {\n ...existingApproval?.exercice,\n society: {\n ...existingApproval?.exercice?.society,\n cityOfGreffe: getCityOfGreffeName(existingApproval?.exercice?.society?.idCityOfGreffe).toUpperCase(),\n siren: existingApproval?.exercice?.society?.siret\n ? siretToSiren(existingApproval.exercice.society.siret)\n : null,\n },\n endDate: dayjs(existingApproval?.exercice?.endDate).locale('fr').format('DD MMMM YYYY').toLowerCase(),\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"societyApproval.js","sourceRoot":"","sources":["../../../ts/utils/societyApproval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAGL,mCAAmC,GAEpC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAA8B,EAAE,WAAmB,EAAE;IACpF,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,WAAW,CAAC,EAAE,IAAI,IAAI,QAAQ,CAAC;AACxF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAC7C,WAA8B;IAE9B,OAAO,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,CAAC,CAAC,IAAI;aACT;YACD,OAAO,EAAE,KAAK,CAAC,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,WAAW,EAAE;SACtG;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { LegalForm, LegalFormTypeEnum } from '../types/Enum/LegalForm';\nimport {\n SocietyApprovalDocumentType,\n SocietyApprovalDocumentConfig,\n SocietyApprovalDocumentsByLegalForm,\n SocietyApprovalDocumentTemplate,\n} from '../types/Enum/SocietyApproval';\nimport { ISocietyApproval } from '../types/Interface/models/ISocietyApproval';\nimport { QualityList } from '../types/Enum/Quality';\nimport { getBrand } from './brands';\nimport { convertNumberToLetter } from './amount';\nimport * as dayjs from 'dayjs';\nimport { CityOfGreffeDetail } from '../types/Enum/CityOfGreffe';\nimport { siretToSiren } from './siretValidation';\n\n/**\n * Récupère le nom de la forme juridique\n * @param idLegalForm - L'identifiant de la forme juridique\n * @param fallback - Valeur par défaut si non trouvée\n * @returns Le nom de la forme juridique\n */\nexport function getLegalFormName(idLegalForm: LegalFormTypeEnum, fallback: string = ''): string {\n return Object.values(LegalForm).find((lf) => lf.id === idLegalForm)?.name ?? fallback;\n}\n\n/**\n * Récupère la configuration des documents d'approbation pour une forme juridique donnée\n * @param idLegalForm - L'identifiant de la forme juridique\n * @returns La configuration des documents ou undefined si non trouvée\n */\nexport function getApprovalDocumentsByLegalForm(\n idLegalForm: LegalFormTypeEnum,\n): SocietyApprovalDocumentConfig | undefined {\n return SocietyApprovalDocumentsByLegalForm.find((config) => config.idLegalForm === idLegalForm);\n}\n\n/**\n * Récupère le nom du template pour un document spécifique et une forme juridique\n * @param idLegalForm - L'identifiant de la forme juridique\n * @param idDocumentType - Le type de document d'approbation\n * @returns Le nom du template ou undefined si non trouvé\n */\n//@deprecated use getApprovalDocumentInfos instead\nexport function getApprovalDocumentTemplateName(\n idLegalForm: LegalFormTypeEnum,\n idDocumentType: SocietyApprovalDocumentType,\n): string | undefined {\n const config = getApprovalDocumentsByLegalForm(idLegalForm);\n const document = config?.documents.find((doc) => doc.idDocumentType === idDocumentType);\n return document?.templateName;\n}\n\n/**\n * Récupère le texte de la ville du greffe\n * @param idCityOfGreffe - L'identifiant de la ville du greffe\n * @returns Le texte de la ville ou une chaîne vide\n */\nfunction getCityOfGreffeName(idCityOfGreffe: number | null | undefined): string {\n if (!idCityOfGreffe) return '';\n return CityOfGreffeDetail.find((c) => c.id === idCityOfGreffe)?.text ?? '';\n}\n\n/**\n * Récupère le nom du template pour un document spécifique et une forme juridique\n * @param idLegalForm - L'identifiant de la forme juridique\n * @param idDocumentType - Le type de document d'approbation\n * @returns Le nom du template ou undefined si non trouvé\n */\nexport function getApprovalDocumentInfos(\n idLegalForm: LegalFormTypeEnum,\n idDocumentType: SocietyApprovalDocumentType,\n): SocietyApprovalDocumentTemplate | undefined {\n const config = getApprovalDocumentsByLegalForm(idLegalForm);\n return config?.documents.find((doc) => doc.idDocumentType === idDocumentType);\n}\n\n/**\n * Construit les données formatées pour le template d'approbation\n * @param existingApproval - Les données d'approbation de la société\n * @param style - Le style HTML pour le document\n * @returns L'objet de données formaté pour le template\n */\nexport function buildApprovalTemplateData(existingApproval: ISocietyApproval, style: string): Record<string, any> {\n const yearInText = convertNumberToLetter(\n +dayjs(existingApproval?.generatingDatas?.approvalDate || null).format('YYYY'),\n ).toLowerCase();\n const dayAndMonthInText = `${convertNumberToLetter(+dayjs(existingApproval?.generatingDatas?.approvalDate || null).format('D'))} ${dayjs(\n existingApproval?.generatingDatas?.approvalDate || null,\n )\n .locale('fr')\n .format('MMMM')\n .toLowerCase()}`;\n const brand = getBrand();\n return {\n // Variables globales\n style,\n yearInText,\n dayAndMonthInText,\n date: dayjs().locale('fr').format('DD MMMM YYYY'),\n companyInformation: {\n rcs: brand?.companyInformation?.rcs,\n nomRaisonSociale: brand?.companyInformation?.nomRaisonSociale,\n city: brand?.companyInformation?.city,\n postalAddress: brand?.companyInformation?.postalAddress,\n montantCapital: brand?.companyInformation?.montantCapital,\n statut: brand?.companyInformation?.statut,\n ECOrderCity: brand?.companyInformation?.ECOrderCity,\n },\n owner: {\n identity: `${existingApproval?.exercice?.society?.users?.[0]?.idCivility === 1 ? 'Monsieur' : 'Madame'} ${existingApproval?.exercice?.society?.users?.[0]?.firstname} ${existingApproval?.exercice?.society?.users?.[0]?.lastname} `,\n quality: QualityList.find(\n (ql) => ql.id === existingApproval?.exercice?.society?.users?.[0]?.businessPartners?.[0]?.idQuality,\n )?.label,\n },\n // Variables stockées en base\n ...existingApproval,\n generatingDatas: {\n ...existingApproval?.generatingDatas,\n ...(existingApproval?.generatingDatas?.approvalDate\n ? {\n approvalDate: dayjs(existingApproval?.generatingDatas?.approvalDate)\n .locale('fr')\n .format('DD MMMM YYYY')\n .toUpperCase(),\n }\n : {}),\n ...(existingApproval?.generatingDatas?.approvalDividendsPaymentDate\n ? {\n approvalDividendsPaymentDate: dayjs(existingApproval?.generatingDatas?.approvalDividendsPaymentDate)\n .locale('fr')\n .format('DD MMMM YYYY'),\n }\n : {}),\n },\n exercice: {\n ...existingApproval?.exercice,\n society: {\n ...existingApproval?.exercice?.society,\n cityOfGreffe: getCityOfGreffeName(existingApproval?.exercice?.society?.idCityOfGreffe).toUpperCase(),\n siren: existingApproval?.exercice?.society?.siret\n ? siretToSiren(existingApproval.exercice.society.siret)?.replace(/(\\d{3})(\\d{3})(\\d{3})/, '$1 $2 $3') ?? null\n : null,\n },\n endDate: dayjs(existingApproval?.exercice?.endDate).locale('fr').format('DD MMMM YYYY').toLowerCase(),\n },\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.205-2",
|
|
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
|
"main": "dist/cjs/index.js",
|
|
@@ -77,6 +77,9 @@ export class Transaction extends Resource {
|
|
|
77
77
|
annotate(id: number, data: UpdateAccountingTransaction): Promise<ReadFormattedAccountingTransaction> {
|
|
78
78
|
return this.axios.$put(`/transactions/${id}`, data);
|
|
79
79
|
}
|
|
80
|
+
annotateAll(ids: number[], data: UpdateAccountingTransaction): Promise<ReadFormattedAccountingTransaction> {
|
|
81
|
+
return this.axios.$put('/transactions/annotate-all', { ids, data });
|
|
82
|
+
}
|
|
80
83
|
delete(idSociety: number, id: number): Promise<number> {
|
|
81
84
|
return this.axios.$delete(`/society/${idSociety}/transaction/${id}`);
|
|
82
85
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Resource } from '../Resource';
|
|
2
|
+
import { IUsersHistory, CreateUsersHistory, UpdateUsersHistory } from '../../types';
|
|
3
|
+
|
|
4
|
+
export class UsersHistory extends Resource {
|
|
5
|
+
createUserHistory(body: CreateUsersHistory): Promise<IUsersHistory> {
|
|
6
|
+
return this.axios.$post('usersHistory', body);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
getAllUserHistory(signal?: AbortSignal): Promise<IUsersHistory[]> {
|
|
10
|
+
return this.axios.$get('usersHistory', {
|
|
11
|
+
...signal && { signal }
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
getUserHistoryById(id: number, signal?: AbortSignal): Promise<IUsersHistory> {
|
|
16
|
+
return this.axios.$get(`usersHistory/${id}`, {
|
|
17
|
+
...signal && { signal }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
getUserHistoryByUserID(idUser: number, signal?: AbortSignal): Promise<IUsersHistory[]> {
|
|
22
|
+
return this.axios.$get(`usersHistory/user/${idUser}`, {
|
|
23
|
+
...signal && { signal }
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
updateUserHistory(id: number, body: UpdateUsersHistory): Promise<IUsersHistory> {
|
|
28
|
+
return this.axios.$put(`usersHistory/${id}`, body);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
deleteUserHistory(id: number): Promise<boolean> {
|
|
32
|
+
return this.axios.$delete(`usersHistory/${id}`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
package/ts/api/resources.ts
CHANGED
|
@@ -190,6 +190,7 @@ import { InformationRequest } from './resources/InformationRequest';
|
|
|
190
190
|
import { AutomaticRegistration } from './resources/AutomaticRegistration';
|
|
191
191
|
import { LoginApproval } from './resources/LoginApproval';
|
|
192
192
|
import { SocietyApproval } from './resources/SocietyApproval';
|
|
193
|
+
import { UsersHistory } from './resources/UsersHistory';
|
|
193
194
|
import { Docoon } from './resources/Docoon';
|
|
194
195
|
|
|
195
196
|
export const resources = {
|
|
@@ -385,5 +386,6 @@ export const resources = {
|
|
|
385
386
|
automaticRegistration: AutomaticRegistration,
|
|
386
387
|
loginApproval: LoginApproval,
|
|
387
388
|
societyApproval: SocietyApproval,
|
|
389
|
+
usersHistory: UsersHistory,
|
|
388
390
|
docoon: Docoon,
|
|
389
391
|
};
|