diff --git a/.gitignore b/.gitignore index 933c78729..8719bce52 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ # builds target/ +src-delomboked +src-lomboked # test jshell file _test.jsh diff --git a/src/main/java/com/mindee/product/financialdocument/FinancialDocumentV1.java b/src/main/java/com/mindee/product/financialdocument/FinancialDocumentV1.java index f166e03e3..758f9839b 100644 --- a/src/main/java/com/mindee/product/financialdocument/FinancialDocumentV1.java +++ b/src/main/java/com/mindee/product/financialdocument/FinancialDocumentV1.java @@ -6,7 +6,7 @@ import lombok.Getter; /** - * The definition for Financial Document, API version 1. + * Financial Document API version 1 inference prediction. */ @Getter @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/main/java/com/mindee/product/financialdocument/FinancialDocumentV1Document.java b/src/main/java/com/mindee/product/financialdocument/FinancialDocumentV1Document.java index 4938d0377..d441d1721 100644 --- a/src/main/java/com/mindee/product/financialdocument/FinancialDocumentV1Document.java +++ b/src/main/java/com/mindee/product/financialdocument/FinancialDocumentV1Document.java @@ -20,13 +20,18 @@ import lombok.Getter; /** - * Document data for Financial Document, API version 1. + * Financial Document API version 1.6 document data. */ @Getter @EqualsAndHashCode(callSuper = false) @JsonIgnoreProperties(ignoreUnknown = true) public class FinancialDocumentV1Document extends Prediction { + /** + * The customer's address used for billing. + */ + @JsonProperty("billing_address") + private StringField billingAddress; /** * The purchase category among predefined classes. */ @@ -42,6 +47,11 @@ public class FinancialDocumentV1Document extends Prediction { */ @JsonProperty("customer_company_registrations") private List customerCompanyRegistrations = new ArrayList<>(); + /** + * The customer account number or identifier from the supplier. + */ + @JsonProperty("customer_id") + private StringField customerId; /** * The name of the customer. */ @@ -82,6 +92,11 @@ public class FinancialDocumentV1Document extends Prediction { */ @JsonProperty("reference_numbers") private List referenceNumbers = new ArrayList<>(); + /** + * The customer's address used for shipping. + */ + @JsonProperty("shipping_address") + private StringField shippingAddress; /** * The purchase subcategory among predefined classes for transport and food. */ @@ -97,6 +112,11 @@ public class FinancialDocumentV1Document extends Prediction { */ @JsonProperty("supplier_company_registrations") private List supplierCompanyRegistrations = new ArrayList<>(); + /** + * The email of the supplier or merchant. + */ + @JsonProperty("supplier_email") + private StringField supplierEmail; /** * The name of the supplier or merchant. */ @@ -112,6 +132,11 @@ public class FinancialDocumentV1Document extends Prediction { */ @JsonProperty("supplier_phone_number") private StringField supplierPhoneNumber; + /** + * The website URL of the supplier or merchant. + */ + @JsonProperty("supplier_website") + private StringField supplierWebsite; /** * List of tax lines information. */ @@ -161,8 +186,13 @@ public boolean isEmpty() { && this.supplierAddress == null && this.supplierPhoneNumber == null && this.customerName == null + && this.supplierWebsite == null + && this.supplierEmail == null && (this.customerCompanyRegistrations == null || this.customerCompanyRegistrations.isEmpty()) && this.customerAddress == null + && this.customerId == null + && this.shippingAddress == null + && this.billingAddress == null && this.documentType == null && this.subcategory == null && this.category == null @@ -230,6 +260,12 @@ public String toString() { outStr.append( String.format(":Customer Name: %s%n", this.getCustomerName()) ); + outStr.append( + String.format(":Supplier Website: %s%n", this.getSupplierWebsite()) + ); + outStr.append( + String.format(":Supplier Email: %s%n", this.getSupplierEmail()) + ); String customerCompanyRegistrations = SummaryHelper.arrayToString( this.getCustomerCompanyRegistrations(), "%n " @@ -240,6 +276,15 @@ public String toString() { outStr.append( String.format(":Customer Address: %s%n", this.getCustomerAddress()) ); + outStr.append( + String.format(":Customer ID: %s%n", this.getCustomerId()) + ); + outStr.append( + String.format(":Shipping Address: %s%n", this.getShippingAddress()) + ); + outStr.append( + String.format(":Billing Address: %s%n", this.getBillingAddress()) + ); outStr.append( String.format(":Document Type: %s%n", this.getDocumentType()) ); diff --git a/src/main/java/com/mindee/product/invoice/InvoiceV4.java b/src/main/java/com/mindee/product/invoice/InvoiceV4.java index 3f78de6d9..4ca25a224 100644 --- a/src/main/java/com/mindee/product/invoice/InvoiceV4.java +++ b/src/main/java/com/mindee/product/invoice/InvoiceV4.java @@ -6,7 +6,7 @@ import lombok.Getter; /** - * The definition for Invoice, API version 4. + * Invoice API version 4 inference prediction. */ @Getter @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/main/java/com/mindee/product/invoice/InvoiceV4Document.java b/src/main/java/com/mindee/product/invoice/InvoiceV4Document.java index 273fd5c02..ffed48931 100644 --- a/src/main/java/com/mindee/product/invoice/InvoiceV4Document.java +++ b/src/main/java/com/mindee/product/invoice/InvoiceV4Document.java @@ -20,7 +20,7 @@ import lombok.Getter; /** - * Document data for Invoice, API version 4. + * Invoice API version 4.6 document data. */ @Getter @EqualsAndHashCode(callSuper = false) @@ -42,6 +42,11 @@ public class InvoiceV4Document extends Prediction { */ @JsonProperty("customer_company_registrations") private List customerCompanyRegistrations = new ArrayList<>(); + /** + * The customer account number or identifier from the supplier. + */ + @JsonProperty("customer_id") + private StringField customerId; /** * The name of the customer or client. */ @@ -97,6 +102,11 @@ public class InvoiceV4Document extends Prediction { */ @JsonProperty("supplier_company_registrations") private List supplierCompanyRegistrations = new ArrayList<>(); + /** + * The email of the supplier or merchant. + */ + @JsonProperty("supplier_email") + private StringField supplierEmail; /** * The name of the supplier or merchant. */ @@ -107,6 +117,16 @@ public class InvoiceV4Document extends Prediction { */ @JsonProperty("supplier_payment_details") private List supplierPaymentDetails = new ArrayList<>(); + /** + * The phone number of the supplier or merchant. + */ + @JsonProperty("supplier_phone_number") + private StringField supplierPhoneNumber; + /** + * The website URL of the supplier or merchant. + */ + @JsonProperty("supplier_website") + private StringField supplierWebsite; /** * List of tax line details. */ @@ -145,9 +165,13 @@ public boolean isEmpty() { && this.supplierName == null && (this.supplierCompanyRegistrations == null || this.supplierCompanyRegistrations.isEmpty()) && this.supplierAddress == null + && this.supplierPhoneNumber == null + && this.supplierWebsite == null + && this.supplierEmail == null && this.customerName == null && (this.customerCompanyRegistrations == null || this.customerCompanyRegistrations.isEmpty()) && this.customerAddress == null + && this.customerId == null && this.shippingAddress == null && this.billingAddress == null && this.documentType == null @@ -209,6 +233,15 @@ public String toString() { outStr.append( String.format(":Supplier Address: %s%n", this.getSupplierAddress()) ); + outStr.append( + String.format(":Supplier Phone Number: %s%n", this.getSupplierPhoneNumber()) + ); + outStr.append( + String.format(":Supplier Website: %s%n", this.getSupplierWebsite()) + ); + outStr.append( + String.format(":Supplier Email: %s%n", this.getSupplierEmail()) + ); outStr.append( String.format(":Customer Name: %s%n", this.getCustomerName()) ); @@ -222,6 +255,9 @@ public String toString() { outStr.append( String.format(":Customer Address: %s%n", this.getCustomerAddress()) ); + outStr.append( + String.format(":Customer ID: %s%n", this.getCustomerId()) + ); outStr.append( String.format(":Shipping Address: %s%n", this.getShippingAddress()) ); diff --git a/src/test/java/com/mindee/product/invoice/InvoiceV4Test.java b/src/test/java/com/mindee/product/invoice/InvoiceV4Test.java index ce063ced2..3d2f7f993 100644 --- a/src/test/java/com/mindee/product/invoice/InvoiceV4Test.java +++ b/src/test/java/com/mindee/product/invoice/InvoiceV4Test.java @@ -47,9 +47,13 @@ void whenEmptyDeserialized_mustHaveValidProperties() throws IOException { Assertions.assertNull(docPrediction.getSupplierName().getValue()); Assertions.assertTrue(docPrediction.getSupplierCompanyRegistrations().isEmpty()); Assertions.assertNull(docPrediction.getSupplierAddress().getValue()); + Assertions.assertNull(docPrediction.getSupplierPhoneNumber().getValue()); + Assertions.assertNull(docPrediction.getSupplierWebsite().getValue()); + Assertions.assertNull(docPrediction.getSupplierEmail().getValue()); Assertions.assertNull(docPrediction.getCustomerName().getValue()); Assertions.assertTrue(docPrediction.getCustomerCompanyRegistrations().isEmpty()); Assertions.assertNull(docPrediction.getCustomerAddress().getValue()); + Assertions.assertNull(docPrediction.getCustomerId().getValue()); Assertions.assertNull(docPrediction.getShippingAddress().getValue()); Assertions.assertNull(docPrediction.getBillingAddress().getValue()); Assertions.assertInstanceOf(ClassificationField.class, docPrediction.getDocumentType()); diff --git a/src/test/resources b/src/test/resources index a7af953e4..4130e9a7a 160000 --- a/src/test/resources +++ b/src/test/resources @@ -1 +1 @@ -Subproject commit a7af953e4800629e123c6ec9941ae41ca09eef1e +Subproject commit 4130e9a7a52cb95cc65178ca2b84fdec9cf1e6c5