fix: rendre un animal adopté indisponible

This commit is contained in:
Alexandre NOEL 2026-09-15 15:58:30 +02:00
commit b8abaa8440
7 changed files with 42 additions and 9 deletions

View file

@ -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,