<?php

namespace App\Http\Controllers\Owner\CommercialInvoice\Dto;

use App\Modules\CommercialInvoice\Domain\CommercialInvoiceStatus;
use App\Modules\CommercialInvoice\Domain\CommercialInvoiceType;

class CommercialInvoiceInsertDTO
{

    public static function validateData()
    {
        return [
            'CommercialInvoice_IssueDate' => 'nullable|date',
            'CommercialInvoice_CodeReservation' => 'nullable|string|max:50',
            'CommercialInvoice_NumberSerie' => 'required|string|max:50',
            'CommercialInvoice_Type' => 'required|in:' . implode(',', CommercialInvoiceType::values()),
            'CommercialInvoice_AmountWithoutIgv' => 'nullable|numeric',
            'CommercialInvoice_AmountWithIgv' => 'nullable|numeric',
            'CommercialInvoice_Status' => 'in:' . implode(',', CommercialInvoiceStatus::validValues()),
            'Id_BookingUpgradePassenger' => 'nullable|int',
            'Id_BookingExtraPassenger' => 'nullable|int',
            'Id_Booking' => 'nullable|int',
        ];
    }

    public function __construct(
        public ?string $CommercialInvoice_IssueDate = null,
        public ?string $CommercialInvoice_CodeReservation = null,
        public ?string $CommercialInvoice_NumberSerie = null,
        public ?int $CommercialInvoice_Type = null,
        public ?float $CommercialInvoice_AmountWithoutIgv = null,
        public ?float $CommercialInvoice_AmountWithIgv = null,
        public ?int $CommercialInvoice_Status = null,
        public ?int $Id_BookingUpgradePassenger = null,
        public ?int $Id_BookingExtraPassenger = null,
        public ?int $Id_Booking = null,
    ) {}
}
