<?php

namespace App\Http\Integrations\Imake\Requests\iShareGhana;

use Saloon\Contracts\Body\HasBody;
use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\Traits\Body\HasJsonBody;

class ShareBundle extends Request implements HasBody
{
    use HasJsonBody;
    /**
     * The HTTP method of the request
     */
    protected Method $method = Method::POST;

    public function __construct(protected readonly string $recipient_number, protected readonly string $gig, protected readonly string $reference_id)
    {
        //
    }

    /**
     * The endpoint for the request
     */
    protected function defaultBody(): array
    {
        return [
            'agent_api' => env('ISHARE_API_KEY'),
            'recipient_number' => $this->recipient_number,
            'network' => 'AT',
            'gig' => $this->gig,
            'reference_id' => $this->reference_id,
        ];
    }

    public function resolveEndpoint(): string
    {
        return '/transaction.php';
    }
}
