package entity

import "time"

type Articles struct {
	ID              uint       `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
	Title           string     `json:"title" gorm:"type:varchar"`
	Slug            string     `json:"slug" gorm:"type:varchar"`
	Description     string     `json:"description" gorm:"type:varchar"`
	CategoryId      int        `json:"category_id" gorm:"type:int4"`
	HtmlDescription string     `json:"html_description" gorm:"type:varchar"`
	TypeId          int        `json:"type_id" gorm:"type:int4"`
	Tags            string     `json:"tags" gorm:"type:varchar"`
	ThumbnailName   *string    `json:"thumbnail_name" gorm:"type:varchar"`
	ThumbnailPath   *string    `json:"thumbnail_path" gorm:"type:varchar"`
	PageUrl         *string    `json:"page_url" gorm:"type:varchar"`
	CreatedById     *uint      `json:"created_by_id" gorm:"type:int4"`
	ShareCount      *int       `json:"share_count" gorm:"type:int4"`
	ViewCount       *int       `json:"view_count" gorm:"type:int4"`
	DownloadCount   *int       `json:"download_count" 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"`
	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()"`
}
