<?php

namespace WeeConnectPay\Api\Requests;

use WeeConnectPay\Dependencies\Psr\Http\Message\ResponseInterface;
use WeeConnectPay\Api\ApiClient;

/**
 * API request class for printing Clover orders via WeeConnect API
 * 
 * This class provides a "best effort" printing service that attempts to send
 * print requests to the merchant's default Clover printer through the WeeConnect API.
 * All failures are logged but do not interrupt order processing.
 */
class PrintCloverOrderRequest extends ApiClient {

    /**
     * Send a print request for a Clover order
     * 
     * @param string $cloverOrderUuid The UUID of the Clover order to print
     * @return ResponseInterface
     */
    public function POST(string $cloverOrderUuid): ResponseInterface {
        return $this->client->post(
            "/v1/clover/orders/{$cloverOrderUuid}/print",
            self::setOptions()
        );
    }

    /**
     * Set request options with timeout and empty JSON body
     * 
     * @return array
     */
    private static function setOptions(): array {
        return [
            'timeout' => 30, // 30-second timeout as specified
            'json' => [], // Empty JSON object as specified in requirements
        ];
    }
} 