export var EntityDocumentType;
(function (EntityDocumentType) {
    EntityDocumentType["voidedCheck"] = "voided_check";
    EntityDocumentType["balanceSheet"] = "balance_sheet";
    EntityDocumentType["bankStatement"] = "bank_statement";
    EntityDocumentType["governmentId"] = "government_id";
    EntityDocumentType["profitAndLossStatement"] = "profit_and_loss_statement";
    EntityDocumentType["taxReturn"] = "tax_return";
    EntityDocumentType["other"] = "other";
    EntityDocumentType["articlesOfIncorporation"] = "articles_of_incorporation";
    EntityDocumentType["businessRegistration"] = "business_registration";
    EntityDocumentType["passport"] = "passport";
    EntityDocumentType["driverLicense"] = "driver_license";
    EntityDocumentType["residentCard"] = "resident_card";
    EntityDocumentType["statusCard"] = "status_card";
    EntityDocumentType["nexusCard"] = "nexus_card";
    EntityDocumentType["citizenshipCard"] = "citizenship_card";
    EntityDocumentType["foreignPassport"] = "foreign_passport";
    EntityDocumentType["birthCertificate"] = "birth_certificate";
    EntityDocumentType["sinCard"] = "sin_card";
    EntityDocumentType["ssnCard"] = "ssn_card";
})(EntityDocumentType || (EntityDocumentType = {}));
export var EntityDocumentStatus;
(function (EntityDocumentStatus) {
    EntityDocumentStatus["pending"] = "pending";
    EntityDocumentStatus["uploaded"] = "uploaded";
    EntityDocumentStatus["canceled"] = "canceled";
    EntityDocumentStatus["needed"] = "needed";
})(EntityDocumentStatus || (EntityDocumentStatus = {}));
export class EntityDocumentStorage {
    constructor() {
        this.voided_check = [];
        this.balance_sheet = [];
        this.bank_statement = [];
        this.government_id = [];
        this.profit_and_loss_statement = [];
        this.tax_return = [];
        this.other = [];
    }
}
export class EntityDocument {
    constructor(fileData, business_id) {
        this.fileData = null;
        this.file = fileData.file;
        this.document_type = fileData.document_type;
        this.presigned_url = null;
        this.record_data = {
            business_id: business_id,
            document_type: this.document_type,
            file_name: this.file.name,
            file_type: this.file.type,
        };
    }
    async getFileData() {
        if (this.fileData) {
            return this.fileData;
        }
        const fileDataPromise = new Promise((resolve, reject) => {
            const reader = new FileReader();
            reader.onload = (e) => {
                this.fileData = e.target.result;
                resolve(this.fileData);
            };
            reader.onerror = () => {
                reject(new Error('Error reading file'));
            };
            reader.readAsArrayBuffer(this.file);
        });
        return await fileDataPromise;
    }
    setPresignedUrl(url) {
        this.presigned_url = url;
    }
}
