UNPKG

mindee

Version:

Mindee Client Library for Node.js

37 lines (36 loc) 1.24 kB
import { cleanOutString, } from "../../../../v1/parsing/common/index.js"; import { BankAccountDetailsV2Bban } from "./bankAccountDetailsV2Bban.js"; import { StringField } from "../../../../v1/parsing/standard/index.js"; /** * Bank Account Details API version 2.0 document data. */ export class BankAccountDetailsV2Document { constructor(rawPrediction, pageId) { this.accountHoldersNames = new StringField({ prediction: rawPrediction["account_holders_names"], pageId: pageId, }); this.bban = new BankAccountDetailsV2Bban({ prediction: rawPrediction["bban"], pageId: pageId, }); this.iban = new StringField({ prediction: rawPrediction["iban"], pageId: pageId, }); this.swiftCode = new StringField({ prediction: rawPrediction["swift_code"], pageId: pageId, }); } /** * Default string representation. */ toString() { const outStr = `:Account Holder's Names: ${this.accountHoldersNames} :Basic Bank Account Number: ${this.bban.toFieldList()} :IBAN: ${this.iban} :SWIFT Code: ${this.swiftCode}`.trimEnd(); return cleanOutString(outStr); } }