# This file was generated by liblab | https://liblab.com/

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .invoice_status_enum import InvoiceStatusEnum


@JsonMap({"id_": "id"})
class Invoice(BaseModel):
    """Invoice

    :param id_: Unique identifier of the invoice.
    :type id_: str
    :param status: Current status of the invoice.
    :type status: InvoiceStatusEnum
    :param currency: Currency code.
    :type currency: str
    :param created_at: Long date-time format following ISO-8601
    :type created_at: str
    :param total: Total invoice amount including Fee and VAT.
    :type total: str
    :param label: Label of the invoice.
    :type label: str
    :param paid_at: Long date-time format following ISO-8601
    :type paid_at: str
    :param vat_total: Amount of VAT.
    :type vat_total: str
    :param vat_percentage: VAT percentage.
    :type vat_percentage: str
    :param is_overdue: Indicates if the invoice is overdue.
    :type is_overdue: bool
    :param issued_at: Short date in format ISO-8601 (YYYY-MM-DD). For example 2022-12-31.
    :type issued_at: str
    :param vat_id: VAT identification number.
    :type vat_id: str
    :param due_date: Short date in format ISO-8601 (YYYY-MM-DD). For example 2022-12-31.
    :type due_date: str
    :param contract_id: Unique identifier of the contract.
    :type contract_id: str
    """

    def __init__(
        self,
        id_: str,
        status: InvoiceStatusEnum,
        currency: str,
        created_at: str,
        total: str,
        label: str,
        paid_at: str,
        vat_total: str,
        vat_percentage: str,
        is_overdue: bool,
        issued_at: str,
        vat_id: str,
        due_date: str,
        contract_id: str,
    ):
        self.id_ = id_
        self.status = self._enum_matching(status, InvoiceStatusEnum.list(), "status")
        self.currency = self._pattern_matching(currency, "^[A-Z]{3}$", "currency")
        self.created_at = created_at
        self.total = total
        self.label = label
        self.paid_at = paid_at
        self.vat_total = vat_total
        self.vat_percentage = vat_percentage
        self.is_overdue = is_overdue
        self.issued_at = self._pattern_matching(
            issued_at, "^\d{4}-\d{2}-\d{2}$", "issued_at"
        )
        self.vat_id = vat_id
        self.due_date = self._pattern_matching(
            due_date, "^\d{4}-\d{2}-\d{2}$", "due_date"
        )
        self.contract_id = contract_id
