<?php

namespace App\Models\Meal;

use App\Models\Crm\Customer;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class MealReview extends Model
{
    const UPDATED_AT = null;

    protected $fillable = [
        'daily_meal_plan_id', 'customer_id', 'score', 'content',
    ];

    protected function casts(): array
    {
        return [
            'score' => 'integer',
        ];
    }

    public function mealPlan(): BelongsTo
    {
        return $this->belongsTo(DailyMealPlan::class, 'daily_meal_plan_id');
    }

    public function customer(): BelongsTo
    {
        return $this->belongsTo(Customer::class);
    }
}
