Skip to content

Commit e407547

Browse files
✨ update delivery note 1.1 (#207)
1 parent cf0e682 commit e407547

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed

docs/delivery_notes_v1.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,58 +97,67 @@ A typical `BaseField` object will have the following attributes:
9797

9898
Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string.
9999

100+
### AmountField
101+
An amount field `AmountField` extends `BaseField`, but also implements:
102+
* **value** (`Double`): corresponds to the field value. Can be `null` if no value was extracted.
103+
100104
### StringField
101105
The text field `StringField` extends `BaseField`, but also implements:
102106
* **value** (`String`): corresponds to the field value.
103107
* **rawValue** (`String`): corresponds to the raw value as it appears on the document.
104108

109+
### DateField
110+
The date field `DateField` extends `BaseField`, but also implements:
111+
112+
* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`.
113+
105114
# Attributes
106115
The following fields are extracted for Delivery note V1:
107116

108117
## Customer Address
109-
**customerAddress**: The Customer Address field is used to store the address of the customer receiving the goods.
118+
**customerAddress**: The address of the customer receiving the goods.
110119

111120
```java
112121
System.out.println(result.getDocument().getInference().getPrediction().getCustomerAddress().value);
113122
```
114123

115124
## Customer Name
116-
**customerName**: The Customer Name field is used to store the name of the customer who is receiving the goods.
125+
**customerName**: The name of the customer receiving the goods.
117126

118127
```java
119128
System.out.println(result.getDocument().getInference().getPrediction().getCustomerName().value);
120129
```
121130

122131
## Delivery Date
123-
**deliveryDate**: Delivery Date is the date when the goods are expected to be delivered to the customer.
132+
**deliveryDate**: The date on which the delivery is scheduled to arrive.
124133

125134
```java
126135
System.out.println(result.getDocument().getInference().getPrediction().getDeliveryDate().value);
127136
```
128137

129138
## Delivery Number
130-
**deliveryNumber**: Delivery Number is a unique identifier for a Global Delivery Note document.
139+
**deliveryNumber**: A unique identifier for the delivery note.
131140

132141
```java
133142
System.out.println(result.getDocument().getInference().getPrediction().getDeliveryNumber().value);
134143
```
135144

136145
## Supplier Address
137-
**supplierAddress**: The Supplier Address field is used to store the address of the supplier from whom the goods were purchased.
146+
**supplierAddress**: The address of the supplier providing the goods.
138147

139148
```java
140149
System.out.println(result.getDocument().getInference().getPrediction().getSupplierAddress().value);
141150
```
142151

143152
## Supplier Name
144-
**supplierName**: Supplier Name field is used to capture the name of the supplier from whom the goods are being received.
153+
**supplierName**: The name of the supplier providing the goods.
145154

146155
```java
147156
System.out.println(result.getDocument().getInference().getPrediction().getSupplierName().value);
148157
```
149158

150159
## Total Amount
151-
**totalAmount**: Total Amount field is the sum of all line items on the Global Delivery Note.
160+
**totalAmount**: The total monetary value of the goods being delivered.
152161

153162
```java
154163
System.out.println(result.getDocument().getInference().getPrediction().getTotalAmount().value);

src/main/java/com/mindee/product/deliverynote/DeliveryNoteV1Document.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,55 @@
44
import com.fasterxml.jackson.annotation.JsonProperty;
55
import com.mindee.parsing.SummaryHelper;
66
import com.mindee.parsing.common.Prediction;
7+
import com.mindee.parsing.standard.AmountField;
8+
import com.mindee.parsing.standard.DateField;
79
import com.mindee.parsing.standard.StringField;
810
import lombok.EqualsAndHashCode;
911
import lombok.Getter;
1012

1113
/**
12-
* Delivery note API version 1.0 document data.
14+
* Delivery note API version 1.1 document data.
1315
*/
1416
@Getter
1517
@EqualsAndHashCode(callSuper = false)
1618
@JsonIgnoreProperties(ignoreUnknown = true)
1719
public class DeliveryNoteV1Document extends Prediction {
1820

1921
/**
20-
* The Customer Address field is used to store the address of the customer receiving the goods.
22+
* The address of the customer receiving the goods.
2123
*/
2224
@JsonProperty("customer_address")
2325
protected StringField customerAddress;
2426
/**
25-
* The Customer Name field is used to store the name of the customer who is receiving the goods.
27+
* The name of the customer receiving the goods.
2628
*/
2729
@JsonProperty("customer_name")
2830
protected StringField customerName;
2931
/**
30-
* Delivery Date is the date when the goods are expected to be delivered to the customer.
32+
* The date on which the delivery is scheduled to arrive.
3133
*/
3234
@JsonProperty("delivery_date")
33-
protected StringField deliveryDate;
35+
protected DateField deliveryDate;
3436
/**
35-
* Delivery Number is a unique identifier for a Global Delivery Note document.
37+
* A unique identifier for the delivery note.
3638
*/
3739
@JsonProperty("delivery_number")
3840
protected StringField deliveryNumber;
3941
/**
40-
* The Supplier Address field is used to store the address of the supplier from whom the goods were purchased.
42+
* The address of the supplier providing the goods.
4143
*/
4244
@JsonProperty("supplier_address")
4345
protected StringField supplierAddress;
4446
/**
45-
* Supplier Name field is used to capture the name of the supplier from whom the goods are being received.
47+
* The name of the supplier providing the goods.
4648
*/
4749
@JsonProperty("supplier_name")
4850
protected StringField supplierName;
4951
/**
50-
* Total Amount field is the sum of all line items on the Global Delivery Note.
52+
* The total monetary value of the goods being delivered.
5153
*/
5254
@JsonProperty("total_amount")
53-
protected StringField totalAmount;
55+
protected AmountField totalAmount;
5456

5557
@Override
5658
public boolean isEmpty() {

0 commit comments

Comments
 (0)