<?php

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

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

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

    public function __construct(protected readonly string $phoneNumber)
    {
        //
    }

    protected function defaultBody(): array
    {
        return [
            'phoneNumber' => $this->phoneNumber,
            'senderId' => env('BULKCLIX_SENDER_ID'),
            'message' => "DO NOT SHARE THIS CODE. We will not ask for your OTP code. Your OTP code is <%otp_code%>",
            'expiry' => 5,
            'length' => 6,
        ];
    }


    /**
     * The endpoint for the request
     */
    public function resolveEndpoint(): string
    {
        return '/sms-api/otp/send';
    }
}