-- TRAIL DPS 4.2 - LOT 11.17
-- Verification non destructive apres consolidation source OVH usage licence
-- A executer dans la base licence OVH si besoin de controle.

SELECT
    id,
    license_id,
    event_type,
    payload_json,
    created_at
FROM license_audit_log
WHERE license_id = 1
ORDER BY id DESC
LIMIT 10;

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;

-- Le prochain check PLACE doit contenir dans license_audit_log :
-- server_code_version = lot-11.17-ovh-source-consolidated
-- local_usage_received = true
-- local_usage_persisted = true
--
-- Et dans license_usage_stats :
-- source = PLACE_LICENSE_CHECK
