package models

import (
	"time"
)

type SystemSetting struct {
	ID        uint      `gorm:"primaryKey" json:"id"`
	Key       string    `gorm:"uniqueIndex;size:100;not null" json:"key"`
	Value     string    `gorm:"type:text" json:"value"`
	UpdatedAt time.Time `json:"updated_at"`
}

func (SystemSetting) TableName() string {
	return "system_settings"
}

type SupplierAuthorization struct {
	ID         uint   `gorm:"primaryKey" json:"id"`
	SupplierID uint   `gorm:"index;not null" json:"supplier_id"`
	Type       string `gorm:"size:20;not null" json:"type"`
	RefID      uint   `gorm:"not null" json:"ref_id"`
}

func (SupplierAuthorization) TableName() string {
	return "supplier_authorizations"
}

const (
	AuthTypeCategory = "category"
	AuthTypeProduct  = "product"
)
