<?php

/**
 * This file is auto-generated by Saloon SDK Generator
 * Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator
 * Do not modify it directly.
 */

declare(strict_types=1);

namespace SellingPartnerApi\Vendor\InvoicesV1\Dto;

use SellingPartnerApi\Dto;

final class Invoice extends Dto
{
    protected static array $complexArrayTypes = [
        'taxDetails' => TaxDetails::class,
        'additionalDetails' => AdditionalDetails::class,
        'chargeDetails' => ChargeDetails::class,
        'allowanceDetails' => AllowanceDetails::class,
        'items' => InvoiceItem::class,
    ];

    /**
     * @param  string  $invoiceType  Identifies the type of invoice.
     * @param  string  $id  Unique number relating to the charges defined in this document. This will be invoice number if the document type is Invoice or CreditNote number if the document type is Credit Note. Failure to provide this reference will result in a rejection.
     * @param  \DateTimeInterface  $date  Defines a date and time according to <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a>.
     * @param  PartyIdentification  $remitToParty  Name, address, and tax details of a party.
     * @param  Money  $invoiceTotal  An amount of money, including units in the form of currency.
     * @param  ?string  $referenceNumber  An additional unique reference number used for regulatory or other purposes.
     * @param  ?PartyIdentification  $shipToParty  Name, address, and tax details of a party.
     * @param  ?PartyIdentification  $shipFromParty  Name, address, and tax details of a party.
     * @param  ?PartyIdentification  $billToParty  Name, address, and tax details of a party.
     * @param  ?PaymentTerms  $paymentTerms  Terms of the payment for the invoice. The basis of the payment terms is the invoice date.
     * @param  TaxDetails[]|null  $taxDetails  Total tax amount details for all line items.
     * @param  AdditionalDetails[]|null  $additionalDetails  Additional details provided by the selling party, for tax related or other purposes.
     * @param  ChargeDetails[]|null  $chargeDetails  Total charge amount details for all line items.
     * @param  AllowanceDetails[]|null  $allowanceDetails  Total allowance amount details for all line items.
     * @param  InvoiceItem[]|null  $items  The list of invoice items.
     */
    public function __construct(
        public readonly string $invoiceType,
        public readonly string $id,
        public readonly \DateTimeInterface $date,
        public readonly PartyIdentification $remitToParty,
        public readonly Money $invoiceTotal,
        public readonly ?string $referenceNumber = null,
        public readonly ?PartyIdentification $shipToParty = null,
        public readonly ?PartyIdentification $shipFromParty = null,
        public readonly ?PartyIdentification $billToParty = null,
        public readonly ?PaymentTerms $paymentTerms = null,
        public readonly ?array $taxDetails = null,
        public readonly ?array $additionalDetails = null,
        public readonly ?array $chargeDetails = null,
        public readonly ?array $allowanceDetails = null,
        public readonly ?array $items = null,
    ) {}
}
