package entity

import (
	users "campaign-pool-be/app/database/entity/users"
	"time"

	"gorm.io/gorm"
)

type CampaignApprovals struct {
	ID         uint           `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
	CampaignID uint           `json:"campaign_id" gorm:"type:int4"`
	Campaign   Campaigns      `json:"campaign" gorm:"foreignKey:CampaignID;references:ID"`
	ApproverID uint           `json:"approver_id" gorm:"type:int4"`
	Approver   users.Users    `json:"approver" gorm:"foreignKey:ApproverID;references:ID"`
	Status     string         `json:"status" gorm:"type:varchar(20);default:'pending'"` // pending, approved, rejected
	Notes      *string        `json:"notes" gorm:"type:text"`
	IsActive   *bool          `json:"is_active" gorm:"type:bool;default:true"`
	CreatedAt  time.Time      `json:"created_at" gorm:"default:now()"`
	DeletedAt  gorm.DeletedAt `json:"deleted_at" gorm:"index"`
}
