<?php

namespace App\Services\Wallet;

/**
 * 主站 balance 探测结果（后台联调检测用，含诊断信息）。
 */
final readonly class MainSiteWalletBalanceProbeResult
{
    public function __construct(
        public bool $success,
        public ?int $mainBalanceMinor,
        public string $currencyCode,
        public string $requestUrl,
        public ?int $httpStatus,
        public ?string $message,
        public ?array $responseBody,
    ) {}

    /**
     * @return array<string, mixed>
     */
    public function toArray(): array
    {
        return [
            'success' => $this->success,
            'main_balance_minor' => $this->mainBalanceMinor,
            'currency_code' => $this->currencyCode,
            'request_url' => $this->requestUrl,
            'http_status' => $this->httpStatus,
            'message' => $this->message,
            'response_preview' => $this->responseBody,
        ];
    }
}
