/// <reference types="mongoose/types/types" />
/// <reference types="mongoose/types/document" />
/// <reference types="mongoose/types/models" />
/// <reference types="mongoose/types/collection" />
/// <reference types="mongoose/types/connection" />
/// <reference types="mongoose/types/query" />
/// <reference types="mongoose/types/error" />
/// <reference types="mongoose/types/populate" />
/// <reference types="mongoose/types/utility" />
/// <reference types="mongoose/types/schemaoptions" />
/// <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" />
/// <reference types="mongoose/types/inferschematype" />
import { IProductBrokerView } from '../models/ProductBroker.model';
import { ILoanBrokerEmail, ILoanBrokerView } from '../models/LoanBroker.model';
import { LoanChargesService } from './loan-charges.service';
type BrokerView = Omit<IProductBrokerView, '_id'> & {
    _id: string;
};
type BrokerTotalView = Omit<IProductBrokerView, 'productId'> & {
    productId: string;
};
type ShareType = 'adminShare' | 'interestShare' | 'otherShare';
type ShareValue = {
    [_ in ShareType]: number;
};
type ProductTotal = {
    [product_id: string]: ShareValue;
};
export declare class BrokersService {
    private readonly loanChargesService;
    constructor(loanChargesService: LoanChargesService);
    normalizeObjects(): Promise<void>;
    getAllProductBrokers(): Promise<(import("mongoose").FlattenMaps<import("../models/ProductBroker.model").IProductBrokerDoc> & Required<{
        _id: import("mongoose").Types.ObjectId;
    }>)[]>;
    getBorrowerBrokers(borrowerId: string): Promise<(import("mongoose").FlattenMaps<import("../models/ProductBroker.model").IProductBrokerDoc> & Required<{
        _id: import("mongoose").Types.ObjectId;
    }>)[] | BrokerView[]>;
    getProductBrokers(productId: string): Promise<import("../models/ProductBroker.model").IProductBrokerDocWithBroker[]>;
    getTotalShares(borrowerId: string, brokers: IProductBrokerView[], replaceNames?: boolean): Promise<ProductTotal>;
    getTotals(borrowerId: string): Promise<BrokerTotalView[]>;
    checkTotalShares(borrowerId: string, brokers: IProductBrokerView[]): Promise<boolean>;
    saveProductBrokers(borrowerId: string, brokers: IProductBrokerView[]): Promise<import("mongodb").BulkWriteResult>;
    getAllLoanBrokers(): Promise<{
        emails: import("mongoose").FlattenMaps<ILoanBrokerEmail>[];
        order: number;
        active: boolean;
        name: string;
        _id: any;
        __v?: any;
        $assertPopulated: <Paths = {}>(path: string | string[], values?: Partial<Paths>) => Omit<import("../models/LoanBroker.model").ILoanBrokerDoc, keyof Paths> & Paths;
        $clone: () => import("../models/LoanBroker.model").ILoanBrokerDoc;
        $getAllSubdocs: () => import("mongoose").Document<any, any, any>[];
        $ignore: (path: string) => void;
        $isDefault: (path: string) => boolean;
        $isDeleted: (val?: boolean) => boolean;
        $getPopulatedDocs: () => import("mongoose").Document<any, any, any>[];
        $inc: (path: string | string[], val?: number) => import("../models/LoanBroker.model").ILoanBrokerDoc;
        $isEmpty: (path: string) => boolean;
        $isValid: (path: string) => boolean;
        $locals: import("mongoose").FlattenMaps<Record<string, unknown>>;
        $markValid: (path: string) => void;
        $model: {
            <ModelType = import("mongoose").Model<unknown, {}, {}, {}, import("mongoose").Document<unknown, {}, unknown> & Required<{
                _id: unknown;
            }>, any>>(name: string): ModelType;
            <ModelType_1 = import("mongoose").Model<any, {}, {}, {}, any, any>>(): ModelType_1;
        };
        $op: "save" | "validate" | "remove";
        $session: (session?: import("mongodb").ClientSession) => import("mongodb").ClientSession;
        $set: {
            (path: string | Record<string, any>, val: any, type: any, options?: import("mongoose").DocumentSetOptions): import("../models/LoanBroker.model").ILoanBrokerDoc;
            (path: string | Record<string, any>, val: any, options?: import("mongoose").DocumentSetOptions): import("../models/LoanBroker.model").ILoanBrokerDoc;
            (value: string | Record<string, any>): import("../models/LoanBroker.model").ILoanBrokerDoc;
        };
        $where: import("mongoose").FlattenMaps<Record<string, unknown>>;
        baseModelName?: string;
        collection: import("mongoose").Collection<import("bson").Document>;
        db: import("mongoose").FlattenMaps<import("mongoose").Connection>;
        deleteOne: (options?: import("mongoose").QueryOptions<unknown>) => any;
        depopulate: (path?: string | string[]) => import("../models/LoanBroker.model").ILoanBrokerDoc;
        directModifiedPaths: () => string[];
        equals: (doc: import("mongoose").Document<any, any, any>) => boolean;
        errors?: import("mongoose").Error.ValidationError;
        get: {
            <T extends string | number | symbol>(path: T, type?: any, options?: any): any;
            (path: string, type?: any, options?: any): any;
        };
        getChanges: () => import("mongoose").UpdateQuery<import("../models/LoanBroker.model").ILoanBrokerDoc>;
        id?: any;
        increment: () => import("../models/LoanBroker.model").ILoanBrokerDoc;
        init: (obj: import("mongoose").AnyObject, opts?: import("mongoose").AnyObject) => import("../models/LoanBroker.model").ILoanBrokerDoc;
        invalidate: {
            <T_1 extends string | number | symbol>(path: T_1, errorMsg: string | NativeError, value?: any, kind?: string): NativeError;
            (path: string, errorMsg: string | NativeError, value?: any, kind?: string): NativeError;
        };
        isDirectModified: {
            <T_2 extends string | number | symbol>(path: T_2 | T_2[]): boolean;
            (path: string | string[]): boolean;
        };
        isDirectSelected: {
            <T_3 extends string | number | symbol>(path: T_3): boolean;
            (path: string): boolean;
        };
        isInit: {
            <T_4 extends string | number | symbol>(path: T_4): boolean;
            (path: string): boolean;
        };
        isModified: {
            <T_5 extends string | number | symbol>(path?: T_5 | T_5[], options?: {
                ignoreAtomics?: boolean;
            }): boolean;
            (path?: string | string[], options?: {
                ignoreAtomics?: boolean;
            }): boolean;
        };
        isNew: boolean;
        isSelected: {
            <T_6 extends string | number | symbol>(path: T_6): boolean;
            (path: string): boolean;
        };
        markModified: {
            <T_7 extends string | number | symbol>(path: T_7, scope?: any): void;
            (path: string, scope?: any): void;
        };
        model: {
            <ModelType_2 = import("mongoose").Model<unknown, {}, {}, {}, import("mongoose").Document<unknown, {}, unknown> & Required<{
                _id: unknown;
            }>, any>>(name: string): ModelType_2;
            <ModelType_3 = import("mongoose").Model<any, {}, {}, {}, any, any>>(): ModelType_3;
        };
        modifiedPaths: (options?: {
            includeChildren?: boolean;
        }) => string[];
        overwrite: (obj: import("mongoose").AnyObject) => import("../models/LoanBroker.model").ILoanBrokerDoc;
        $parent: () => import("mongoose").Document<any, any, any>;
        populate: {
            <Paths_1 = {}>(path: string | import("mongoose").PopulateOptions | (string | import("mongoose").PopulateOptions)[]): Promise<import("mongoose").MergeType<import("../models/LoanBroker.model").ILoanBrokerDoc, Paths_1>>;
            <Paths_2 = {}>(path: string, select?: string | import("mongoose").AnyObject, model?: import("mongoose").Model<any, {}, {}, {}, any, any>, match?: import("mongoose").AnyObject, options?: import("mongoose").PopulateOptions): Promise<import("mongoose").MergeType<import("../models/LoanBroker.model").ILoanBrokerDoc, Paths_2>>;
        };
        populated: (path: string) => any;
        replaceOne: (replacement?: import("mongoose").AnyObject, options?: import("mongoose").QueryOptions<unknown>) => import("mongoose").Query<any, import("../models/LoanBroker.model").ILoanBrokerDoc, {}, import("../models/LoanBroker.model").ILoanBrokerDoc, "find">;
        save: (options?: import("mongoose").SaveOptions) => Promise<import("../models/LoanBroker.model").ILoanBrokerDoc>;
        schema: import("mongoose").FlattenMaps<import("mongoose").Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
            [x: string]: unknown;
        }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
            [x: string]: unknown;
        }>> & import("mongoose").FlatRecord<{
            [x: string]: unknown;
        }> & Required<{
            _id: unknown;
        }>>>;
        set: {
            <T_8 extends string | number | symbol>(path: T_8, val: any, type: any, options?: import("mongoose").DocumentSetOptions): import("../models/LoanBroker.model").ILoanBrokerDoc;
            (path: string | Record<string, any>, val: any, type: any, options?: import("mongoose").DocumentSetOptions): import("../models/LoanBroker.model").ILoanBrokerDoc;
            (path: string | Record<string, any>, val: any, options?: import("mongoose").DocumentSetOptions): import("../models/LoanBroker.model").ILoanBrokerDoc;
            (value: string | Record<string, any>): import("../models/LoanBroker.model").ILoanBrokerDoc;
        };
        toJSON: {
            <T_9 = any>(options?: import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & Required<{
                _id: unknown;
            }>> & {
                flattenMaps?: true;
            }): import("mongoose").FlattenMaps<T_9>;
            <T_10 = any>(options: import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & Required<{
                _id: unknown;
            }>> & {
                flattenMaps: false;
            }): T_10;
        };
        toObject: <T_11 = any>(options?: import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & Required<{
            _id: unknown;
        }>>) => import("mongoose").Require_id<T_11>;
        unmarkModified: {
            <T_12 extends string | number | symbol>(path: T_12): void;
            (path: string): void;
        };
        updateOne: (update?: import("mongoose").UpdateWithAggregationPipeline | import("mongoose").UpdateQuery<import("../models/LoanBroker.model").ILoanBrokerDoc>, options?: import("mongoose").QueryOptions<unknown>) => import("mongoose").Query<any, import("../models/LoanBroker.model").ILoanBrokerDoc, {}, import("../models/LoanBroker.model").ILoanBrokerDoc, "find">;
        validate: {
            <T_13 extends string | number | symbol>(pathsToValidate?: T_13 | T_13[], options?: import("mongoose").AnyObject): Promise<void>;
            (pathsToValidate?: import("mongoose").PathsToValidate, options?: import("mongoose").AnyObject): Promise<void>;
            (options: {
                pathsToSkip?: import("mongoose").pathsToSkip;
            }): Promise<void>;
        };
        validateSync: {
            (options: {
                [k: string]: any;
                pathsToSkip?: import("mongoose").pathsToSkip;
            }): import("mongoose").Error.ValidationError;
            <T_14 extends string | number | symbol>(pathsToValidate?: T_14 | T_14[], options?: import("mongoose").AnyObject): import("mongoose").Error.ValidationError;
            (pathsToValidate?: import("mongoose").PathsToValidate, options?: import("mongoose").AnyObject): import("mongoose").Error.ValidationError;
        };
    }[]>;
    saveLoanBrokers(brokers: ILoanBrokerView[]): Promise<void>;
    saveLoanBroker(broker: Partial<ILoanBrokerView>, order: number): Promise<void>;
    saveLoanBrokerEmails(loanBrokerId: string, emails: ILoanBrokerEmail[]): Promise<void>;
}
export {};
