<?php

declare(strict_types=1);

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class ReportRationWeekly extends Model
{
    protected $table = 'report_ration_weekly';

    protected $guarded = ['id', 'created_at', 'updated_at'];

    protected $casts = [
        'is_active' => 'boolean',
        'day_of_week' => 'integer',
    ];

    public const STATUS_NORMAL = 'normal';
    public const STATUS_INCREASE = 'increase';
    public const STATUS_DECREASE = 'decrease';
    public const STATUS_FAST = 'fast';

    public static function statusOptions(): array
    {
        return [
            self::STATUS_NORMAL => 'عادی',
            self::STATUS_INCREASE => 'افزایش',
            self::STATUS_DECREASE => 'کاهش',
            self::STATUS_FAST => 'روزه',
        ];
    }

    public static function dayNames(): array
    {
        return [
            1 => 'شنبه',
            2 => 'یکشنبه',
            3 => 'دوشنبه',
            4 => 'سه‌شنبه',
            5 => 'چهارشنبه',
            6 => 'پنجشنبه',
            7 => 'جمعه',
        ];
    }

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