<?php

namespace App\Models\Claim;

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

class ImpactFactors extends Model {
    protected $fillable = [
        'solicitor_id',
        'claim_id',
        'has_received_relevant_payment',
        'has_criminal_conviction',
        'payment_date',
        'paying_organisation',
        'payment_amount',
    ];

    protected $casts = [
        'has_received_relevant_payment' => 'boolean',
        'has_criminal_conviction' => 'boolean',
        'payment_date' => 'date',
    ];

    use BelongsToSolicitor;

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