declare namespace MasterModel {
  interface SearchLogPaginationBody extends SearchPaginationBody {
    from?: number;
    to?: number;
    publisher?: string;
    subtopic?: string;
  }

  interface MessageBasicInfo {
    channel?: string;
    subtopic?: string;
    publisher?: string;
    protocol?: string;
    name?: string;
    time?: number;
  }

  type LogTypeRequest = 'user_logs' | undefined;

  interface MesageReaderResponse<T = MessageDataType> {
    offset?: number;
    limit?: number;
    publisher?: string;
    from?: number;
    to?: number;
    format?: string;
    total?: number;
    messages?: Message<T>[];
  }

  // Response types cho từng domain
  type AlarmMessageResponse = MesageReaderResponse<Alarm>;
  type NodeConfigMessageResponse = MesageReaderResponse<NodeConfig[]>;

  type MessageDataType = NodeConfig[];

  interface Message<T = MessageDataType> extends MessageBasicInfo {
    string_value?: string;
    string_value_parsed?: T;
  }

  // Message types cho từng domain
  type NodeConfigMessage = Message<NodeConfig[]>;

  interface Alarm {
    id: string;
    type: Type;
    name: string;
  }

  interface SensorLogMessage extends MessageBasicInfo {
    unit: string;
    value: number;
  }
}
