package models

import (
	"gorm.io/gorm"
)

// Setting model structure
// Stores site-wide metadata and contact information.
type Setting struct {
	gorm.Model
	Title           string `gorm:"type:varchar(254);not null" json:"title" form:"title"`
	MetaTitle       string `gorm:"type:varchar(254);not null" json:"meta_title" form:"meta_title"`
	MetaDescription string `gorm:"type:varchar(254);not null" json:"meta_description" form:"meta_description"`
	Phone           string `gorm:"type:varchar(254);not null" json:"phone" form:"phone"`
	URL             string `gorm:"type:varchar(254);not null" json:"url" form:"url"`
	Email           string `gorm:"type:varchar(254);not null" json:"email" form:"email"`
	Facebook        string `gorm:"type:varchar(254)" json:"facebook,omitempty" form:"facebook"`
	X               string `gorm:"type:varchar(254)" json:"x,omitempty" form:"x"`
	Instagram       string `gorm:"type:varchar(254)" json:"instagram,omitempty" form:"instagram"`
	Whatsapp        string `gorm:"type:varchar(254)" json:"whatsapp,omitempty" form:"whatsapp"`
	Pinterest       string `gorm:"type:varchar(254)" json:"pinterest,omitempty" form:"pinterest"`
	Linkedin        string `gorm:"type:varchar(254)" json:"linkedin,omitempty" form:"linkedin"`
	Slogan          string `gorm:"type:varchar(254)" json:"slogan,omitempty" form:"slogan"`
	Address         string `gorm:"type:text" json:"address,omitempty" form:"address"`
	Copyright       string `gorm:"type:varchar(254)" json:"copyright,omitempty" form:"copyright"`
	MapEmbed        string `gorm:"type:text" json:"map_embed,omitempty" form:"map_embed"`
	WLogo           string `gorm:"type:text" json:"w_logo,omitempty" form:"w_logo"`
	BLogo           string `gorm:"type:text" json:"b_logo,omitempty" form:"b_logo"`
	IsActive        bool   `gorm:"default:false" json:"is_active" form:"is_active"`
}

// TableName overrides the table name used by Setting to `settings`
func (Setting) TableName() string {
	return "settings"
}
