package model

import (
	"time"

	"gorm.io/gorm"
)

type Device struct {
	gorm.Model
	UID          string    `gorm:"uniqueIndex" json:"uid"`
	IPPort       string    `json:"ip_port"`
	ChipID       string    `json:"chip_id"`
	DeviceType   string    `json:"device_type"`
	DeviceModel  string    `json:"device_model"`
	Company      string    `json:"company"`
	RegisterTime time.Time `json:"register_time"`
	ExpireTime   time.Time `json:"expire_time"`
	LicenseType  string    `json:"license_type"`
	StartCount   int       `json:"start_count"`
	Status       string    `json:"status"`
	LicenseCode  string    `json:"license_code"`
	MaxUses      int       `json:"max_uses"`
	Duration     int       `json:"duration"`
	LastActiveAt time.Time `json:"last_active_at"`
}

type User struct {
	gorm.Model
	Username  string    `gorm:"uniqueIndex" json:"username"`
	Password  string    `json:"-"`
	Email     string    `gorm:"uniqueIndex" json:"email"`
	Role      string    `json:"role"`
	LastLogin time.Time `json:"last_login"`
}
