<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class CampaignBrief extends Model
{
    protected $table = 'campaign_briefs';
    public $incrementing = false;
    protected $keyType = 'string';

    protected $fillable = [
        'id', 'campaign_id', 'product_name', 'product_type', 'form_shape',
        'material', 'color', 'size', 'price', 'target_audience', 'category',
        'video_type', 'video_goal', 'shop_handle', 'koc_voucher_code',
        'product_link', 'product_hashtags', 'category_hashtags', 'product_image_url',
        'talks', 'guidelines', 'hooks', 'ctas', 'notes_json'
    ];

    protected $casts = [
        'price' => 'integer',
        'talks' => 'json',
        'guidelines' => 'json',
        'hooks' => 'json',
        'ctas' => 'json',
        'notes_json' => 'json',
        'created_at' => 'datetime',
        'updated_at' => 'datetime'
    ];

    // Quan hệ tới Campaign
    public function campaign()
    {
        return $this->belongsTo(Campaign::class, 'campaign_id', 'id');
    }
}
