/// <reference types="mongoose/types/types" />
/// <reference types="mongoose/types/document" />
/// <reference types="mongoose/types/aggregate" />
/// <reference types="mongoose/types/callback" />
/// <reference types="mongoose/types/collection" />
/// <reference types="mongoose/types/connection" />
/// <reference types="mongoose/types/cursor" />
/// <reference types="mongoose/types/document" />
/// <reference types="mongoose/types/error" />
/// <reference types="mongoose/types/expressions" />
/// <reference types="mongoose/types/helpers" />
/// <reference types="mongoose/types/middlewares" />
/// <reference types="mongoose/types/indexes" />
/// <reference types="mongoose/types/models" />
/// <reference types="mongoose/types/mongooseoptions" />
/// <reference types="mongoose/types/pipelinestage" />
/// <reference types="mongoose/types/populate" />
/// <reference types="mongoose/types/query" />
/// <reference types="mongoose/types/schemaoptions" />
/// <reference types="mongoose/types/schematypes" />
/// <reference types="mongoose/types/session" />
/// <reference types="mongoose/types/types" />
/// <reference types="mongoose/types/utility" />
/// <reference types="mongoose/types/validation" />
/// <reference types="mongoose/types/virtuals" />
/// <reference types="mongoose/types/inferschematype" />
import mongoose from 'mongoose';
import { IBorrowerItemLean, IBorrowerItemInstance, IComplianceFile, IEmailRecipient, IBorrowerItemInstanceLean } from '../models/ComplianceItem.model';
import { IGroupedEmailsUpdate } from '../interfaces/email-addresses.interface';
import { IComplianceBorrowerWithBorrower, IComplianceBorrowerDocumentFull, IComplianceBorrowerWithPlaidToken } from '../models/BorrowerCompliance.model';
import { IUserAccess } from '../interfaces/auth-user.interface';
import { FileManagerService } from './file-manager.service';
import { UploadsService } from './uploads.service';
export interface IInstanceStatus {
    progress: {
        text: string;
        status: string;
    };
    score: {
        value: number;
        tooltip: string;
    };
}
export interface IBorrowerItemInstanceWithStatusesLean extends IBorrowerItemInstanceLean, IInstanceStatus {
    itemId: mongoose.Types.ObjectId;
    files: (IComplianceFile & {
        uploadedByUser: string | null;
    })[];
}
export interface IBorrowerItemWithStatusesLean extends Omit<IBorrowerItemLean, 'instances'> {
    instances: IBorrowerItemInstanceWithStatusesLean[];
}
export interface IComplianceBorrowerDocumentFullWithStatuses extends Omit<IComplianceBorrowerDocumentFull, 'items'> {
    items: IBorrowerItemWithStatusesLean[];
}
export declare class ComplianceBorrowersService {
    private readonly _fileManagerService;
    private readonly _uploadsService;
    constructor(_fileManagerService: FileManagerService, _uploadsService: UploadsService);
    isComplianceBorrowerAllowed(userAccess: IUserAccess, requestedBorrowerId: string): boolean;
    calculateInstanceStatuses(instance: IBorrowerItemInstance, item: IBorrowerItemLean): IInstanceStatus;
    getFullComplianceBorrowerById(complianceBorrowerId: string): Promise<IComplianceBorrowerDocumentFullWithStatuses>;
    getAllBorrowersShortened(userAccess: IUserAccess): Promise<Pick<IComplianceBorrowerWithBorrower, "borrower" | "fundingStatus" | "items">[]>;
    generateInstances(complianceBorrowerId: any): Promise<IComplianceBorrowerDocumentFullWithStatuses>;
    calculateAndUpdateFundingStatus(complianceBorrowerId: string): Promise<void>;
    calculateFundingStatus(complianceBorrower: IComplianceBorrowerDocumentFull): string;
    updateComplianceBorrower(complianceBorrower: IComplianceBorrowerDocumentFull): Promise<mongoose.Document<unknown, {}, import("../models/BorrowerCompliance.model").IComplianceBorrowerDoc> & import("../models/BorrowerCompliance.model").IComplianceBorrowerDoc & Required<{
        _id: mongoose.Types.ObjectId;
    }>>;
    updateFundingStatus(complianceBorrowerId: string, fundingStatus: string): Promise<mongoose.Document<unknown, {}, import("../models/BorrowerCompliance.model").IComplianceBorrowerDoc> & import("../models/BorrowerCompliance.model").IComplianceBorrowerDoc & Required<{
        _id: mongoose.Types.ObjectId;
    }>>;
    updateLastEmailSent(complianceBorrowerId: string, lastEmailSentAt: Date): Promise<mongoose.Document<unknown, {}, import("../models/BorrowerCompliance.model").IComplianceBorrowerDoc> & import("../models/BorrowerCompliance.model").IComplianceBorrowerDoc & Required<{
        _id: mongoose.Types.ObjectId;
    }>>;
    getAllBorrowersIds(onlyActive?: boolean): Promise<any[]>;
    getBorrowerListByItemId(complianceItemId: string): Promise<IComplianceBorrowerWithBorrower[]>;
    deleteInstanceById(complianceBorrowerId: string, complianceInstanceId: string): Promise<void>;
    getBorrowerByInstanceId(complianceInstanceId: string): Promise<mongoose.Document<unknown, {}, import("../models/BorrowerCompliance.model").IComplianceBorrowerDoc> & import("../models/BorrowerCompliance.model").IComplianceBorrowerDoc & Required<{
        _id: mongoose.Types.ObjectId;
    }>>;
    markInstanceFilesAsOld(complianceInstanceId: string): Promise<mongoose.Document<unknown, {}, import("../models/BorrowerCompliance.model").IComplianceBorrowerDoc> & import("../models/BorrowerCompliance.model").IComplianceBorrowerDoc & Required<{
        _id: mongoose.Types.ObjectId;
    }>>;
    getBorrowerWithPlaidToken(): Promise<IComplianceBorrowerWithPlaidToken[]>;
    getBorrowerEmails(userAccess: IUserAccess): Promise<{
        borrower: {
            _id: string;
            name: string;
            borrowerId: string;
        };
        email: string;
        mainEmails: IEmailRecipient[];
        financialEmails: IEmailRecipient[];
        isEmailingActive: boolean;
        isDailyTransactionsEmailingActive: boolean;
        uniqEmails: any[];
        groupedEmails: {};
        items: {
            value: any;
            title: string;
        }[];
    }[]>;
    getOneBorrowerEmails(userAccess: any, borrowerId: any): Promise<{
        borrower: {
            _id: string;
            name: string;
            borrowerId: string;
        };
        email: string;
        mainEmails: IEmailRecipient[];
        financialEmails: IEmailRecipient[];
        isEmailingActive: boolean;
        isDailyTransactionsEmailingActive: boolean;
        uniqEmails: any[];
        groupedEmails: {};
        items: {
            value: any;
            title: string;
        }[];
    }>;
    getBorrowerEmailsGrouped(borrowerId: string): Promise<{
        mainEmails: IEmailRecipient[];
        financialEmails: IEmailRecipient[];
    }>;
    updateBorrowerEmailAddresses(emailUpdate: IGroupedEmailsUpdate): Promise<mongoose.Document<unknown, {}, import("../models/BorrowerCompliance.model").IComplianceBorrowerDoc> & import("../models/BorrowerCompliance.model").IComplianceBorrowerDoc & Required<{
        _id: mongoose.Types.ObjectId;
    }>>;
    toggleComplianceBorrowerVisibility(borrowerId: string, isVisible: boolean): Promise<void>;
    createComplianceBorrower(borrowerId: string, isVisible?: boolean): Promise<void>;
    removeIncorrectBorrowers(): Promise<void>;
    getBorrowerListReport(user: IUserAccess): Promise<any>;
}
