Adds local System Name persistence (trimmed, 1-40) in system_kv, an
injectable sync module with conflict/invalid revert and a pending-sync
flag, a background SystemNameSync worker (retries on boot and on a timer),
and api_client support for PUT /licenses/{key}/system-name plus the
additive systemName field/systemNameStatus on license validation. The
license service sends the stored name and applies the status. Covers
validation, pending retry, and conflict revert with a faked HTTP layer.
32 lines
1.4 KiB
C++
32 lines
1.4 KiB
C++
#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 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
|