Skip to content

Commit 6d95936

Browse files
authored
✨ update invoice to 4.6, financial document to 1.6 (#165)
1 parent eebb575 commit 6d95936

File tree

7 files changed

+92
-5
lines changed

7 files changed

+92
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# builds
22
target/
3+
src-delomboked
4+
src-lomboked
35

46
# test jshell file
57
_test.jsh

src/main/java/com/mindee/product/financialdocument/FinancialDocumentV1.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import lombok.Getter;
77

88
/**
9-
* The definition for Financial Document, API version 1.
9+
* Financial Document API version 1 inference prediction.
1010
*/
1111
@Getter
1212
@JsonIgnoreProperties(ignoreUnknown = true)

src/main/java/com/mindee/product/financialdocument/FinancialDocumentV1Document.java

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@
2020
import lombok.Getter;
2121

2222
/**
23-
* Document data for Financial Document, API version 1.
23+
* Financial Document API version 1.6 document data.
2424
*/
2525
@Getter
2626
@EqualsAndHashCode(callSuper = false)
2727
@JsonIgnoreProperties(ignoreUnknown = true)
2828
public class FinancialDocumentV1Document extends Prediction {
2929

30+
/**
31+
* The customer's address used for billing.
32+
*/
33+
@JsonProperty("billing_address")
34+
private StringField billingAddress;
3035
/**
3136
* The purchase category among predefined classes.
3237
*/
@@ -42,6 +47,11 @@ public class FinancialDocumentV1Document extends Prediction {
4247
*/
4348
@JsonProperty("customer_company_registrations")
4449
private List<CompanyRegistrationField> customerCompanyRegistrations = new ArrayList<>();
50+
/**
51+
* The customer account number or identifier from the supplier.
52+
*/
53+
@JsonProperty("customer_id")
54+
private StringField customerId;
4555
/**
4656
* The name of the customer.
4757
*/
@@ -82,6 +92,11 @@ public class FinancialDocumentV1Document extends Prediction {
8292
*/
8393
@JsonProperty("reference_numbers")
8494
private List<StringField> referenceNumbers = new ArrayList<>();
95+
/**
96+
* The customer's address used for shipping.
97+
*/
98+
@JsonProperty("shipping_address")
99+
private StringField shippingAddress;
85100
/**
86101
* The purchase subcategory among predefined classes for transport and food.
87102
*/
@@ -97,6 +112,11 @@ public class FinancialDocumentV1Document extends Prediction {
97112
*/
98113
@JsonProperty("supplier_company_registrations")
99114
private List<CompanyRegistrationField> supplierCompanyRegistrations = new ArrayList<>();
115+
/**
116+
* The email of the supplier or merchant.
117+
*/
118+
@JsonProperty("supplier_email")
119+
private StringField supplierEmail;
100120
/**
101121
* The name of the supplier or merchant.
102122
*/
@@ -112,6 +132,11 @@ public class FinancialDocumentV1Document extends Prediction {
112132
*/
113133
@JsonProperty("supplier_phone_number")
114134
private StringField supplierPhoneNumber;
135+
/**
136+
* The website URL of the supplier or merchant.
137+
*/
138+
@JsonProperty("supplier_website")
139+
private StringField supplierWebsite;
115140
/**
116141
* List of tax lines information.
117142
*/
@@ -161,8 +186,13 @@ public boolean isEmpty() {
161186
&& this.supplierAddress == null
162187
&& this.supplierPhoneNumber == null
163188
&& this.customerName == null
189+
&& this.supplierWebsite == null
190+
&& this.supplierEmail == null
164191
&& (this.customerCompanyRegistrations == null || this.customerCompanyRegistrations.isEmpty())
165192
&& this.customerAddress == null
193+
&& this.customerId == null
194+
&& this.shippingAddress == null
195+
&& this.billingAddress == null
166196
&& this.documentType == null
167197
&& this.subcategory == null
168198
&& this.category == null
@@ -230,6 +260,12 @@ public String toString() {
230260
outStr.append(
231261
String.format(":Customer Name: %s%n", this.getCustomerName())
232262
);
263+
outStr.append(
264+
String.format(":Supplier Website: %s%n", this.getSupplierWebsite())
265+
);
266+
outStr.append(
267+
String.format(":Supplier Email: %s%n", this.getSupplierEmail())
268+
);
233269
String customerCompanyRegistrations = SummaryHelper.arrayToString(
234270
this.getCustomerCompanyRegistrations(),
235271
"%n "
@@ -240,6 +276,15 @@ public String toString() {
240276
outStr.append(
241277
String.format(":Customer Address: %s%n", this.getCustomerAddress())
242278
);
279+
outStr.append(
280+
String.format(":Customer ID: %s%n", this.getCustomerId())
281+
);
282+
outStr.append(
283+
String.format(":Shipping Address: %s%n", this.getShippingAddress())
284+
);
285+
outStr.append(
286+
String.format(":Billing Address: %s%n", this.getBillingAddress())
287+
);
243288
outStr.append(
244289
String.format(":Document Type: %s%n", this.getDocumentType())
245290
);

src/main/java/com/mindee/product/invoice/InvoiceV4.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import lombok.Getter;
77

88
/**
9-
* The definition for Invoice, API version 4.
9+
* Invoice API version 4 inference prediction.
1010
*/
1111
@Getter
1212
@JsonIgnoreProperties(ignoreUnknown = true)

src/main/java/com/mindee/product/invoice/InvoiceV4Document.java

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import lombok.Getter;
2121

2222
/**
23-
* Document data for Invoice, API version 4.
23+
* Invoice API version 4.6 document data.
2424
*/
2525
@Getter
2626
@EqualsAndHashCode(callSuper = false)
@@ -42,6 +42,11 @@ public class InvoiceV4Document extends Prediction {
4242
*/
4343
@JsonProperty("customer_company_registrations")
4444
private List<CompanyRegistrationField> customerCompanyRegistrations = new ArrayList<>();
45+
/**
46+
* The customer account number or identifier from the supplier.
47+
*/
48+
@JsonProperty("customer_id")
49+
private StringField customerId;
4550
/**
4651
* The name of the customer or client.
4752
*/
@@ -97,6 +102,11 @@ public class InvoiceV4Document extends Prediction {
97102
*/
98103
@JsonProperty("supplier_company_registrations")
99104
private List<CompanyRegistrationField> supplierCompanyRegistrations = new ArrayList<>();
105+
/**
106+
* The email of the supplier or merchant.
107+
*/
108+
@JsonProperty("supplier_email")
109+
private StringField supplierEmail;
100110
/**
101111
* The name of the supplier or merchant.
102112
*/
@@ -107,6 +117,16 @@ public class InvoiceV4Document extends Prediction {
107117
*/
108118
@JsonProperty("supplier_payment_details")
109119
private List<PaymentDetailsField> supplierPaymentDetails = new ArrayList<>();
120+
/**
121+
* The phone number of the supplier or merchant.
122+
*/
123+
@JsonProperty("supplier_phone_number")
124+
private StringField supplierPhoneNumber;
125+
/**
126+
* The website URL of the supplier or merchant.
127+
*/
128+
@JsonProperty("supplier_website")
129+
private StringField supplierWebsite;
110130
/**
111131
* List of tax line details.
112132
*/
@@ -145,9 +165,13 @@ public boolean isEmpty() {
145165
&& this.supplierName == null
146166
&& (this.supplierCompanyRegistrations == null || this.supplierCompanyRegistrations.isEmpty())
147167
&& this.supplierAddress == null
168+
&& this.supplierPhoneNumber == null
169+
&& this.supplierWebsite == null
170+
&& this.supplierEmail == null
148171
&& this.customerName == null
149172
&& (this.customerCompanyRegistrations == null || this.customerCompanyRegistrations.isEmpty())
150173
&& this.customerAddress == null
174+
&& this.customerId == null
151175
&& this.shippingAddress == null
152176
&& this.billingAddress == null
153177
&& this.documentType == null
@@ -209,6 +233,15 @@ public String toString() {
209233
outStr.append(
210234
String.format(":Supplier Address: %s%n", this.getSupplierAddress())
211235
);
236+
outStr.append(
237+
String.format(":Supplier Phone Number: %s%n", this.getSupplierPhoneNumber())
238+
);
239+
outStr.append(
240+
String.format(":Supplier Website: %s%n", this.getSupplierWebsite())
241+
);
242+
outStr.append(
243+
String.format(":Supplier Email: %s%n", this.getSupplierEmail())
244+
);
212245
outStr.append(
213246
String.format(":Customer Name: %s%n", this.getCustomerName())
214247
);
@@ -222,6 +255,9 @@ public String toString() {
222255
outStr.append(
223256
String.format(":Customer Address: %s%n", this.getCustomerAddress())
224257
);
258+
outStr.append(
259+
String.format(":Customer ID: %s%n", this.getCustomerId())
260+
);
225261
outStr.append(
226262
String.format(":Shipping Address: %s%n", this.getShippingAddress())
227263
);

src/test/java/com/mindee/product/invoice/InvoiceV4Test.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@ void whenEmptyDeserialized_mustHaveValidProperties() throws IOException {
4747
Assertions.assertNull(docPrediction.getSupplierName().getValue());
4848
Assertions.assertTrue(docPrediction.getSupplierCompanyRegistrations().isEmpty());
4949
Assertions.assertNull(docPrediction.getSupplierAddress().getValue());
50+
Assertions.assertNull(docPrediction.getSupplierPhoneNumber().getValue());
51+
Assertions.assertNull(docPrediction.getSupplierWebsite().getValue());
52+
Assertions.assertNull(docPrediction.getSupplierEmail().getValue());
5053
Assertions.assertNull(docPrediction.getCustomerName().getValue());
5154
Assertions.assertTrue(docPrediction.getCustomerCompanyRegistrations().isEmpty());
5255
Assertions.assertNull(docPrediction.getCustomerAddress().getValue());
56+
Assertions.assertNull(docPrediction.getCustomerId().getValue());
5357
Assertions.assertNull(docPrediction.getShippingAddress().getValue());
5458
Assertions.assertNull(docPrediction.getBillingAddress().getValue());
5559
Assertions.assertInstanceOf(ClassificationField.class, docPrediction.getDocumentType());

0 commit comments

Comments
 (0)