<?php

namespace App\DTOs;

class VirtualAccountDto
{
    public bool $status;
    public string $message;
    public ?array $data;

    private function __construct(bool $status, string $message, ?array $data = null)
    {
        $this->status = $status;
        $this->message = $message;
        $this->data = $data;
    }

    public static function success(array $accounts, string $reservationReference, string $reservedAccountType): self
    {
        return new self(
            true,
            'Success',
            [
                'accounts' => $accounts,
                'reservationReference' => $reservationReference,
                'reservedAccountType' => $reservedAccountType,
            ]
        );
    }

    public static function failure(string $message): self
    {
        return new self(false, $message, null);
    }
}
