From b8abaa844070e36e549a37372c7ccb4525e20e84 Mon Sep 17 00:00:00 2001 From: oversu <95a7002b-481b-4ef3-b578-f9c421550aa4@localhost> Date: Tue, 15 Sep 2026 15:58:30 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20rendre=20un=20animal=20adopt=C3=A9=20ind?= =?UTF-8?q?isponible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 +++++++++ HISTORIQUE.md | 4 ++++ README.md | 2 +- VERSION | 2 +- app/Services/AdoptionService.php | 5 +++++ app/Views/evolutions.php | 8 ++++---- tests/run.php | 21 ++++++++++++++++++--- 7 files changed, 42 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a4a30a..85b35b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ Toutes les modifications importantes du projet sont consignées ici. Le format s’inspire de [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/) et le projet suit le [versionnage sémantique](https://semver.org/lang/fr/). +## [1.0.0-rc.22] — 2026-09-15 + +### Disponibilité après adoption + +- passage automatique de la disponibilité à « Indisponible » lorsqu’une adoption est finalisée ; +- suppression de l’ancienne date de disponibilité et ajout du motif « Animal adopté » ; +- correction de l’écriture de l’événement correspondant dans l’historique des bases existantes ; +- ajout d’un test couvrant l’ensemble du parcours d’adoption et cette règle métier. + ## [1.0.0-rc.21] — 2026-09-15 ### Suivi de la température diff --git a/HISTORIQUE.md b/HISTORIQUE.md index e2934d6..16a2e1b 100644 --- a/HISTORIQUE.md +++ b/HISTORIQUE.md @@ -93,3 +93,7 @@ Simplification des lieux affichés dans la fiche, conservation de l’adresse ac ## `1.0.0-rc.21` — Température pendant les tournées Ajout d’une température préremplie à 38,5 °C lors du contrôle de chaque animal et affichage conjoint des courbes de poids et de température dans son dossier médical. + +## `1.0.0-rc.22` — Disponibilité après adoption + +Une adoption finalisée rend désormais automatiquement l’animal indisponible à l’adoption afin que son état administratif et sa visibilité restent cohérents. diff --git a/README.md b/README.md index 45914f2..fd19de9 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ L’option `--apply` ne doit être utilisée qu’après lecture des rapports. L ## État du projet -La candidate actuelle est `1.0.0-rc.21`. La branche 1.0 est gelée fonctionnellement : seuls les défauts bloquants découverts pendant les validations terrain sont corrigés avant `1.0.0`. +La candidate actuelle est `1.0.0-rc.22`. La branche 1.0 est gelée fonctionnellement : seuls les défauts bloquants découverts pendant les validations terrain sont corrigés avant `1.0.0`. Le contrôle de stabilisation est disponible dans [docs/AUDIT-1.0.md](docs/AUDIT-1.0.md). diff --git a/VERSION b/VERSION index fee2ed6..49eb7f4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0-rc.21 +1.0.0-rc.22 diff --git a/app/Services/AdoptionService.php b/app/Services/AdoptionService.php index 5b1b8a5..55d35f0 100644 --- a/app/Services/AdoptionService.php +++ b/app/Services/AdoptionService.php @@ -99,6 +99,9 @@ class AdoptionService UPDATE animals SET status = 'adopte', + adoption_availability = 'not_available', + adoption_available_from = NULL, + adoption_unavailability_reason = 'Animal adopté', refuge_room = NULL, care_box_key = NULL, updated_at = CURRENT_TIMESTAMP, @@ -162,6 +165,7 @@ class AdoptionService $stmt = $db->prepare(" INSERT INTO animal_history ( animal_id, + action, type, label, details, @@ -170,6 +174,7 @@ class AdoptionService ) VALUES ( :animal_id, 'adoption', + 'adoption', 'Adoption finalisée', :details, :user_id, diff --git a/app/Views/evolutions.php b/app/Views/evolutions.php index a0e2506..5ed43da 100644 --- a/app/Views/evolutions.php +++ b/app/Views/evolutions.php @@ -31,10 +31,10 @@
Température proposée à 38,5 °C pendant chaque contrôle et graphique médical - commun pour suivre son évolution avec celle du poids.
+ 1.0.0-rc.22 +Une adoption finalisée rend automatiquement l’animal indisponible afin de + conserver un état administratif cohérent.