package entity

import (
	"time"

	"github.com/google/uuid"
)

// CmsContentSubmission stores pending Content Website changes until an approver applies them.
type CmsContentSubmission struct {
	ID              uuid.UUID `json:"id" gorm:"type:uuid;primaryKey"`
	ClientID        uuid.UUID `json:"client_id" gorm:"type:uuid;index"`
	Domain          string    `json:"domain" gorm:"size:32;index"`
	Title           string    `json:"title" gorm:"size:512"`
	Status          string    `json:"status" gorm:"size:24;index"` // pending | approved | rejected
	Payload         string    `json:"payload" gorm:"type:text"` // JSON
	SubmittedByID   uint      `json:"submitted_by_id" gorm:"index"`
	ReviewedByID    *uint     `json:"reviewed_by_id"`
	ReviewNote      string    `json:"review_note" gorm:"size:512"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
}

func (CmsContentSubmission) TableName() string {
	return "cms_content_submissions"
}
