1212import com .mindee .parsing .standard .LocaleField ;
1313import com .mindee .parsing .standard .PaymentDetailsField ;
1414import com .mindee .parsing .standard .StringField ;
15- import com .mindee .parsing .standard .TaxField ;
15+ import com .mindee .parsing .standard .Taxes ;
1616import com .mindee .parsing .standard .TaxesDeserializer ;
17+ import java .util .ArrayList ;
1718import java .util .List ;
1819import lombok .EqualsAndHashCode ;
1920import lombok .Getter ;
2728public class InvoiceV4Document extends Prediction {
2829
2930 /**
30- * Locale information .
31+ * The customer's address used for billing .
3132 */
32- @ JsonProperty ("locale " )
33- private LocaleField localeField ;
33+ @ JsonProperty ("billing_address " )
34+ private StringField billingAddress ;
3435 /**
35- * The type of the parsed document (see official documentation for the list) .
36+ * The address of the customer .
3637 */
37- @ JsonProperty ("document_type " )
38- private ClassificationField documentType ;
38+ @ JsonProperty ("customer_address " )
39+ private StringField customerAddress ;
3940 /**
40- * The creation date of the invoice .
41+ * List of company registrations associated to the customer .
4142 */
42- @ JsonProperty ("date " )
43- private DateField invoiceDateField ;
43+ @ JsonProperty ("customer_company_registrations " )
44+ private List < CompanyRegistrationField > customerCompanyRegistrations = new ArrayList <>() ;
4445 /**
45- * The invoice number .
46+ * The name of the customer or client .
4647 */
47- @ JsonProperty ("invoice_number " )
48- private StringField invoiceNumber ;
48+ @ JsonProperty ("customer_name " )
49+ private StringField customerName ;
4950 /**
50- * List of Reference numbers including PO number .
51+ * The date the purchase was made .
5152 */
52- @ JsonProperty ("reference_numbers" )
53- private List <StringField > referenceNumbers ;
53+ @ JsonProperty ("date" )
54+ private DateField invoiceDateField ;
55+ /**
56+ * One of: 'INVOICE', 'CREDIT NOTE'.
57+ */
58+ @ JsonProperty ("document_type" )
59+ private ClassificationField documentType ;
5460 /**
55- * The due date of the invoice .
61+ * The date on which the payment is due .
5662 */
5763 @ JsonProperty ("due_date" )
5864 private DateField dueDateField ;
5965 /**
60- * The supplier name .
66+ * The invoice number or identifier .
6167 */
62- @ JsonProperty ("supplier_name " )
63- private StringField supplierName ;
68+ @ JsonProperty ("invoice_number " )
69+ private StringField invoiceNumber ;
6470 /**
65- * The supplier payment information's .
71+ * List of line item details .
6672 */
67- @ JsonProperty ("supplier_payment_details " )
68- private List <PaymentDetailsField > supplierPaymentDetails ;
73+ @ JsonProperty ("line_items " )
74+ private List <InvoiceV4LineItem > lineItems = new ArrayList <>() ;
6975 /**
70- * The supplier company regitration information .
76+ * The locale detected on the document .
7177 */
72- @ JsonProperty ("supplier_company_registrations " )
73- private List < CompanyRegistrationField > supplierCompanyRegistrations ;
78+ @ JsonProperty ("locale " )
79+ private LocaleField localeField ;
7480 /**
75- * The supplier address.
81+ * List of Reference numbers, including PO number.
82+ */
83+ @ JsonProperty ("reference_numbers" )
84+ private List <StringField > referenceNumbers = new ArrayList <>();
85+ /**
86+ * Customer's delivery address.
87+ */
88+ @ JsonProperty ("shipping_address" )
89+ private StringField shippingAddress ;
90+ /**
91+ * The address of the supplier or merchant.
7692 */
7793 @ JsonProperty ("supplier_address" )
7894 private StringField supplierAddress ;
7995 /**
80- * The name of the customer .
96+ * List of company registrations associated to the supplier .
8197 */
82- @ JsonProperty ("customer_name " )
83- private StringField customerName ;
98+ @ JsonProperty ("supplier_company_registrations " )
99+ private List < CompanyRegistrationField > supplierCompanyRegistrations = new ArrayList <>() ;
84100 /**
85- * The company registration information for the customer .
101+ * The name of the supplier or merchant .
86102 */
87- @ JsonProperty ("customer_company_registrations " )
88- private List < CompanyRegistrationField > customerCompanyRegistrations ;
103+ @ JsonProperty ("supplier_name " )
104+ private StringField supplierName ;
89105 /**
90- * The address of the customer .
106+ * List of payment details associated to the supplier .
91107 */
92- @ JsonProperty ("customer_address " )
93- private StringField customerAddress ;
108+ @ JsonProperty ("supplier_payment_details " )
109+ private List < PaymentDetailsField > supplierPaymentDetails = new ArrayList <>() ;
94110 /**
95- * The list of the taxes .
111+ * List of tax line details .
96112 */
97113 @ JsonProperty ("taxes" )
98114 @ JsonDeserialize (using = TaxesDeserializer .class )
99- private List < TaxField > taxes ;
115+ private Taxes taxes ;
100116 /**
101- * The total amount with tax included .
117+ * The total amount paid: includes taxes, tips, fees, and other charges .
102118 */
103119 @ JsonProperty ("total_amount" )
104120 private AmountField totalAmount ;
105121 /**
106- * The total amount without the tax value .
122+ * The net amount paid: does not include taxes, fees, and discounts .
107123 */
108124 @ JsonProperty ("total_net" )
109125 private AmountField totalNet ;
@@ -112,12 +128,8 @@ public class InvoiceV4Document extends Prediction {
112128 */
113129 @ JsonProperty ("total_tax" )
114130 private AmountField totalTax ;
115- /**
116- * Line items details.
117- */
118- @ JsonProperty ("line_items" )
119- private List <InvoiceV4LineItem > lineItems ;
120131
132+ @ Override
121133 public boolean isEmpty () {
122134 return (
123135 this .localeField == null
@@ -136,6 +148,8 @@ public boolean isEmpty() {
136148 && this .customerName == null
137149 && (this .customerCompanyRegistrations == null || this .customerCompanyRegistrations .isEmpty ())
138150 && this .customerAddress == null
151+ && this .shippingAddress == null
152+ && this .billingAddress == null
139153 && this .documentType == null
140154 && (this .lineItems == null || this .lineItems .isEmpty ())
141155 );
@@ -208,6 +222,12 @@ public String toString() {
208222 outStr .append (
209223 String .format (":Customer Address: %s%n" , this .getCustomerAddress ())
210224 );
225+ outStr .append (
226+ String .format (":Shipping Address: %s%n" , this .getShippingAddress ())
227+ );
228+ outStr .append (
229+ String .format (":Billing Address: %s%n" , this .getBillingAddress ())
230+ );
211231 outStr .append (
212232 String .format (":Document Type: %s%n" , this .getDocumentType ())
213233 );
0 commit comments