#pragma once

#include <string>

namespace softbus::registry {

struct PointTableEntry {
    std::string deviceId;
    std::string pointId;
    std::string name;
    std::string displayName;
    std::string objectRef;
    std::string signalType;
    std::string physicalChannel;
    std::string unit;
    double minValue{0.0};
    double maxValue{100.0};
    std::string access{"read"};
    bool writable{false};
    int registerAddress{0};
    double scale{1.0};
    std::string opcuaNodeId;
    std::string cmdTopic;
    std::string ackTopic;
    std::string dataTopic;
};

struct TopicRules {
    std::string data{"data/{deviceId}/{pointId}"};
    std::string command{"control/cmd/{deviceId}/{pointId}/set"};
    std::string ack{"control/ack/{deviceId}/{pointId}"};
    std::string event{"event/{deviceId}/{eventType}"};
    std::string heartbeat{"system/heartbeat/{deviceId}"};

    std::string formatData(const std::string& deviceId, const std::string& pointId) const;
    std::string formatCommand(const std::string& deviceId, const std::string& pointId) const;
    std::string formatAck(const std::string& deviceId, const std::string& pointId) const;
    std::string formatHeartbeat(const std::string& deviceId) const;
};

} // namespace softbus::registry
