<?php

namespace Alsendo\AlsendoWrapper\Model\Order;

use Alsendo\AlsendoWrapper\Api\Ecolet\Model\AdditionalService;
use Alsendo\AlsendoWrapper\Model\Address;
use Alsendo\AlsendoWrapper\Model\Cod;
use Alsendo\AlsendoWrapper\Model\Notification;
use Alsendo\AlsendoWrapper\Model\Pickup;
use Alsendo\AlsendoWrapper\Model\Request;
use Alsendo\AlsendoWrapper\Model\Shipment;

/**
 * Class OrderRequest
 * Represents a model of an order request based on the Alsendo API Model.
 *
 * @package Alsendo\AlsendoWrapper\Model
 *
 * @property int|string $serviceId
 *     The service ID, which can be an integer for Apaczka and Zaslat,
 *     or a string (slug) for Ecolet.
 * @property Address $address
 *     The address associated with the order.
 * @property ?array $option
 *     Optional array of additional options.
 * @property Notification $notification
 *     Notification details for the order.
 * @property int $shipmentValue
 *     The value of the shipment.
 * @property ?Cod $cod
 *     Cash on delivery details, if applicable.
 * @property Pickup $pickup
 *     Pickup details for the order.
 * @property Shipment[] $shipment
 *     Details of the shipment.
 * @property string $comment
 *     Any additional comments for the order.
 * @property string $content
 *     Description of the content being shipped.
 * @property int $isZebra
 *     Indicator for Zebra-related functionality.
 * @property ?string $currency
 *     The currency used for the order.
 * @property ?AdditionalService[] $additionalServices
 *     Additional services applicable only in Ecolet.
 * @property ?int $contractId
 *     The contract ID, applicable only in Ecolet.
 * @property ?string $paymentType
 *     Payment type for Zaslat, applicable only in Zaslat.
 * @property ?string $reference
 *     Self-marking of the consignment, applicable only in Zaslat
 * @property ?string $promoCode
 *     Promo code or voucher, applicable only in Zaslat
 */
class OrderRequest extends Request
{
    public $serviceId;
    public Address $address;
    public ?array $option;
    public Notification $notification;
    public int $shipmentValue;
    public ?Cod $cod = null;
    public Pickup $pickup;
    public array $shipment;
    public ?string $comment = null;
    public ?string $content = null;
    public int $isZebra = 0;
    public ?string $currency = null;
    public ?string $shipmentCurrency = null;

    //Used in Ecolet, Zaslat
    public ?array $additionalServices = null;
    //Only in Zaslat
    public ?string $paymentType = null;
    //Only in Zaslat
    public ?string $carrier = null;
    /**
     * @var string|null $reference
     * Only in Zaslat
     * Optional Field
     */
    public ?string $reference = null;
    /**
     * @var string|null $promoCode
     * Only in Zaslat
     * Promo code or voucher
     */
    public ?string $promoCode = null;


    //Only in Zaslat
    public ?bool $pickupRequest = null;

    /**
     * @var string|null $source
     * Define the source of the order, plugin name, service name, etc.
     * Optional Field
     */
    public ?string $source;
}