package entity

import (
	users "campaign-pool-be/app/database/entity/users"
	"time"
	"gorm.io/gorm"
)

type CampaignChats 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"`
	SenderID      uint           `json:"sender_id" gorm:"type:int4"`
	Sender        users.Users    `json:"sender" gorm:"foreignKey:SenderID;references:ID"`
	Message       string         `json:"message" gorm:"type:text"`
	AttachmentURL *string        `json:"attachment_url" 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"`
}

