/// <reference types="mongoose/types/types" />
/// <reference types="mongoose/types/collection" />
/// <reference types="mongoose/types/connection" />
/// <reference types="mongoose/types/error" />
/// <reference types="mongoose/types/models" />
/// <reference types="mongoose/types/schemaoptions" />
/// <reference types="mongoose/types/utility" />
/// <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 { IPaginatorOptions } from '../interfaces/collaterals.interface';
import { ELoanTypes } from '../enums/loan-types.enum';
import { ILoanTransaction, ILoanTransactionDoc, ILoanTransactionLean, ILoanTransactionUpload, ILoanTransactionView, ILoanTransactionViewWithBank, ILoanTransactionWithId } from '../models/LoanTransaction.model';
import { ILoanProductDoc } from '../models/LoanProducts.model';
import { IUploadOption, UploadsService } from './uploads.service';
import { AttachedFilesService } from './attached-files.service';
import { BanksService } from './banks.service';
import { BorrowersDB } from './borrowers.db';
import { CalendarService } from './calendar.service';
import { LoanChargesService } from './loan-charges.service';
import { LoanPaymentsService } from './loan-payments.service';
import { LoanStatementService } from './loan-statement.service';
import { LoanStatementStatusService } from './loan-statement-status.service';
import { NodemailerService } from './nodemailer.service';
import { TermLoanService } from './term-loan.service';
import { LockService } from './lock.service';
import { PostponedTransactionsService } from './postponed-transactions.service';
import { MainQueueService } from './main-queue.service';
interface ILoanTransactionsServiceConfig {
    portfolioEmail: string;
}
export interface ITransactionsFilter {
    periodStart: Date;
    periodEnd: Date;
    borrowerId: string;
    productId: string;
    amount?: number;
    reference?: string;
}
export interface ITransactionsMultiProductsFilter {
    periodStart: Date;
    periodEnd: Date;
    productIds: string[];
    amount?: number;
    reference?: string;
}
export declare class LoanTransactionsService {
    private readonly attachedFilesService;
    private readonly banksService;
    private readonly borrowersDB;
    private readonly calendarService;
    private readonly loanChargesService;
    private readonly getLoanPaymentsService;
    private readonly getLoanStatementService;
    private readonly loanStatementStatusService;
    private readonly getNodemailerService;
    private readonly lockService;
    private readonly termLoanService;
    private readonly uploadsService;
    private readonly postponedTransactionsService;
    private readonly mainQueueService;
    private readonly config;
    constructor(config: ILoanTransactionsServiceConfig, attachedFilesService: AttachedFilesService, banksService: BanksService, borrowersDB: BorrowersDB, calendarService: CalendarService, loanChargesService: LoanChargesService, getLoanPaymentsService: () => LoanPaymentsService, getLoanStatementService: () => LoanStatementService, loanStatementStatusService: LoanStatementStatusService, getNodemailerService: () => NodemailerService, lockService: LockService, termLoanService: TermLoanService, uploadsService: UploadsService, postponedTransactionsService: PostponedTransactionsService, mainQueueService: MainQueueService);
    getTransactionsById(transactionId: string): Promise<mongoose.FlattenMaps<ILoanTransaction> & {
        _id: mongoose.Types.ObjectId;
    }>;
    private getLoanTransactionsInternal;
    getLoanTransactions<T extends boolean>(transactionsFilter: ITransactionsFilter, paginatorOptions: IPaginatorOptions, withBanks: T, isReverse?: boolean, isMinified?: boolean): Promise<(T extends true ? ILoanTransactionViewWithBank : ILoanTransactionView)[]>;
    getLoanTransactionsForProducts<T extends boolean>(transactionsFilter: ITransactionsMultiProductsFilter, paginatorOptions: IPaginatorOptions, withBanks: T, isReverse?: boolean, isMinified?: boolean): Promise<(T extends true ? ILoanTransactionViewWithBank : ILoanTransactionView)[]>;
    getLoanTransactionsForFilter(periodStart: Date, periodEnd: Date, productId: string): Promise<ILoanTransactionView[]>;
    getLoanTransactionsForProduct(productId: string): Promise<ILoanTransactionView[]>;
    getLoanTransactionFiles(): Promise<{
        attachedFileIds: any[];
        userUploaded?: string;
        transactionsId: mongoose.Types.ObjectId[];
        statementIds: mongoose.Types.ObjectId[];
        fileName: string;
        sheetName: string;
        effectiveDate: string;
        _id?: any;
        __v?: any;
        $locals: Record<string, unknown>;
        $op: "save" | "validate" | "remove";
        $where: Record<string, unknown>;
        baseModelName?: string;
        collection: mongoose.Collection<mongoose.mongo.BSON.Document>;
        db: mongoose.Connection;
        errors?: mongoose.Error.ValidationError;
        id?: any;
        isNew: boolean;
        schema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
            [x: string]: unknown;
        }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
            [x: string]: unknown;
        }>> & mongoose.FlatRecord<{
            [x: string]: unknown;
        }> & Required<{
            _id: unknown;
        }>>;
        createdAt: Date;
        updatedAt: Date;
    }[]>;
    getDisbursementTransactions(productId: string, date: Date): Promise<number>;
    getTotalLoanTransactions(transactionsFilter: ITransactionsFilter): Promise<number>;
    uploadLoanTransactions(uploadedItems: ILoanTransactionUpload[], uploadOption: IUploadOption, userId: string, shift?: number): Promise<void>;
    normalizeLoanTransaction(transaction: ILoanTransactionDoc, userId: string): Promise<ILoanTransactionDoc>;
    createLoanTransaction(transaction: Partial<ILoanTransactionWithId>): Promise<ILoanTransactionLean>;
    updateLoanTransaction(transaction: ILoanTransactionDoc): Promise<void>;
    saveLoanTransaction(transaction: Partial<ILoanTransactionLean>): Promise<ILoanTransactionLean>;
    recalculateProduct(productId: string): Promise<void>;
    recalculateBalanceLegacy(transactionId: string): Promise<void>;
    recalculateBalanceQueued(productId: string, transactionId: string): Promise<void>;
    recalculateBalance(transactionId: string): Promise<void>;
    deleteLoanTransaction(transactionId: string, updateLoanPayment: boolean, userId?: any): Promise<void>;
    deleteLoanTransactionFile(transactionFileId: string, userId: string): Promise<any>;
    getFirstTransaction(productId: string, excludeAdjustments?: boolean): Promise<ILoanTransactionDoc>;
    getLastTransactionForDate(productId: string, date?: Date, excludeAdjustments?: boolean): Promise<ILoanTransactionDoc>;
    getLastDisbursementTransactionForDate(productId: string, startDate: Date, endDate: Date): Promise<ILoanTransactionDoc[]>;
    getPaymentsForPeriod(productId: string, startDate: Date, endDate: Date): Promise<ILoanTransactionDoc[]>;
    getLoanBalanceForBBCDateId(BBCDateId: string): Promise<{
        TERM: number;
        REVOLVER: number;
    }>;
    getLoanBalanceForBBCDateIdPerProduct(BBCDateId: string, productType?: ELoanTypes): Promise<{
        [productId: string]: {
            balance: number;
            product: ILoanProductDoc;
        };
    }>;
    getLoanBalanceForBorrowerId(borrowerId: string): Promise<{
        REVOLVER: {
            balance: number;
            lastActivityDate: any;
        };
        TERM: {
            balance: number;
            lastActivityDate: any;
        };
        accruedStatement: {
            balance: number;
            lastActivityDate: any;
        };
        effectiveLoanBalance: {
            balance: number;
            lastActivityDate: any;
        };
    }>;
    getUnsentTransactionForDate(borrowerId: string, date: Date): Promise<ILoanTransactionDoc[]>;
    getTransactionReport(transactionIds: string[], borrowerId: string, effectiveDate: Date): Promise<{
        transactionIdsToMark: string[];
        transactions: {
            [x: string]: (string | number | Date | string[])[];
        }[];
    }>;
    getBorrowerIdsForFile(transactionFileId: string): Promise<{
        [k: string]: boolean;
    }>;
    getEmailBorrowers(transactionFileId: string): Promise<{
        [k: string]: boolean;
    }>;
    sendReport(transactionFileId: string, selectedBorrowerIds: string[]): Promise<void>;
    sendAllReport(effectiveDate: Date): Promise<void>;
    private sendBorrowerReport;
    calculateEffectiveDate(transaction: Partial<ILoanTransactionDoc>): Promise<Date>;
    switchTransactionSentStatus(transactionId: string, isSent?: boolean): Promise<void>;
    checkLockStatus(transaction: ILoanTransactionLean): Promise<boolean>;
}
export {};
