mindee
Version:
Mindee Client Library for Node.js
55 lines (54 loc) • 1.94 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeliveryNoteV1Document = void 0;
const common_1 = require("../../parsing/common");
const standard_1 = require("../../parsing/standard");
/**
* Delivery note API version 1.2 document data.
*/
class DeliveryNoteV1Document {
constructor(rawPrediction, pageId) {
this.customerAddress = new standard_1.StringField({
prediction: rawPrediction["customer_address"],
pageId: pageId,
});
this.customerName = new standard_1.StringField({
prediction: rawPrediction["customer_name"],
pageId: pageId,
});
this.deliveryDate = new standard_1.DateField({
prediction: rawPrediction["delivery_date"],
pageId: pageId,
});
this.deliveryNumber = new standard_1.StringField({
prediction: rawPrediction["delivery_number"],
pageId: pageId,
});
this.supplierAddress = new standard_1.StringField({
prediction: rawPrediction["supplier_address"],
pageId: pageId,
});
this.supplierName = new standard_1.StringField({
prediction: rawPrediction["supplier_name"],
pageId: pageId,
});
this.totalAmount = new standard_1.AmountField({
prediction: rawPrediction["total_amount"],
pageId: pageId,
});
}
/**
* Default string representation.
*/
toString() {
const outStr = `:Delivery Date: ${this.deliveryDate}
:Delivery Number: ${this.deliveryNumber}
:Supplier Name: ${this.supplierName}
:Supplier Address: ${this.supplierAddress}
:Customer Name: ${this.customerName}
:Customer Address: ${this.customerAddress}
:Total Amount: ${this.totalAmount}`.trimEnd();
return (0, common_1.cleanOutString)(outStr);
}
}
exports.DeliveryNoteV1Document = DeliveryNoteV1Document;