package IDevice

package main

type SocketioEvents string

const (
    SystemConnected      SocketioEvents = "FikoYT.uyar.system.connected"
    SocketConnected      SocketioEvents = "FikoYT.uyar.socket.connected"
    DevicesConnected     SocketioEvents = "FikoYT.uyar.devices.connected"
    DevicesInfo          SocketioEvents = "FikoYT.uyar.devices.info"
    DevicesList          SocketioEvents = "FikoYT.uyar.devices.list"
    DevicesCardUpdate    SocketioEvents = "FikoYT.uyar.devices.card.update"
    DevicesSetCardReader SocketioEvents = "FikoYT.uyar.devices.device.setCardReader"
)

type DB string

const (
    DevicesDevice       DB = "FikoYT.uyar.devices.device"
    SystemConnections   DB = "FikoYT.uyar.system.connections"
)

type DeviceTypes string

const (
    CardReader DeviceTypes = "FikoYT Kart Okuyucu"
    Tablet     DeviceTypes = "Tablet"
    PC         DeviceTypes = "Pc"
    Android    DeviceTypes = "Android"
)

type IDevice struct {
    ID    string       `json:"_id,omitempty"` // `_id` olarak maplenmiş
    DB    DB           `json:"db"`
    Date  string       `json:"date,omitempty"`
    Info  *IDeviceInfo `json:"info,omitempty"`
    Data  *IDeviceData `json:"data,omitempty"`
    Other map[string]interface{}
}

type IDeviceInfo struct {
    SocketID      string                 `json:"socketId,omitempty"`
    Sockets       []string               `json:"sockets,omitempty"`
    UUID          string                 `json:"uuid,omitempty"`
    Type          DeviceTypes            `json:"type,omitempty"`
    Name          string                 `json:"name,omitempty"`
    Others        map[string]interface{} `json:"others,omitempty"`
    Settings      *IDeviceSettings       `json:"settings,omitempty"`
    LinkedDevices []string               `json:"linkedDevices,omitempty"`
}

type IDeviceData struct {
    CardID string                 `json:"cardId,omitempty"`
    Other  map[string]interface{} `json:"other,omitempty"`
}

type IDeviceSettings struct {
    Label          string                 `json:"label,omitempty"`
    CardReaderUUID string                 `json:"cardReaderUuid,omitempty"`
    Other          map[string]interface{} `json:"other,omitempty"`
}
