fix: stats of assistant charges déductibles

- uniformise stats tracking for all assistants
- remove gerer chapter1
- add chapter2 for pour-mon-entreprise
- fix stats for assistant charges déductibles

fix #2907
pull/2947/head
Johan Girod 2024-05-03 11:17:40 +02:00
parent a951142801
commit 08991ef12a
8 changed files with 11 additions and 9 deletions

View File

@ -70,7 +70,7 @@ const buildSimulateursQuery =
filter: {
property: {
page_chapter1: {
$in: ['assistant', 'simulateurs', 'gérer'],
$in: ['assistant', 'simulateurs', 'gerer'],
},
},
},

View File

@ -23,7 +23,6 @@ export function toAtString(string: string): string {
type Chapter1 =
| 'simulateurs'
| 'informations'
| 'gerer'
| 'assistants'
| 'documentation'
| 'integration'

View File

@ -13,7 +13,7 @@ export function déclarationChargesSocialesIndépendantConfig({
iframePath: 'déclaration-charges-sociales-indépendant',
icône: '📑',
tracking: {
chapter1: 'gerer',
chapter1: 'assistant',
chapter2: 'declaration_charges_sociales_independant',
},
meta: {

View File

@ -101,7 +101,7 @@ export default function AideDéclarationIndépendant() {
</Body>
</Trans>
{Object.keys(situation).length ? (
<TrackPage name="commence" />
<TrackPage name="simulation commencée" />
) : (
<TrackPage name="accueil" />
)}

View File

@ -11,7 +11,7 @@ export function demandeMobilitéConfig({ t, sitePaths }: SimulatorsDataParams) {
path: sitePaths.assistants.formulaireMobilité,
icône: '🧳',
tracking: {
chapter1: 'gerer',
chapter1: 'assistant',
chapter2: 'demande_mobilite',
},
meta: {

View File

@ -246,7 +246,7 @@ function FormulairePublicodes() {
{!Object.keys(situation).length ? (
<TrackPage name="accueil" />
) : missingValues.length ? (
<TrackPage name="commence" />
<TrackPage name="simulation commencée" />
) : null}
</>
)

View File

@ -33,7 +33,8 @@ export function pourMonEntrepriseConfig({
),
},
tracking: {
chapter1: 'gerer',
chapter1: 'assistant',
chapter2: 'pour_mon_entreprise',
},
component: PourMonEntreprise as () => JSX.Element, // avoid types loop error
} as const)

View File

@ -87,10 +87,12 @@ function computeVisits(
accueil: p.nombre.accueil,
simulation_commencee:
// In the case of Recherche APE, we need to post-process the data
(p.nombre.simulation_commencee ?? 0) + (p.nombre.recherche ?? 0) ||
(p.nombre.simulation_commencee ?? 0) +
(p.nombre.recherche ?? 0) +
(p.nombre.commence ?? 0) ||
// If the value is zero, we use simulation terminee instead
p.nombre.simulation_terminee,
simulation_terminee: p.nombre.simulation_terminee,
simulation_terminee: p.nombre.simulation_terminee ?? 0,
},
})) as Visites