package models

import "gorm.io/gorm"

// CompetitionAlias allows renaming competitions site-wide by FACR code
// Example: code "A1A" -> alias "Krajský přebor"
// The API continues to return original codes; frontend/admin can map to aliases.
type CompetitionAlias struct {
	gorm.Model
	Code         string `gorm:"uniqueIndex;not null" json:"code"`   // FACR competition code, e.g. A1A
	Alias        string `gorm:"not null" json:"alias"`              // Display name used in UI
	OriginalName string `json:"original_name"`                        // Optional: last seen original name
	DisplayOrder int    `json:"display_order"`                        // Custom sort order (lower = higher priority)
}

func (CompetitionAlias) TableName() string { return "competition_aliases" }
