Skip to content

fix: 1101 correctifs etape 3 (formattage adresse)#1284

Open
olivier-rabot wants to merge 4 commits intomainfrom
fix/1101-bilan-annees-etape-trois
Open

fix: 1101 correctifs etape 3 (formattage adresse)#1284
olivier-rabot wants to merge 4 commits intomainfrom
fix/1101-bilan-annees-etape-trois

Conversation

@olivier-rabot
Copy link
Copy Markdown
Contributor

@olivier-rabot olivier-rabot commented Apr 21, 2026

Ticket(s) lié(s)

https://jira-mcas.atlassian.net/jira/software/c/projects/VAO/boards/336?selectedIssue=VAO-1194

Description

Correction du problème lié à l'ajout d'un séjour sur l'etape 3. Ajout d'une fonction de formattage de l'adresse.
Activation conditionnelle de certains champs (type deficiences, periode) > non required quand l'agrement est en statut brouillon

Screenshot / liens loom

Check-list

  • Ma branche est rebase sur main
  • Des tests ont été écrits pour tous les endpoints créés ou modifiés
  • Refacto "à la volée" des parties sur lesquelles j'ai codée
  • Plus de console.log
  • J'ai ajouté une validation de schéma sur la route que j'ai ajouté ou modifié
  • J'ai converti les fichiers vue en <script lang="ts">
  • Mon code est en Typescript (autant que possible)

Testing instructions

@revu-bot revu-bot Bot requested a review from revu-bot April 21, 2026 14:22
@olivier-rabot olivier-rabot marked this pull request as ready for review April 22, 2026 12:12
Copy link
Copy Markdown
Collaborator

@revu-bot revu-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: fix/1101 — Address formatting & step 3 corrections

This PR extracts a normalizeAdresse utility into shared-bridge, fixes a bug where allResults was populated even on failed validations, and adds TypeScript types to several Vue components. The overall direction is good, but there are a few issues worth addressing.

File Lines Severity Issue
shared-bridge/src/utils/normalizeAdresse.ts 3 CRITICAL Null-input type mismatch — function signature says AdresseDto but passes null/undefined through
shared-bridge/src/utils/normalizeAdresse.ts 13–17 IMPORTANT Redundant null-checks inside already-guarded branch
frontend-usagers/…/listeSejours.vue 175–180 IMPORTANT values cast to Record<string, any> defeats the purpose of the typed useForm<SejourFormValues>
frontend-usagers/…/typeDeficiences.vue 51–64 IMPORTANT validationObligatoire prop declared but never used — dead code
frontend-usagers/…/tranchesAge.vue 49–62 IMPORTANT Same requiredUnlessBrouillon wrapper is kept for non-BROUILLON statuses, making the BROUILLON branch redundant with the existing helper

Comment thread packages/shared-bridge/src/utils/normalizeAdresse.ts Outdated
Comment thread packages/shared-bridge/src/utils/normalizeAdresse.ts Outdated
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@tokenbureau
Copy link
Copy Markdown

tokenbureau Bot commented Apr 22, 2026

🎉 Deployment for commit 1c47fe8 :

Ingresses
Docker images
  • 📦 docker pull harbor.fabrique.social.gouv.fr/vao/vao/backend:sha-1c47fe8d3ddba47e1eff81978ad7bc90e7ea157a
  • 📦 docker pull harbor.fabrique.social.gouv.fr/vao/vao/cron:sha-1c47fe8d3ddba47e1eff81978ad7bc90e7ea157a
  • 📦 docker pull harbor.fabrique.social.gouv.fr/vao/vao/external-api:sha-1c47fe8d3ddba47e1eff81978ad7bc90e7ea157a
  • 📦 docker pull harbor.fabrique.social.gouv.fr/vao/vao/frontend-bo:sha-1c47fe8d3ddba47e1eff81978ad7bc90e7ea157a
  • 📦 docker pull harbor.fabrique.social.gouv.fr/vao/vao/frontend-usagers:sha-1c47fe8d3ddba47e1eff81978ad7bc90e7ea157a
  • 📦 docker pull harbor.fabrique.social.gouv.fr/vao/vao/migrations:sha-1c47fe8d3ddba47e1eff81978ad7bc90e7ea157a
  • 📦 docker pull maildev/maildev:2.1.0
Debug

@olivier-rabot olivier-rabot self-assigned this Apr 22, 2026
@olivier-rabot olivier-rabot requested a review from l-scherer April 22, 2026 13:53
Copy link
Copy Markdown
Contributor

@l-scherer l-scherer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RAS globalement
Par contre il te faut ajouter des tests sur normalizeAdresse.ts
Créer au moins un normalizeAdresse.spec.ts au même niveau

codeInsee: adresse.codeInsee,
codePostal: adresse.codePostal,
coordinates: coords ?? null,
departement: adresse.departement,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adresse.codeInsee,
adresse.codePostal,
adresse.departement,

sont redondants par rapport à ...adresse,
Tu peux te contenter de retourner ça non ?

  return {
    ...adresse,
    coordinates: coords ?? null,
    lat,
    long,
  };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants