package entity

import (
	"time"

	"github.com/google/uuid"
)

type ArticleFiles struct {
	ID            uint       `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
	ArticleId     uint       `json:"article_id" gorm:"type:int4"`
	UploadID      *string    `json:"upload_id" gorm:"type:varchar"`
	FilePath      *string    `json:"file_path" gorm:"type:varchar"`
	FileUrl       *string    `json:"file_url" gorm:"type:varchar"`
	FileName      *string    `json:"file_name" gorm:"type:varchar"`
	FileThumbnail *string    `json:"file_thumbnail" gorm:"type:varchar"`
	FileAlt       *string    `json:"file_alt" gorm:"type:varchar"`
	WidthPixel    *string    `json:"width_pixel" gorm:"type:varchar"`
	HeightPixel   *string    `json:"height_pixel" gorm:"type:varchar"`
	Size          *string    `json:"size" gorm:"type:varchar"`
	DownloadCount *int       `json:"download_count" gorm:"type:int4;default:0"`
	CreatedById   int        `json:"created_by_id" gorm:"type:int4"`
	StatusId      int        `json:"status_id" gorm:"type:int4"`
	IsPublish     *bool      `json:"is_publish" gorm:"type:bool;default:false"`
	PublishedAt   *time.Time `json:"published_at" gorm:"type:timestamp"`
	ClientId      *uuid.UUID `json:"client_id" gorm:"type:UUID"`
	IsActive      bool       `json:"is_active" gorm:"type:bool;default:true"`
	CreatedAt     time.Time  `json:"created_at" gorm:"default:now()"`
	UpdatedAt     time.Time  `json:"updated_at" gorm:"default:now()"`

	// Relations
	Article Articles `json:"article" gorm:"foreignKey:ArticleId"`
}
