#pragma once namespace radiantwave::db { // Canonical system_kv keys. These are the single source of truth for where // device configuration lives in the local database. constexpr const char* KV_EMAIL_ADDRESS = "email_address"; constexpr const char* KV_LICENSE_KEY = "license_key"; // Unix epoch seconds of the last successful license validation against the // portal. Used to grant a 7-day offline grace window so transient network // outages do not revoke a known-good license. constexpr const char* KV_LICENSE_LAST_VERIFIED = "license_last_verified"; // The license key/email pair the most recent completed check used, and its // outcome ("valid"/"invalid"). An invalid pair is not re-checked until one of // the two stored values changes, so a slow device does not hammer the portal. constexpr const char* KV_LICENSE_CHECKED_KEY = "license_checked_key"; constexpr const char* KV_LICENSE_CHECKED_EMAIL = "license_checked_email"; constexpr const char* KV_LICENSE_CHECK_STATUS = "license_check_status"; // Unix epoch seconds of the last license check attempt (success or failure). // Anchors the hourly re-check of a valid license; an overdue check runs // immediately on the next boot instead of waiting a fresh hour. constexpr const char* KV_LICENSE_LAST_CHECK = "license_last_check"; // The System Name the user typed on the Kiosk (trimmed). A human-readable label // set only here; never a reference or key. constexpr const char* KV_SYSTEM_NAME = "system_name"; // The last System Name the server accepted. Used to revert a local change when // the server reports a conflict or invalid value. constexpr const char* KV_SYSTEM_NAME_SYNCED = "system_name_synced"; // "1" while the local System Name still needs to be sent to the portal (e.g. // the license is not validated yet, or a previous sync failed). constexpr const char* KV_SYSTEM_NAME_PENDING = "system_name_pending_sync"; // The most recent System Name status message to show the user (e.g. a conflict // message after a background sync). Cleared once consumed/acknowledged. constexpr const char* KV_SYSTEM_NAME_MESSAGE = "system_name_message"; } // namespace radiantwave::db