<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class PointSetting extends Model
{
    protected $fillable = [
        'egp_per_point',
        'point_value_in_egp',
    ];

    protected function casts(): array
    {
        return [
            'egp_per_point' => 'decimal:2',
            'point_value_in_egp' => 'decimal:2',
        ];
    }

    public static function current(): self
    {
        return static::first() ?? new static([
            'egp_per_point' => 10,
            'point_value_in_egp' => 1,
        ]);
    }
}
