#pragma once // In-memory pairing store - trivial port of src/pairing.js #include #include #include struct PairingEntry { std::string code; std::string name; uint64_t created_at; }; struct DeviceEntry { std::string name; std::string token; uint64_t created_at; }; class PairingStore { public: void set_pairing_code(const std::string& code, const std::string& name = "JTL-POS"); void revoke_pairing_code(const std::string& code); bool has_pairing_code(const std::string& code) const; void register_device(const std::string& token, const std::string& name = "JTL-POS"); const std::unordered_map& get_paired_devices() const; private: std::unordered_map auth_codes_; std::unordered_map paired_devices_; };