<?php

namespace App\Models\Claim;

use App\Trait\BelongsToSolicitor;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class BankDetail extends Model {
    protected $fillable = [
        'solicitor_id',
        'claim_id',
        'name_on_account',
        'sort_code',
        'account_number',
        'reference_number',
        'bic_swift',
        'clearing_code',
        'iban',
    ];

    protected $casts = [
        'name_on_account' => 'encrypted',
        'sort_code' => 'encrypted',
        'account_number' => 'encrypted',
        'reference_number' => 'encrypted',
        'bic_swift' => 'encrypted',
        'clearing_code' => 'encrypted',
        'iban' => 'encrypted',
    ];

    use BelongsToSolicitor;

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