package article_category_details

import (
	entity "netidhub-saas-be/app/database/entity"
	"time"

	"github.com/google/uuid"
)

type ArticleCategoryDetails struct {
	ID         uint                      `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
	ArticleId  uint                      `json:"article_id" gorm:"type:int4"`
	CategoryId int                       `json:"category_id" gorm:"type:int4"`
	Category   *entity.ArticleCategories `json:"category" gorm:"foreignKey:CategoryId;references:ID"`
	ClientId   *uuid.UUID                `json:"client_id" gorm:"type:UUID"`
	IsActive   bool                      `json:"is_active" gorm:"type:bool"`
	CreatedAt  time.Time                 `json:"created_at" gorm:"default:now()"`
	UpdatedAt  time.Time                 `json:"updated_at" gorm:"default:now()"`

	// Relations
	Article entity.Articles `json:"article" gorm:"foreignKey:ArticleId;constraint:OnDelete:CASCADE"`
}
