<?php

namespace Gaco\SnapBi\Services\Banks\Ocbc\Traits;

use Gaco\SnapBi\Enums\ServiceCode;
use Gaco\SnapBi\Services\VirtualAccountService;
use Gaco\SnapBi\Contracts\ServiceInterface;

/**
 * Trait for Virtual Account services
 * 
 * Provides methods for:
 * - VA Inquiry
 * - VA Payment
 * - Update Status VA
 * - Inquiry Status
 * - Transfer Inquiry/Commit
 * - Notify Payment Intrabank
 */
trait HasVirtualAccount
{
    /**
     * Get Inquiry service
     * 
     * @return ServiceInterface
     */
    public function inquiry(): ServiceInterface
    {
        return new VirtualAccountService(ServiceCode::INQUIRY, $this->config ?? null);
    }

    /**
     * Get Payment service
     * 
     * @return ServiceInterface
     */
    public function payment(): ServiceInterface
    {
        return new VirtualAccountService(ServiceCode::PAYMENT, $this->config ?? null);
    }

    /**
     * Get Update Status VA service
     * 
     * @return ServiceInterface
     */
    public function updateStatusVa(): ServiceInterface
    {
        return new VirtualAccountService(ServiceCode::UPDATE_STATUS_VA, $this->config ?? null);
    }

    /**
     * Get Inquiry Status service
     * 
     * @return ServiceInterface
     */
    public function inquiryStatus(): ServiceInterface
    {
        return new VirtualAccountService(ServiceCode::INQUIRY_STATUS, $this->config ?? null);
    }

    /**
     * Get Transfer service
     * 
     * @return ServiceInterface
     */
    public function transfer(): ServiceInterface
    {
        return new VirtualAccountService(ServiceCode::TRANSFER_INQUIRY, $this->config ?? null);
    }

    /**
     * Get Notify Payment Intrabank service
     * 
     * @return ServiceInterface
     */
    public function notifyPaymentIntrabank(): ServiceInterface
    {
        return new VirtualAccountService(ServiceCode::NOTIF_PAYMENT_INTRABANK, $this->config ?? null);
    }
}
