<?php

namespace App\Domains\Invoice\Actions\CreateInvoice;

use App\Models\CostUnit;
use App\ValueObjects\InvoiceFile;

class CreateInvoiceRequest {
    public CostUnit $costUnit;
    public string $contactName;
    public ?string $contactEmail;
    public ?string $contactPhone;
    public ?string $accountOwner;
    public ?string $accountIban;
    public string $invoiceType;
    public ?string $invoiceTypeExtended;
    public ?string $travelRoute;
    public ?int $distance;
    public ?int $passengers;
    public ?int $transportations;
    public ?InvoiceFile $receiptFile;
    public float $totalAmount;
    public bool $isDonation;
    public ?int $userId;
    public ?string $travelReason;
    public ?string $paymentPurpose;
    public ?string $notices;


    public function __construct(
        CostUnit $costUnit,
        string $contactName,
        string $invoiceType,
        float $totalAmount,
        ?InvoiceFile $receiptFile,
        bool $isDonation,
        ?int $userId = null,
        ?string $contactEmail = null,
        ?string $contactPhone = null,
        ?string $accountOwner = null,
        ?string $accountIban = null,
        ?string $invoiceTypeExtended = null,
        ?string $travelRoute = null,
        ?int $distance = null,
        ?int $passengers = null,
        ?int $transportations,
        ?string $travelReason = null,
        ?string $paymentPurpose = null,
        ?string $notices = null,

    ) {
        $this->costUnit = $costUnit;
        $this->contactName = $contactName;
        $this->invoiceType = $invoiceType;
        $this->invoiceTypeExtended = $invoiceTypeExtended;
        $this->travelRoute = $travelRoute;
        $this->distance = $distance;
        $this->passengers = $passengers;
        $this->transportations = $transportations;
        $this->receiptFile = $receiptFile;
        $this->contactEmail = $contactEmail;
        $this->contactPhone = $contactPhone;
        $this->accountOwner = $accountOwner;
        $this->accountIban = $accountIban;
        $this->totalAmount = $totalAmount;
        $this->isDonation = $isDonation;
        $this->userId = $userId;
        $this->travelReason = $travelReason;
        $this->paymentPurpose = $paymentPurpose;
        $this->notices = $notices;

        if ($accountIban === 'undefined') {
            $this->accountIban = null;
            $this->accountOwner = null;
        }
    }

}
