-- LOT 11.15 - controles non destructifs apres deploiement
-- 1) Verifier que le prochain check charge bien le code serveur 11.15.
SELECT id, license_id, event_type, payload_json, created_at
FROM license_audit_log
WHERE license_id = 1
ORDER BY id DESC
LIMIT 10;

-- Attendu dans payload_json apres ouverture PLACE :
-- server_code_version = lot-11.15-ovh-src-complete-persist
-- client_version = lot-11.15-place-usage-payload
-- local_usage_received = true
-- local_usage_persisted = true

-- 2) Verifier la persistance de l'usage PLACE.
SELECT id, license_id, computed_at, rolling_365_course_count, sms_sent_count,
       active_events_count, active_runs_count, source, details_json, created_at
FROM license_usage_stats
WHERE license_id = 1
ORDER BY id DESC
LIMIT 10;

-- Attendu : une ligne source = PLACE_LICENSE_CHECK avec les compteurs PLACE.
