@silexpert/core 1.2.26 → 1.2.27
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/RegistrationForm.d.ts +3 -2
- package/dist/cjs/api/resources/RegistrationForm.d.ts.map +1 -1
- package/dist/cjs/api/resources/RegistrationForm.js +4 -1
- package/dist/cjs/api/resources/RegistrationForm.js.map +1 -1
- package/dist/cjs/types/Enum/Aspone.d.ts +57 -0
- package/dist/cjs/types/Enum/Aspone.d.ts.map +1 -1
- package/dist/cjs/types/Enum/Aspone.js +94 -1
- package/dist/cjs/types/Enum/Aspone.js.map +1 -1
- package/dist/cjs/types/Enum/CerfaType.d.ts +2 -1
- package/dist/cjs/types/Enum/CerfaType.d.ts.map +1 -1
- package/dist/cjs/types/Enum/CerfaType.js +1 -0
- package/dist/cjs/types/Enum/CerfaType.js.map +1 -1
- package/dist/cjs/types/Enum/CommercialManagement.d.ts +28 -0
- package/dist/cjs/types/Enum/CommercialManagement.d.ts.map +1 -1
- package/dist/cjs/types/Enum/CommercialManagement.js +137 -1
- package/dist/cjs/types/Enum/CommercialManagement.js.map +1 -1
- package/dist/cjs/types/Interface/api/cerfa/2573.d.ts +91 -0
- package/dist/cjs/types/Interface/api/cerfa/2573.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/cerfa/2573.js +3 -0
- package/dist/cjs/types/Interface/api/cerfa/2573.js.map +1 -0
- package/dist/cjs/types/Interface/api/cerfa/CreateCerfa.d.ts +1 -0
- package/dist/cjs/types/Interface/api/cerfa/CreateCerfa.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/cerfa/CreateCerfa.js +1 -0
- package/dist/cjs/types/Interface/api/cerfa/CreateCerfa.js.map +1 -1
- package/dist/cjs/types/Interface/api/cerfa/ReadCerfa.d.ts +2 -1
- package/dist/cjs/types/Interface/api/cerfa/ReadCerfa.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/cerfa/ReadCerfa.js.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts +15 -0
- package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.js +70 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Read.d.ts +4 -0
- package/dist/cjs/types/Interface/api/commercialManagement/Read.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Read.js.map +1 -1
- package/dist/cjs/types/Interface/api/registration/CreateRegistration.d.ts +2 -0
- package/dist/cjs/types/Interface/api/registration/CreateRegistration.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/registration/CreateRegistration.js.map +1 -1
- package/dist/cjs/types/Interface/models/ISaleEmail.d.ts +15 -0
- package/dist/cjs/types/Interface/models/ISaleEmail.d.ts.map +1 -0
- package/dist/cjs/types/Interface/models/ISaleEmail.js +3 -0
- package/dist/cjs/types/Interface/models/ISaleEmail.js.map +1 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/saleEmail.d.ts +10 -0
- package/dist/cjs/utils/commercialManagement/saleEmail.d.ts.map +1 -0
- package/dist/cjs/utils/commercialManagement/saleEmail.js +34 -0
- package/dist/cjs/utils/commercialManagement/saleEmail.js.map +1 -0
- package/dist/mjs/api/resources/RegistrationForm.d.ts +3 -2
- package/dist/mjs/api/resources/RegistrationForm.d.ts.map +1 -1
- package/dist/mjs/api/resources/RegistrationForm.js +4 -1
- package/dist/mjs/api/resources/RegistrationForm.js.map +1 -1
- package/dist/mjs/types/Enum/Aspone.d.ts +57 -0
- package/dist/mjs/types/Enum/Aspone.d.ts.map +1 -1
- package/dist/mjs/types/Enum/Aspone.js +93 -0
- package/dist/mjs/types/Enum/Aspone.js.map +1 -1
- package/dist/mjs/types/Enum/CerfaType.d.ts +2 -1
- package/dist/mjs/types/Enum/CerfaType.d.ts.map +1 -1
- package/dist/mjs/types/Enum/CerfaType.js +1 -0
- package/dist/mjs/types/Enum/CerfaType.js.map +1 -1
- package/dist/mjs/types/Enum/CommercialManagement.d.ts +28 -0
- package/dist/mjs/types/Enum/CommercialManagement.d.ts.map +1 -1
- package/dist/mjs/types/Enum/CommercialManagement.js +136 -0
- package/dist/mjs/types/Enum/CommercialManagement.js.map +1 -1
- package/dist/mjs/types/Interface/api/cerfa/2573.d.ts +91 -0
- package/dist/mjs/types/Interface/api/cerfa/2573.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/cerfa/2573.js +2 -0
- package/dist/mjs/types/Interface/api/cerfa/2573.js.map +1 -0
- package/dist/mjs/types/Interface/api/cerfa/CreateCerfa.d.ts +1 -0
- package/dist/mjs/types/Interface/api/cerfa/CreateCerfa.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/cerfa/CreateCerfa.js +1 -0
- package/dist/mjs/types/Interface/api/cerfa/CreateCerfa.js.map +1 -1
- package/dist/mjs/types/Interface/api/cerfa/ReadCerfa.d.ts +2 -1
- package/dist/mjs/types/Interface/api/cerfa/ReadCerfa.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/cerfa/ReadCerfa.js.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts +15 -0
- package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.js +79 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Read.d.ts +4 -0
- package/dist/mjs/types/Interface/api/commercialManagement/Read.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Read.js.map +1 -1
- package/dist/mjs/types/Interface/api/registration/CreateRegistration.d.ts +2 -0
- package/dist/mjs/types/Interface/api/registration/CreateRegistration.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/registration/CreateRegistration.js.map +1 -1
- package/dist/mjs/types/Interface/models/ISaleEmail.d.ts +15 -0
- package/dist/mjs/types/Interface/models/ISaleEmail.d.ts.map +1 -0
- package/dist/mjs/types/Interface/models/ISaleEmail.js +2 -0
- package/dist/mjs/types/Interface/models/ISaleEmail.js.map +1 -0
- package/dist/mjs/types/index.d.ts +1 -0
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +1 -0
- package/dist/mjs/types/index.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/saleEmail.d.ts +10 -0
- package/dist/mjs/utils/commercialManagement/saleEmail.d.ts.map +1 -0
- package/dist/mjs/utils/commercialManagement/saleEmail.js +30 -0
- package/dist/mjs/utils/commercialManagement/saleEmail.js.map +1 -0
- package/package.json +1 -1
- package/ts/api/resources/RegistrationForm.ts +8 -2
- package/ts/types/Enum/Aspone.ts +98 -1
- package/ts/types/Enum/CerfaType.ts +1 -0
- package/ts/types/Enum/CommercialManagement.ts +143 -1
- package/ts/types/Interface/api/cerfa/2573.ts +88 -0
- package/ts/types/Interface/api/cerfa/CreateCerfa.ts +1 -0
- package/ts/types/Interface/api/cerfa/ReadCerfa.ts +2 -0
- package/ts/types/Interface/api/commercialManagement/Create.ts +58 -2
- package/ts/types/Interface/api/commercialManagement/Read.ts +5 -0
- package/ts/types/Interface/api/registration/CreateRegistration.ts +2 -0
- package/ts/types/Interface/models/ISaleEmail.ts +18 -0
- package/ts/types/index.ts +1 -0
- package/ts/utils/commercialManagement/saleEmail.ts +43 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { emailTemplateVariableAffiliatedData, intersection } from '../../types';
|
|
2
|
+
export function transformModelWithCharcodeToString(datas, template) {
|
|
3
|
+
// this regex match the carac with []
|
|
4
|
+
const reg = /\[(.*?)\]/g;
|
|
5
|
+
const charcodesFound = template.match(reg) ?? [];
|
|
6
|
+
const charcodesFoundWithoutBrackets = [];
|
|
7
|
+
charcodesFound?.forEach((f) => charcodesFoundWithoutBrackets.push(f.replace(/[\[\]']+/g, '')));
|
|
8
|
+
// we get the list of matching key template with key data
|
|
9
|
+
const charcodesDetected = emailTemplateVariableAffiliatedData.filter((data) => intersection(emailTemplateVariableAffiliatedData.map((d) => d.name), charcodesFoundWithoutBrackets).includes(data.name));
|
|
10
|
+
let newString = template;
|
|
11
|
+
charcodesDetected.forEach((char) => {
|
|
12
|
+
// we split the string just after the first occurence found, the first one will be replace by data
|
|
13
|
+
// and the last one will be paste at the end, to be used for the next loop.
|
|
14
|
+
const endOfString = newString.substring(newString.indexOf(']') + 1, newString.length);
|
|
15
|
+
const splitString = newString.substring(0, newString.indexOf(']') + 1);
|
|
16
|
+
let dataToInfer = datas[char.data[0]];
|
|
17
|
+
if (!dataToInfer && char.data.length > 1) {
|
|
18
|
+
dataToInfer = datas[char.data[1]];
|
|
19
|
+
}
|
|
20
|
+
// if we don't find an occurence in the first part, then it means that we have an unknow occurence and then we pass to the next one
|
|
21
|
+
if (splitString.indexOf(`[${char.name}]`) === -1) {
|
|
22
|
+
newString = splitString + endOfString.replace(`[${char.name}]`, `${dataToInfer}`);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
newString = splitString.replace(`[${char.name}]`, `${dataToInfer}`) + endOfString;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return newString;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=saleEmail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saleEmail.js","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/saleEmail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAWhF,MAAM,UAAU,kCAAkC,CAAC,KAAoB,EAAE,QAAgB;IACvF,qCAAqC;IACrC,MAAM,GAAG,GAAG,YAAY,CAAC;IAEzB,MAAM,cAAc,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IACjD,MAAM,6BAA6B,GAAa,EAAE,CAAC;IACnD,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAE/F,yDAAyD;IACzD,MAAM,iBAAiB,GAAG,mCAAmC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,mCAAmC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,6BAA6B,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAGxM,IAAI,SAAS,GAAG,QAAQ,CAAC;IACzB,iBAAiB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACjC,kGAAkG;QAClG,2EAA2E;QAC3E,MAAM,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QACtF,MAAM,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAEvE,IAAI,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACtC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC;QACD,mIAAmI;QACnI,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YACjD,SAAS,GAAG,WAAW,GAAI,WAAW,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC;QACrF,CAAC;aAAM,CAAC;YACN,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,WAAW,EAAE,CAAC,GAAG,WAAW,CAAC;QACpF,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { emailTemplateVariableAffiliatedData, intersection } from '../../types';\n\nexport type InfoToUseType = {\n reference?: string;\n totalIncludedAmount?: number;\n societyName?: string;\n company?: string | null;\n fullname?: string | null;\n title?: string;\n};\n\nexport function transformModelWithCharcodeToString(datas: InfoToUseType, template: string): string {\n // this regex match the carac with []\n const reg = /\\[(.*?)\\]/g;\n\n const charcodesFound = template.match(reg) ?? [];\n const charcodesFoundWithoutBrackets: string[] = [];\n charcodesFound?.forEach((f) => charcodesFoundWithoutBrackets.push(f.replace(/[\\[\\]']+/g, '')));\n\n // we get the list of matching key template with key data\n const charcodesDetected = emailTemplateVariableAffiliatedData.filter((data) => intersection(emailTemplateVariableAffiliatedData.map((d) => d.name), charcodesFoundWithoutBrackets).includes(data.name));\n\n\n let newString = template;\n charcodesDetected.forEach((char) => {\n // we split the string just after the first occurence found, the first one will be replace by data\n // and the last one will be paste at the end, to be used for the next loop.\n const endOfString = newString.substring(newString.indexOf(']') + 1, newString.length);\n const splitString = newString.substring(0, newString.indexOf(']') + 1);\n\n let dataToInfer = datas[char.data[0]];\n if (!dataToInfer && char.data.length > 1) {\n dataToInfer = datas[char.data[1]];\n }\n // if we don't find an occurence in the first part, then it means that we have an unknow occurence and then we pass to the next one\n if (splitString.indexOf(`[${char.name}]`) === -1) {\n newString = splitString + endOfString.replace(`[${char.name}]`, `${dataToInfer}`);\n } else {\n newString = splitString.replace(`[${char.name}]`, `${dataToInfer}`) + endOfString;\n }\n });\n return newString;\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.27",
|
|
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",
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { ReadCerfa2069RCIInputs } from '../../types';
|
|
1
|
+
import { ReadCerfa2069RCIInputs, ReadCerfa2573Inputs } from '../../types';
|
|
2
2
|
import { Resource } from '../Resource';
|
|
3
3
|
|
|
4
4
|
export class RegistrationForm extends Resource {
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
getAll2069RCIInputs(idExercice: number): Promise<ReadCerfa2069RCIInputs> {
|
|
6
7
|
return this.axios.$get(`/exercices/${idExercice}/forms/cerfa-2069-rci/inputs`);
|
|
7
8
|
}
|
|
9
|
+
|
|
10
|
+
getAll2573Inputs(idExercice: number): Promise<ReadCerfa2573Inputs> {
|
|
11
|
+
return this.axios.$get(`/exercices/${idExercice}/forms/cerfa-2573/inputs`);
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
}
|
package/ts/types/Enum/Aspone.ts
CHANGED
|
@@ -116,4 +116,101 @@ export enum AsponeCR6_2024 {
|
|
|
116
116
|
'EOM' = 'EOM', // 'Crédit d’impôt en faveur des éditeurs d’œuvres musicales',
|
|
117
117
|
'TZM' = 'TZM', // 'Réduction d’impôt prêt à taux zéro mobilité au titre de N',
|
|
118
118
|
'AUT' = 'AUT', // 'Autres crédits d\'impôts',
|
|
119
|
-
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export enum AsponeCRB_2024 {
|
|
122
|
+
'FOR' = 'FOR',
|
|
123
|
+
'RAC' = 'RAC',
|
|
124
|
+
'FAM' = 'FAM',
|
|
125
|
+
'CIR' = 'CIR',
|
|
126
|
+
'CRC' = 'CRC',
|
|
127
|
+
'COR' = 'COR',
|
|
128
|
+
'RAD' = 'RAD',
|
|
129
|
+
'APR' = 'APR',
|
|
130
|
+
'EXP' = 'EXP',
|
|
131
|
+
'PTZ' = 'PTZ',
|
|
132
|
+
'CIN' = 'CIN',
|
|
133
|
+
'BIO' = 'BIO',
|
|
134
|
+
'PHO' = 'PHO',
|
|
135
|
+
'MAI' = 'MAI',
|
|
136
|
+
'AUD' = 'AUD',
|
|
137
|
+
'ART' = 'ART',
|
|
138
|
+
'CJV' = 'CJV',
|
|
139
|
+
'CAI' = 'CAI',
|
|
140
|
+
'CPE' = 'CPE',
|
|
141
|
+
'CCI' = 'CCI',
|
|
142
|
+
'PTR' = 'PTR',
|
|
143
|
+
'CIC' = 'CIC',
|
|
144
|
+
'CIO' = 'CIO',
|
|
145
|
+
'COL' = 'COL',
|
|
146
|
+
'CSV' = 'CSV',
|
|
147
|
+
'CAC' = 'CAC',
|
|
148
|
+
'REB' = 'REB',
|
|
149
|
+
'BLC' = 'BLC',
|
|
150
|
+
'RTD' = 'RTD',
|
|
151
|
+
'CPG' = 'CPG',
|
|
152
|
+
'HVE' = 'HVE',
|
|
153
|
+
'EOM' = 'EOM',
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export const AsponeCRB_2024_List: Array<{ id: AsponeCRB_2024, value: string; }> = [
|
|
157
|
+
{ id: AsponeCRB_2024.FOR, value: 'FOR Dépenses de formation des dirigeants' },
|
|
158
|
+
{ id: AsponeCRB_2024.RAC, value: 'RAC Rachat d\'une entreprise par ses salariés' },
|
|
159
|
+
{ id: AsponeCRB_2024.FAM, value: 'FAM Famille' },
|
|
160
|
+
{ id: AsponeCRB_2024.CIR, value: 'CIR Recherche' },
|
|
161
|
+
{ id: AsponeCRB_2024.CRC, value: 'CRC CRC - Crédit d’impôt recherche collaborative' },
|
|
162
|
+
{ id: AsponeCRB_2024.COR, value: 'COR Investissements réalisés et exploités en Corse' },
|
|
163
|
+
{ id: AsponeCRB_2024.RAD, value: 'RAD Report en arrière de déficits' },
|
|
164
|
+
{ id: AsponeCRB_2024.APR, value: 'APR Apprentissage' },
|
|
165
|
+
{ id: AsponeCRB_2024.EXP, value: 'EXP Dépenses de prospection commerciale' },
|
|
166
|
+
{ id: AsponeCRB_2024.PTZ, value: 'PTZ Prêt à taux zéro' },
|
|
167
|
+
{ id: AsponeCRB_2024.CIN, value: 'CIN Cinéma' },
|
|
168
|
+
{ id: AsponeCRB_2024.BIO, value: 'BIO Agriculture biologique' },
|
|
169
|
+
{ id: AsponeCRB_2024.PHO, value: 'PHO Production d\'œuvre phonographique' },
|
|
170
|
+
{ id: AsponeCRB_2024.MAI, value: 'MAI Maîtres restaurateurs' },
|
|
171
|
+
{ id: AsponeCRB_2024.AUD, value: 'AUD Formats audiovisuels' },
|
|
172
|
+
{ id: AsponeCRB_2024.ART, value: 'ART Métiers d\'art' },
|
|
173
|
+
{ id: AsponeCRB_2024.CJV, value: 'CJV Création de jeux vidéo' },
|
|
174
|
+
{ id: AsponeCRB_2024.CAI, value: 'CAI Intéressement' },
|
|
175
|
+
{ id: AsponeCRB_2024.CPE, value: 'CPE Eco-PTZ' },
|
|
176
|
+
{ id: AsponeCRB_2024.CCI, value: 'CCI Cinéma international' },
|
|
177
|
+
{ id: AsponeCRB_2024.PTR, value: 'PTR Prêt à taux "plus"' },
|
|
178
|
+
{ id: AsponeCRB_2024.CIC, value: 'CIC Compétitivité des entreprises' },
|
|
179
|
+
{ id: AsponeCRB_2024.CIO, value: 'CIO Outre Mer secteur productif' },
|
|
180
|
+
{ id: AsponeCRB_2024.COL, value: 'COL Outre Mer logement social' },
|
|
181
|
+
{ id: AsponeCRB_2024.CSV, value: 'CSV Spectacle vivant' },
|
|
182
|
+
{ id: AsponeCRB_2024.CAC, value: 'CAC Crédit d\'impôt création audiovisuelle et cinématographique' },
|
|
183
|
+
{ id: AsponeCRB_2024.REB, value: 'REB Crédit d\'impôt PME pour la rénovation énergétique des bâtiments à usage tertiaire' },
|
|
184
|
+
{ id: AsponeCRB_2024.BLC, value: 'BLC Crédit d\'impôt pour abandon de loyers des bailleurs de locaux commerciaux' },
|
|
185
|
+
{ id: AsponeCRB_2024.RTD, value: 'RTD RTD - Crédit d\'impôt en faveur des représentations théâtrales d’oeuvres dramatiques' },
|
|
186
|
+
{ id: AsponeCRB_2024.CPG, value: 'CPG CPG – Crédit d\'impôt entreprises agricoles secteur cultures permanentes sans glyphosate' },
|
|
187
|
+
{ id: AsponeCRB_2024.HVE, value: 'HVE HVE - Crédit d\'impôt entreprises agricoles certification exploitation haute valeur environnementale' },
|
|
188
|
+
{ id: AsponeCRB_2024.EOM, value: 'EOM EOM - Crédit d’impôt en faveur des éditeurs d’oeuvres musicales' },
|
|
189
|
+
];
|
|
190
|
+
|
|
191
|
+
export enum AsponeENT_2024 {
|
|
192
|
+
'JEI' = 'JEI',
|
|
193
|
+
'PME' = 'PME',
|
|
194
|
+
'ENN' = 'ENN',
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
export const AsponeENT_2024_LIST = [
|
|
199
|
+
{ id: AsponeENT_2024.JEI, value: 'Jeune Entreprise Innovante' },
|
|
200
|
+
{ id: AsponeENT_2024.PME, value: 'PME au sens communautaire' },
|
|
201
|
+
{ id: AsponeENT_2024.ENN, value: 'Entreprise nouvelle' },
|
|
202
|
+
];
|
|
203
|
+
|
|
204
|
+
export enum AsponeCOL_2024 {
|
|
205
|
+
CL = 'CL',
|
|
206
|
+
SV = 'SV',
|
|
207
|
+
RJ = 'RJ',
|
|
208
|
+
LJ = 'LJ',
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export const AsponeCOL_2024_LIST = [
|
|
212
|
+
{ id: AsponeCOL_2024.CL, value: 'Conciliation' },
|
|
213
|
+
{ id: AsponeCOL_2024.SV, value: 'Jugement de sauvegarde' },
|
|
214
|
+
{ id: AsponeCOL_2024.RJ, value: 'Redressement judiciaire' },
|
|
215
|
+
{ id: AsponeCOL_2024.LJ, value: 'Liquidation judiciaire' },
|
|
216
|
+
];
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { InfoToUseType } from '../../utils/commercialManagement/saleEmail';
|
|
2
|
+
import { ISaleEmail } from '../Interface/models/ISaleEmail';
|
|
3
|
+
|
|
1
4
|
export enum FontIds {
|
|
2
5
|
CIRCULAR_STD = 1,
|
|
3
6
|
ROBOTO = 2,
|
|
@@ -90,4 +93,143 @@ export const AccountingCategoryList: Array<{ label: string; id: AccountingCatego
|
|
|
90
93
|
export enum InvoiceLanguage {
|
|
91
94
|
FR = 'fr',
|
|
92
95
|
EN = 'en',
|
|
93
|
-
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export enum EmailTemplateVariable {
|
|
99
|
+
// CLIENT_FIRST_NAME = 'prenom_client',
|
|
100
|
+
CLIENT_NAME = 'nom_client',
|
|
101
|
+
DOCUMENT_REFERENCE = 'reference_document',
|
|
102
|
+
DOCUMENT_TOTAL_INCLUDED_AMOUNT = 'montant_ttc_document',
|
|
103
|
+
DOCUMENT_TITLE = 'titre_document',
|
|
104
|
+
OWNER_SOCIETY_NAME = 'nom_societe',
|
|
105
|
+
GOOGLE_LINK = 'lien_google',
|
|
106
|
+
TRUSTPILOT_LINK = 'lien_trustpilot',
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const emailTemplateVariableList = ['nom_client', 'reference_document', 'montant_ttc_document', 'titre_document', 'nom_societe', 'lien_google', 'lien_trustpilot'];
|
|
110
|
+
export const emailTemplateVariableAffiliatedData: Array<{ name: string; data: Array<keyof InfoToUseType> }> = [
|
|
111
|
+
{
|
|
112
|
+
name: 'nom_client',
|
|
113
|
+
data: ['fullname', 'company'],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'reference_document',
|
|
117
|
+
data: ['reference'],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'montant_ttc_document',
|
|
121
|
+
data: ['totalIncludedAmount'],
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'titre_document',
|
|
125
|
+
data: ['title'],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'nom_societe',
|
|
129
|
+
data: ['societyName'],
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
|
|
133
|
+
export enum EmailType {
|
|
134
|
+
ESTIMATE = 1,
|
|
135
|
+
INVOICE = 2,
|
|
136
|
+
ORDER_FORM = 3,
|
|
137
|
+
CUSTOMER_REMINDER = 4,
|
|
138
|
+
CUSTOMER_FEEDBACK_REQUEST = 5,
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export const EmailTypeLit: Array<{ label: string; id: EmailType }> = [
|
|
142
|
+
{
|
|
143
|
+
label: 'Envoi de devis',
|
|
144
|
+
id: EmailType.ESTIMATE,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
label: 'Envoi de facture',
|
|
148
|
+
id: EmailType.INVOICE,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
label: 'Envoi de bons de commande',
|
|
152
|
+
id: EmailType.ORDER_FORM,
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
label: 'Relance client',
|
|
156
|
+
id: EmailType.CUSTOMER_REMINDER,
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
label: 'Demande d\'avis clients',
|
|
160
|
+
id: EmailType.CUSTOMER_FEEDBACK_REQUEST,
|
|
161
|
+
},
|
|
162
|
+
];
|
|
163
|
+
|
|
164
|
+
export const DefaultEmailTemplateList: Array<Omit<ISaleEmail, 'idSociety'>> = [
|
|
165
|
+
{
|
|
166
|
+
name: 'modèle_devis_defaut',
|
|
167
|
+
subject: 'Votre devis',
|
|
168
|
+
content: `<div class="page">
|
|
169
|
+
<p>Bonjour,</p>
|
|
170
|
+
<p>Vous trouverez ci-joint votre devis.</p>
|
|
171
|
+
<p>
|
|
172
|
+
Merci de votre confiance !
|
|
173
|
+
</p>
|
|
174
|
+
<p>
|
|
175
|
+
Cordialement,<br>
|
|
176
|
+
[nom_societe]
|
|
177
|
+
</p>
|
|
178
|
+
</div>`,
|
|
179
|
+
type: EmailType.ESTIMATE,
|
|
180
|
+
isDefault: false,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: 'modèle_facture_defaut',
|
|
184
|
+
subject: 'Votre facture',
|
|
185
|
+
content: `<div class="page">
|
|
186
|
+
<p>Bonjour,</p>
|
|
187
|
+
<p>Vous trouverez ci-joint votre facture.</p>
|
|
188
|
+
<p>
|
|
189
|
+
Nous vous remercions par avance de votre règlement rapide.<br/>
|
|
190
|
+
Merci de votre confiance !
|
|
191
|
+
</p>
|
|
192
|
+
<p>
|
|
193
|
+
Cordialement,<br>
|
|
194
|
+
[nom_societe]
|
|
195
|
+
</p>
|
|
196
|
+
</div>`,
|
|
197
|
+
type: EmailType.INVOICE,
|
|
198
|
+
isDefault: false,
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: 'modèle_bon_de_commande_defaut',
|
|
202
|
+
subject: 'Votre bon de commande',
|
|
203
|
+
content: `<div class="page">
|
|
204
|
+
<p>Bonjour,</p>
|
|
205
|
+
<p>Vous trouverez ci-joint votre bon de commande.</p>
|
|
206
|
+
<p>
|
|
207
|
+
Merci de votre confiance !
|
|
208
|
+
</p>
|
|
209
|
+
<p>
|
|
210
|
+
Cordialement,<br>
|
|
211
|
+
[nom_societe]
|
|
212
|
+
</p>
|
|
213
|
+
</div>`,
|
|
214
|
+
type: EmailType.ORDER_FORM,
|
|
215
|
+
isDefault: false,
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: 'modèle_récurence_defaut',
|
|
219
|
+
subject: 'Votre facture',
|
|
220
|
+
content: `<div class="page">
|
|
221
|
+
<p>Bonjour,</p>
|
|
222
|
+
<p>Vous trouverez ci-joint votre facture.</p>
|
|
223
|
+
<p>
|
|
224
|
+
Nous vous remercions par avance de votre règlement rapide.<br/>
|
|
225
|
+
Merci de votre confiance !
|
|
226
|
+
</p>
|
|
227
|
+
<p>
|
|
228
|
+
Cordialement,<br>
|
|
229
|
+
[nom_societe]
|
|
230
|
+
</p>
|
|
231
|
+
</div>`,
|
|
232
|
+
type: EmailType.CUSTOMER_REMINDER,
|
|
233
|
+
isDefault: false,
|
|
234
|
+
},
|
|
235
|
+
];
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { AsponeCOL_2024, AsponeCRB_2024, AsponeENT_2024 } from '../../../Enum/Aspone';
|
|
2
|
+
import { CerfaAddress } from './ReadCerfa';
|
|
3
|
+
|
|
4
|
+
type Cession = {
|
|
5
|
+
amount: number;
|
|
6
|
+
cessionDate: Date;
|
|
7
|
+
closingDate: Date;
|
|
8
|
+
siren: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type CompanyTaxRefund = {
|
|
12
|
+
amount: number;
|
|
13
|
+
impute: {
|
|
14
|
+
amount: number | null;
|
|
15
|
+
date: Date | null;
|
|
16
|
+
tax: string | null;
|
|
17
|
+
};
|
|
18
|
+
nature: string | null;
|
|
19
|
+
procedure: {
|
|
20
|
+
date: string;
|
|
21
|
+
nature: string;
|
|
22
|
+
} | null;
|
|
23
|
+
reason: string | null;
|
|
24
|
+
year: number | null;
|
|
25
|
+
interest: number | null;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type Repayment = {
|
|
29
|
+
amount: number;
|
|
30
|
+
closingDate: Date;
|
|
31
|
+
interests: number;
|
|
32
|
+
nature: string;
|
|
33
|
+
transferDate: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
type Transfert = {
|
|
37
|
+
amount: number;
|
|
38
|
+
closingDate: string;
|
|
39
|
+
date: Date;
|
|
40
|
+
nature: string;
|
|
41
|
+
siren: string;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type Cerfa2573_2024 = {
|
|
45
|
+
cessions: Cession[];
|
|
46
|
+
declaration: {
|
|
47
|
+
recipient: {
|
|
48
|
+
address: CerfaAddress;
|
|
49
|
+
name: string;
|
|
50
|
+
operator: null | {
|
|
51
|
+
address: CerfaAddress;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
siren: string;
|
|
55
|
+
};
|
|
56
|
+
headOfGroupSiren: string | null;
|
|
57
|
+
absorbentCompanySiren: string | null;
|
|
58
|
+
hasTaxIntegrationRegime: boolean;
|
|
59
|
+
refunds: CompanyTaxRefund[];
|
|
60
|
+
repayments: Repayment[];
|
|
61
|
+
transferts: Transfert[];
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type Prepare2573Params = {
|
|
65
|
+
idSociety: number;
|
|
66
|
+
idExercice: number;
|
|
67
|
+
values: Cerfa2573_2024;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type Cerfa2573_Refund_Input = {
|
|
71
|
+
nature: AsponeCRB_2024;
|
|
72
|
+
year: number | null;
|
|
73
|
+
amount: number | null;
|
|
74
|
+
reason: AsponeENT_2024 | null;
|
|
75
|
+
procedure: {
|
|
76
|
+
date: Date | null;
|
|
77
|
+
nature: | null;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export type ReadCerfa2573Inputs = {
|
|
82
|
+
refunds: Cerfa2573_Refund_Input[];
|
|
83
|
+
selectValues: {
|
|
84
|
+
natures: Array<{ id: AsponeCRB_2024, value: string; }>;
|
|
85
|
+
procedureNatures: Array<{ id: AsponeCOL_2024, value: string; }>;
|
|
86
|
+
reasons: Array<{ id: AsponeENT_2024, value: string; }>;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
Cerfa2572_2022,
|
|
12
12
|
Cerfa2572_2023,
|
|
13
13
|
Cerfa2572_2024,
|
|
14
|
+
Cerfa2573_2024,
|
|
14
15
|
Cerfa3519_2017,
|
|
15
16
|
FieldForGeneration, FullCerfa2035, FullCerfa2035_2024, PayloadCerfa3519_2017, QuestionWording,
|
|
16
17
|
} from '../../..';
|
|
@@ -114,6 +115,7 @@ export type AsponeFormFields = Array<{ name: string; fields: FieldForGeneration[
|
|
|
114
115
|
export type AsponeFormField = { name: string; fields: FieldForGeneration[] };
|
|
115
116
|
|
|
116
117
|
export interface RegistrationPayload {
|
|
118
|
+
cerfa2573?: Cerfa2573_2024;
|
|
117
119
|
cerfa2572?: Cerfa2572_2022 | Cerfa2572_2023 | Cerfa2572_2024;
|
|
118
120
|
cerfa2571?: Cerfa2571_2023 | Cerfa2571_2024;
|
|
119
121
|
cerfa2031?: Cerfa2031 | Cerfa2031_2024;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import { IFile, ReadProductEditing } from '../../..';
|
|
5
5
|
import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
|
|
6
6
|
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
7
|
-
import { AccountingCategoryId, FontIds, InvoiceLanguage, LogoAlignment } from '../../../Enum/CommercialManagement';
|
|
7
|
+
import { AccountingCategoryId, EmailType, FontIds, InvoiceLanguage, LogoAlignment } from '../../../Enum/CommercialManagement';
|
|
8
8
|
import { EstimateInvoiceType } from '../../../Enum/EstimateInvoice';
|
|
9
9
|
import { RecurrenceType } from '../../../Enum/RecurrenceType';
|
|
10
10
|
import { IProductInvoice } from '../../models/IProductInvoice';
|
|
@@ -552,4 +552,60 @@ export type CreateMailHeader = {
|
|
|
552
552
|
fileUrl: string | null,
|
|
553
553
|
hostS3: string,
|
|
554
554
|
hasVat: boolean
|
|
555
|
-
};
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
export class CreateSaleEmail {
|
|
558
|
+
@ApiProperty()
|
|
559
|
+
@IsString()
|
|
560
|
+
name: string;
|
|
561
|
+
|
|
562
|
+
@ApiProperty()
|
|
563
|
+
@IsString()
|
|
564
|
+
subject: string;
|
|
565
|
+
|
|
566
|
+
@ApiProperty()
|
|
567
|
+
@IsString()
|
|
568
|
+
content: string;
|
|
569
|
+
|
|
570
|
+
@ApiProperty()
|
|
571
|
+
@IsEnum(EmailType)
|
|
572
|
+
type: number;
|
|
573
|
+
|
|
574
|
+
@ApiPropertyOptional()
|
|
575
|
+
@IsOptional()
|
|
576
|
+
@IsBoolean()
|
|
577
|
+
@ToBoolean()
|
|
578
|
+
isDefault?: boolean;
|
|
579
|
+
|
|
580
|
+
@ApiProperty()
|
|
581
|
+
@IsInt()
|
|
582
|
+
idSociety: number;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export class UpdateSaleEmail {
|
|
586
|
+
@ApiPropertyOptional()
|
|
587
|
+
@IsOptional()
|
|
588
|
+
@IsString()
|
|
589
|
+
name?: string;
|
|
590
|
+
|
|
591
|
+
@ApiPropertyOptional()
|
|
592
|
+
@IsOptional()
|
|
593
|
+
@IsString()
|
|
594
|
+
subject?: string;
|
|
595
|
+
|
|
596
|
+
@ApiPropertyOptional()
|
|
597
|
+
@IsOptional()
|
|
598
|
+
@IsString()
|
|
599
|
+
content?: string;
|
|
600
|
+
|
|
601
|
+
@ApiPropertyOptional()
|
|
602
|
+
@IsOptional()
|
|
603
|
+
@IsEnum(EmailType)
|
|
604
|
+
type?: number;
|
|
605
|
+
|
|
606
|
+
@ApiPropertyOptional()
|
|
607
|
+
@IsOptional()
|
|
608
|
+
@IsBoolean()
|
|
609
|
+
@ToBoolean()
|
|
610
|
+
isDefault?: boolean;
|
|
611
|
+
}
|
|
@@ -7,6 +7,7 @@ import { IEstimateInvoice } from '../../models/IEstimateInvoice';
|
|
|
7
7
|
import { EstimateStatus, FontIds, InvoiceStatus } from '../../../Enum/CommercialManagement';
|
|
8
8
|
import { IThirdParty } from '../../models/IThirdParty';
|
|
9
9
|
import { InternationalizationChoices } from '../../../../utils/commercialManagement/internationalization/type';
|
|
10
|
+
import { ISaleEmail } from '../../models/ISaleEmail';
|
|
10
11
|
|
|
11
12
|
export type ReadCashBasedInvoice = Partial<IAccountingFile>;
|
|
12
13
|
|
|
@@ -101,4 +102,8 @@ export type ReadCountDocumentByStatus = {
|
|
|
101
102
|
|
|
102
103
|
export type ReadCommercialMailTemplate = {
|
|
103
104
|
header: string;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export type ReadSaleEmail = ISaleEmail & {
|
|
108
|
+
defaultFromApplication: boolean;
|
|
104
109
|
};
|
|
@@ -14,6 +14,7 @@ import { CerfaFormValue } from '../cerfa/ReadCerfa';
|
|
|
14
14
|
import { UpdatedAnnotation } from './ReadRegistration';
|
|
15
15
|
import { CustomerVatState, CustomerVatType } from '../../../Enum/CustomerVat';
|
|
16
16
|
import { Cerfa2069RCI_2024_Payload } from '../cerfa/2069RCI';
|
|
17
|
+
import { Cerfa2573_2024 } from '../cerfa/2573';
|
|
17
18
|
|
|
18
19
|
export class CreateRegistrationSetting {
|
|
19
20
|
@ApiPropertyOptional()
|
|
@@ -72,6 +73,7 @@ export type ForcedValues_2571 = {
|
|
|
72
73
|
export type ForcedValues = {
|
|
73
74
|
cerfa2571?: ForcedValues_2571;
|
|
74
75
|
cerfa2069RCI?: Cerfa2069RCI_2024_Payload;
|
|
76
|
+
cerfa2573?: Cerfa2573_2024;
|
|
75
77
|
};
|
|
76
78
|
|
|
77
79
|
export class CreateRegistration {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EmailType } from '../../Enum/CommercialManagement';
|
|
2
|
+
import { ISociety } from './ISociety';
|
|
3
|
+
|
|
4
|
+
export interface ISaleEmail {
|
|
5
|
+
id?: number;
|
|
6
|
+
name: string;
|
|
7
|
+
subject: string;
|
|
8
|
+
content: string;
|
|
9
|
+
type: EmailType;
|
|
10
|
+
isDefault: boolean;
|
|
11
|
+
idSociety: number;
|
|
12
|
+
createdAt?: Date | null;
|
|
13
|
+
updatedAt?: Date | null;
|
|
14
|
+
|
|
15
|
+
// association
|
|
16
|
+
|
|
17
|
+
society?: ISociety
|
|
18
|
+
}
|
package/ts/types/index.ts
CHANGED
|
@@ -338,6 +338,7 @@ export * from './Interface/models/ILoanEarlyRepayment';
|
|
|
338
338
|
export * from './Interface/models/IPrevisionalForm';
|
|
339
339
|
export * from './Interface/models/IHumanResourceLibrary';
|
|
340
340
|
export * from './Interface/models/IUserHumanResourceLibrary';
|
|
341
|
+
export * from './Interface/models/ISaleEmail';
|
|
341
342
|
|
|
342
343
|
|
|
343
344
|
// Schemas
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { emailTemplateVariableAffiliatedData, intersection } from '../../types';
|
|
2
|
+
|
|
3
|
+
export type InfoToUseType = {
|
|
4
|
+
reference?: string;
|
|
5
|
+
totalIncludedAmount?: number;
|
|
6
|
+
societyName?: string;
|
|
7
|
+
company?: string | null;
|
|
8
|
+
fullname?: string | null;
|
|
9
|
+
title?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function transformModelWithCharcodeToString(datas: InfoToUseType, template: string): string {
|
|
13
|
+
// this regex match the carac with []
|
|
14
|
+
const reg = /\[(.*?)\]/g;
|
|
15
|
+
|
|
16
|
+
const charcodesFound = template.match(reg) ?? [];
|
|
17
|
+
const charcodesFoundWithoutBrackets: string[] = [];
|
|
18
|
+
charcodesFound?.forEach((f) => charcodesFoundWithoutBrackets.push(f.replace(/[\[\]']+/g, '')));
|
|
19
|
+
|
|
20
|
+
// we get the list of matching key template with key data
|
|
21
|
+
const charcodesDetected = emailTemplateVariableAffiliatedData.filter((data) => intersection(emailTemplateVariableAffiliatedData.map((d) => d.name), charcodesFoundWithoutBrackets).includes(data.name));
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
let newString = template;
|
|
25
|
+
charcodesDetected.forEach((char) => {
|
|
26
|
+
// we split the string just after the first occurence found, the first one will be replace by data
|
|
27
|
+
// and the last one will be paste at the end, to be used for the next loop.
|
|
28
|
+
const endOfString = newString.substring(newString.indexOf(']') + 1, newString.length);
|
|
29
|
+
const splitString = newString.substring(0, newString.indexOf(']') + 1);
|
|
30
|
+
|
|
31
|
+
let dataToInfer = datas[char.data[0]];
|
|
32
|
+
if (!dataToInfer && char.data.length > 1) {
|
|
33
|
+
dataToInfer = datas[char.data[1]];
|
|
34
|
+
}
|
|
35
|
+
// if we don't find an occurence in the first part, then it means that we have an unknow occurence and then we pass to the next one
|
|
36
|
+
if (splitString.indexOf(`[${char.name}]`) === -1) {
|
|
37
|
+
newString = splitString + endOfString.replace(`[${char.name}]`, `${dataToInfer}`);
|
|
38
|
+
} else {
|
|
39
|
+
newString = splitString.replace(`[${char.name}]`, `${dataToInfer}`) + endOfString;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return newString;
|
|
43
|
+
}
|