Recette import desktop siège — source : docs/UAT_Siege_PURCH.md.
Profils : IPM, DFC, Chargé importations, Regulatory. Hors FO / Caissier / Chauffeur.
UAT siège — module achats import (PURCH_)
Recette desktop siège (IPM, DFC, Chargé importations, Regulatory).
Hors périmètre : Front Office, Caissier, application chauffeur — parcours mobile / caisse distincts.
Authentification : POST /api/auth/login → Authorization: Bearer {token}.
1. Chaîne nominale IPO → stock BUS_
| # | Acteur | Action API | Contrôle |
|---|---|---|---|
| 1 | DCM | POST /api/purch/ipos |
IPO créée, statut en attente CEO |
| 2 | CEO | Approbation IPO | Statut approuvé |
| 3 | IPM | POST /api/purch/ipos/{id}/dispatch-email |
dispatched_at renseigné |
| 4 | IPM | Génération PO + PATCH …/commercial-terms |
Incoterm, devise, montant |
| 5 | IPM | POST …/generate-pdf puis POST …/dispatch-email |
PDF PO + e-mail fournisseur |
| 6 | IPM | POST /api/purch/dossiers |
Dossier ouvert, timeline DOSSIER_OPENED |
| 7 | IPM | POST …/proforma + documents |
Checklist fournisseur |
| 8 | RM | POST /api/reg/import-authorizations/dossiers/{id} puis grant |
Autorisation DPVCT |
| 9 | IPM | POST …/phase2 |
PHASE_2_ENTERED |
2. Phase 2 — engagements bancaires & portuaires
| # | Acteur | Endpoint | Événement timeline attendu |
|---|---|---|---|
| 1 | IPM | PATCH …/predom |
PREDOM_SUBMITTED |
| 2 | IPM | POST …/ok-embarquement |
OK_EMBARQUEMENT_GRANTED |
| 3 | Chargé import. | PATCH …/originaux (expédition puis réception) |
ORIGINAUX_DISPATCHED, ORIGINAUX_RECEIVED |
| 4 | Chargé import. | POST …/arrival-notice |
ARRIVAL_NOTICE_RECORDED |
| 5 | DFC | POST …/domiciliation/request |
DOMICILIATION_REQUESTED |
| 6 | DFC | POST …/domiciliation/obtained |
DOMICILIATION_OBTAINED |
Prédom expirée : POST …/predom/renew puis reprise domiciliation.
Consultation jalons : GET …/phase2-milestones et GET …/timeline.
3. Phase 3 → clôture
| # | Acteur | Action | Contrôle |
|---|---|---|---|
| 1 | IPM | POST …/phase3 |
Refus si autorisation REG_ non accordée |
| 2 | IPM / transit | Chèques, C25, coûts | Selon périmètre |
| 3 | IPM | POST …/close |
STOCK_BUS_RECEIVED, dossier CLOTURE |
4. Scénarios négatifs (échantillon)
-
POST …/phase3sans autorisation import → 422 -
POST …/domiciliation/requestavec Prédom expirée → message renouvellement -
PATCH …/predomalors qu'une Prédom existe déjà → 422 (utiliser renew) - Permission refusée → 403
5. Commandes de surveillance
php artisan agrichem:purch-predom-alerts
php artisan agrichem:purch-originaux-alerts
Document portail — /portail/uat-purch-siege. Mai 2026.