<?php

namespace App\Models;

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

class VerificationLog extends Model
{
    public $timestamps = false;

    protected $fillable = [
        'api_client_id',
        'verification_type',
        'input_parameters',
        'status',
        'provider',
        'response_time_ms',
        'error_message',
        'company_name',
        'charged_amount',
    ];

    protected $casts = [
        'input_parameters' => 'array',
        'charged_amount' => 'float',
    ];

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

    public function aadhaarVerification(): \Illuminate\Database\Eloquent\Relations\HasOne
    {
        return $this->hasOne(AadhaarVerification::class, 'verification_log_id');
    }
}
