package entity

import (
	"time"

	"gorm.io/gorm"
)

type CampaignDestinationRelations 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"`
	DestinationID   uint                 `json:"destination_id" gorm:"type:int4"`
	Destination     CampaignDestinations `json:"destination" gorm:"foreignKey:DestinationID;references:ID"`
	ScheduledAt     *time.Time           `json:"scheduled_at" gorm:"type:timestamp"`
	PublishStatus   string               `json:"publish_status" gorm:"type:varchar(20);default:'pending'"` // pending, success, failed
	PublishResponse *string              `json:"publish_response" gorm:"type:text"`
	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()"`
	DeletedAt       gorm.DeletedAt       `json:"deleted_at" gorm:"index"`
}
