<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class SurveyResponse extends Model
{
    use HasFactory;

    protected $fillable = [
        'lead_id', 'email', 'biz_name', 'biz_type', 'biz_age', 'revenue',
        'channels', 'pain_point',
        'persona_gender', 'persona_age', 'persona_income', 'persona_time', 'persona_why',
        'brand_words', 'brand_voice', 'brand_color', 'brand_statement',
        'has_time', 'has_team', 'marketing_budget',
        'recommended_tier', 'raw_responses', 'completed_at',
        'ai_strategic_diagnosis', 'ai_customer_narrative',
        'ai_action_plan_30day', 'ai_content_ideas',
        'ai_brand_voice_sample', 'ai_status', 'ai_generated_at',
    ];

    protected function casts(): array
    {
        return [
            'channels'             => 'array',
            'brand_words'          => 'array',
            'raw_responses'        => 'array',
            'has_time'             => 'boolean',
            'completed_at'         => 'datetime',
            'ai_action_plan_30day' => 'array',
            'ai_content_ideas'     => 'array',
            'ai_generated_at'      => 'datetime',
        ];
    }

    public function lead() { return $this->belongsTo(Lead::class); }
}
