package models

import (
	"time"

	"gorm.io/gorm"
)

type Banner struct {
	ID        uint           `gorm:"primaryKey" json:"id"`
	Title     string         `gorm:"size:100;not null" json:"title"`
	Desc      string         `gorm:"size:200" json:"desc"`
	Image     string         `gorm:"size:500;not null" json:"image"`
	Link      string         `gorm:"size:200" json:"link"`
	Button    string         `gorm:"size:50" json:"button"`
	BgColor   string         `gorm:"size:50" json:"bg_color"`
	SortOrder int            `gorm:"default:0" json:"sort_order"`
	IsActive  bool           `gorm:"default:true" json:"is_active"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}

func (Banner) TableName() string {
	return "banners"
}
