package com.adleritech.flexibee.core.api.domain;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;


@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class IssuedInvoice {
    @Element(name = "id", required = false)
    private String id;

    @Element(name = "typDokl", required = false)
    private String documentType;

    @Element(name = "stavUhrK", required = false)
    private PaymentStatus paymentStatus;

    @Element(name = "firma", required = false)
    private String company;

    @Element(name = "ic", required = false)
    private String regNo;

    @Element(name = "datVyst", required = false)
    private LocalDate issued;

    @Element(name = "datSplat", required = false)
    private LocalDate dueDate;

    @Element(name = "formaUhrK", required = false)
    private PaymentMethod paymentMethod;

    @Element(name = "duzpPuv", required = false)
    private LocalDate timeOfSupply;

    @Element(name = "bezPolozek", required = false)
    private Boolean withoutItems;

    @Element(name = "sumDphZakl", required = false)
    private BigDecimal sumWithoutVat;

    @Element(name = "zakazka", required = false)
    private String order;

    @Element(name = "formaUhradyCis", required = false)
    private String paymentForm;

    @Element(name = "polozkyFaktury", required = false)
    private IssuedInvoiceItems items;

    @ElementList(name="odpocty-zaloh", required = false)
    private List<Deposit> deposits;

    @Element(name="zavTxt", required = false)
    private String text;

    @Element(name="varSym", required = false)
    private String variableSymbol;

    @Element(name="sumZklCelkem", required = false)
    private BigDecimal baseTotalSum;

    @Element(name="sumCelkZakl", required = false)
    private BigDecimal sumTotalWithoutVat;

    @Element(name="sumCelkem", required = false)
    private BigDecimal sumTotal;

}

@@ -407,32 +407,36 @@
 e %7B%0A    @Element
+List
 (name = %22id%22, re
@@ -441,32 +441,47 @@
 required = false
+, inline = true
 )%0A    private St
@@ -478,22 +478,28 @@
 private 
+List%3C
 String
+%3E
  id;%0A%0A  

Change issued invoice id to be inline list