<?php

namespace App\Models\Claim;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class BankDetail extends Model {
    protected $fillable = [
        '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',
    ];


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