<?php

namespace App\Models;

use App\Enums\AccountTypeEnum;
use App\Enums\BankAccountTypeEnum;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;

class ProviderPaymentMethod extends Model
{
    use HasFactory, SoftDeletes;

    protected $fillable = [
        'provider_id',
        'account_type',
        'pix_key',
        'bank_account_type',
        'agency',
        'account',
        'digit',
    ];

    protected $casts = [
        'account_type' => AccountTypeEnum::class,
        'bank_account_type' => BankAccountTypeEnum::class,
    ];

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