<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Service extends Model
{
    protected $fillable = [
        'name',
        'code',
        'type',
        'commission_rate',
        'is_active',
    ];

    protected function casts(): array
    {
        return [
            'commission_rate' => 'decimal:2',
            'is_active' => 'boolean',
        ];
    }

    public const TYPE_SHAM_CASH = 'sham_cash';
    public const TYPE_USERS = 'users';
    public const TYPE_COMPANIES = 'companies';
    public const TYPE_FUNDS = 'funds';
    public const TYPE_INTERNAL_COMPANIES = 'internal_companies';

    public static function getTypes(): array
    {
        return [
            self::TYPE_SHAM_CASH => 'حوالات شام كاش',
            self::TYPE_USERS => 'حوالات يوزرات',
            self::TYPE_COMPANIES => 'ايداعات شركات',
            self::TYPE_FUNDS => 'صناديق',
            self::TYPE_INTERNAL_COMPANIES => 'حوالات شركات داخلية',
        ];
    }
}
