---
suivi: 1398
date: 2026-09-02
sujet: demande_juridique_juriste_notif
chantier: juridique
type: feature
statut: poussé
hash: 4f91c62f
fichiers:
  - app/Http/Controllers/DemandeJuridiqueController.php
  - app/Http/Requests/Juridique/StoreDemandeJuridiqueRequest.php
  - app/Services/DemandeJuridiqueService.php
  - app/Services/Juridique/NotifierDepotDemandeJuridique.php
  - app/Support/Juridique/DemandeJuridiquePresenter.php
  - resources/js/Pages/Juridique/Create.vue
  - tests/Unit/DemandeJuridiqueDepotJuriste1398SourceTest.php
  - database/data/journal_mises_a_jour_post_2026_06_12.php
  - docs/suivi/SUIVI_1398_demande_juridique_juriste_notif.md
---

## PROMPT ENVOYÉ

SUIVI #1398 — select Juriste optionnel au dépôt + notifications Teams (règles Robin). Réutiliser JuristeResolver, juriste_id, TeamsNotificationService, numeroAffichage `#042`. Pas de migration. Pas de touche à affecterJuriste / suiveurs.

## FICHES / ACQUIS #1397

- GS_JURIDIQUE peuplé (2) ; juriste_id existe ; REF = `#` + pad id.

## MAPPING SELECT JURISTE

| Libellé affiché | Valeur postée | Colonne DB | Libellé back |
|-----------------|---------------|------------|--------------|
| Christelle REQUENA | 19 | juriste_id | membre GS_JURIDIQUE |
| Manon KOELH | 29 | juriste_id | membre GS_JURIDIQUE |
| (vide / Non attribué) | absent | juriste_id = NULL | non attribué |

Source : `JuristeResolver::optionsPourSelect()` (`value` = id, `label` = name).

## MOMENT D’ENVOI TEAMS

Appelé dans `DemandeJuridiqueController::store` **après** création + historique, **avant** `redirect()` — donc **avant** la réponse HTTP. Avec `QUEUE_CONNECTION=sync` et timeout 10 s/envoi, jusqu’à ~20 s d’attente perçue si 2 notifs. Non déplacé en after-response (pas de queue async fiable sur OVH CLI / sync).

## SYNTHÈSE

- Create.vue : select optionnel à côté de Programme.
- Store : validation `Rule::in` ids JuristeResolver ; persist `juriste_id`.
- `NotifierDepotDemandeJuridique` : règles tableau Robin ; `m365GroupNames()` brut ; try/catch.
- `numeroAffichage` rendu public sur le presenter.
- `affecterJuriste` / suiveurs / TeamsNotificationService : inchangés.

## DÉPLOIEMENT-TEST

```bash
git pull origin main
php artisan optimize:clear
php artisan view:clear
php artisan journal:sync
```

## LEÇON

- Appartenance GS_JURIDIQUE : jamais `hasM365Group` / Gate pour la logique métier notif (Robin admin = faux positif).
- Accusé au `demandeur_id` enregistré, pas à l’utilisateur connecté (« Changer »).
