package models

type Category struct {
	ID           uint   `gorm:"primaryKey;autoIncrement" json:"id"`
	Code         string `gorm:"size:20;uniqueIndex;not null" json:"code"`
	Name         string `gorm:"size:100;not null" json:"name"`
	NameRu       string `gorm:"size:100" json:"name_ru"`
	DisplayOrder int    `gorm:"default:0" json:"display_order"`
	IsRequired   bool   `gorm:"default:false" json:"is_required"`
}

func (Category) TableName() string {
	return "qt_categories"
}

// DefaultCategories defines the standard categories with display order
// Order: BB, CPU, MEM, GPU, SSD, RAID, HBA, NIC, PSU, RISERS, ACC, and others
var DefaultCategories = []Category{
	{Code: "BB", Name: "Barebone", NameRu: "Шасси", DisplayOrder: 1, IsRequired: true},
	{Code: "CPU", Name: "Processor", NameRu: "Процессор", DisplayOrder: 2, IsRequired: true},
	{Code: "MEM", Name: "Memory", NameRu: "Оперативная память", DisplayOrder: 3, IsRequired: true},
	{Code: "GPU", Name: "Graphics Card", NameRu: "Видеокарта", DisplayOrder: 4},
	{Code: "SSD", Name: "SSD Storage", NameRu: "SSD накопитель", DisplayOrder: 5},
	{Code: "RAID", Name: "RAID Controller", NameRu: "RAID контроллер", DisplayOrder: 6},
	{Code: "HBA", Name: "HBA Adapter", NameRu: "HBA адаптер", DisplayOrder: 7},
	{Code: "NIC", Name: "Network Card", NameRu: "Сетевая карта", DisplayOrder: 8},
	{Code: "PSU", Name: "Power Supply", NameRu: "Блок питания", DisplayOrder: 9},
	{Code: "RISERS", Name: "Risers", NameRu: "Райзеры", DisplayOrder: 10},
	{Code: "ACC", Name: "Accessories", NameRu: "Аксессуары", DisplayOrder: 11},
	// Additional categories
	{Code: "MB", Name: "Motherboard", NameRu: "Материнская плата", DisplayOrder: 12},
	{Code: "HDD", Name: "HDD Storage", NameRu: "HDD накопитель", DisplayOrder: 13},
	{Code: "HCA", Name: "HCA Adapter", NameRu: "HCA адаптер", DisplayOrder: 14},
	{Code: "DPU", Name: "DPU", NameRu: "DPU", DisplayOrder: 15},
	{Code: "M2", Name: "M.2 Storage", NameRu: "M.2 накопитель", DisplayOrder: 16},
	{Code: "EDSFF", Name: "EDSFF Storage", NameRu: "EDSFF накопитель", DisplayOrder: 17},
	{Code: "HHHL", Name: "HHHL Storage", NameRu: "HHHL накопитель", DisplayOrder: 18},
	{Code: "PS", Name: "Power Supply (Legacy)", NameRu: "Блок питания", DisplayOrder: 19},
	{Code: "CARD", Name: "Cards", NameRu: "Карты", DisplayOrder: 20},
}

// MaxKnownDisplayOrder is the highest display order for known categories
// New categories will get display order starting from this + 1
const MaxKnownDisplayOrder = 100
