<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class CostCap extends Model
{
    public const SCOPE_FLEET   = 'fleet';
    public const SCOPE_PURPOSE = 'purpose';

    public const PERIOD_DAY   = 'day';
    public const PERIOD_MONTH = 'month';

    public const ACTION_BLOCK = 'block';
    public const ACTION_WARN  = 'warn';

    protected $fillable = [
        'label', 'scope', 'purpose', 'period', 'amount_usd',
        'action', 'enabled', 'created_by',
    ];

    protected $casts = [
        'amount_usd' => 'decimal:4',
        'enabled'    => 'boolean',
    ];
}
