<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class PayFastDebugLog extends Model
{
    protected $table = 'payfast_debug_logs';
    protected $fillable = [
        'user_id',
        'invoice_id',
        'account_credit_deposit_id',
        'basket_id',
        'driver',
        'mode',
        'stage',
        'endpoint',
        'http_method',
        'context_payload',
        'request_payload',
        'response_payload',
        'response_headers',
        'http_status',
        'success',
        'duration_ms',
        'exception_class',
        'error_message',
        'request_ip',
        'user_agent',
    ];

    protected function casts(): array
    {
        return [
            'http_status' => 'integer',
            'success' => 'boolean',
            'duration_ms' => 'integer',
        ];
    }
}
