import { DataSource, Repository } from 'typeorm';
import { ClientDataEntity } from './client-data.entity';
import { NewsurveSurvesEntity } from './newsurve-surves.entity';
import { ListClientsDto } from './dto/list-clients.dto';
import { ClientStandardEntity } from './client-standard.entity';
export type ClientSource = 'QRS' | 'TQS';
export type ClientRecordType = 'Client' | 'Surveillance';
export interface ClientRowDto {
    id: number;
    source: ClientSource;
    client_type: ClientRecordType;
    user_id: number;
    company_name: string | null;
    contact_primary: string | null;
    designationpr: string | null;
    telephone: string | null;
    mobile_no: string | null;
    email_id: string | null;
    Address: string | null;
    company_sector: string | null;
    standard_name: string | null;
    standard_names: string[];
    signed_docs?: string | null;
    signeddocsname?: string | null;
    status?: number | null;
    created_at?: Date | null;
    updated_at?: Date | null;
    [key: string]: any;
}
export declare class ClientsService {
    private readonly qrsClientRepo;
    private readonly qrsSurveRepo;
    private readonly qrsStandardRepo;
    private readonly tqsClientRepo;
    private readonly tqsSurveRepo;
    private readonly tqsStandardRepo;
    private readonly qrsDataSource;
    private readonly tqsDataSource;
    private readonly schemeDb;
    private readonly logger;
    constructor(qrsClientRepo: Repository<ClientDataEntity>, qrsSurveRepo: Repository<NewsurveSurvesEntity>, qrsStandardRepo: Repository<ClientStandardEntity>, tqsClientRepo: Repository<ClientDataEntity>, tqsSurveRepo: Repository<NewsurveSurvesEntity>, tqsStandardRepo: Repository<ClientStandardEntity>, qrsDataSource: DataSource, tqsDataSource: DataSource, schemeDb: DataSource);
    private sourceIdCache;
    resolveSourceUserId(schemeUserId: number, source: ClientSource): Promise<number | null>;
    clearIdMapCache(): void;
    userCanViewAll(userId: number): Promise<boolean>;
    private repoFor;
    private standardCache;
    private getStandardMap;
    private resolveStandardNames;
    private fetchSlice;
    listPaged(q: ListClientsDto, currentUserId: number): Promise<{
        rows: ClientRowDto[];
        total: number;
        page: number;
        limit: number;
        totalPages: number;
    }>;
    getClientsPagedFiltered(q: ListClientsDto, currentUserId: number): Promise<{
        rows: ClientRowDto[];
        total: number;
        page: number;
        limit: number;
        totalPages: number;
    }>;
    getSurvesPagedFiltered(q: ListClientsDto, currentUserId: number): Promise<{
        rows: ClientRowDto[];
        total: number;
        page: number;
        limit: number;
        totalPages: number;
    }>;
    getAllCombinedPaged(q: ListClientsDto, currentUserId: number): Promise<{
        rows: ClientRowDto[];
        total: number;
        page: number;
        limit: number;
        totalPages: number;
    }>;
    private normalizeCompanyKey;
    searchExact(name: string, source: ClientSource, currentUserId: number): Promise<{
        rows: ClientRowDto[];
    }>;
    getClientDetails(id: number, source: ClientSource, type: ClientRecordType, currentUserId: number): Promise<{
        client_ref_id: any;
        client_group: ClientSource;
        company_source: ClientRecordType;
        company_name: any;
        auditee_name: any;
        auditee_designation: any;
        auditee_contact: any;
        auditee_email: any;
        auditees: {
            name: any;
            designation: any;
        }[];
        location: any;
        standard_name: any;
        standard_names: string[];
        accreditation: string;
        meta: {
            company_sector: any;
            trade_license: any;
            vat_no: any;
            employee_no: any;
            site_no: any;
            head_office: any;
            contact_finance: any;
            email_finance: any;
            signed_docs: any;
            signeddocsname: any;
        };
    } | null>;
    describeScope(currentUserId: number): Promise<{
        scheme_user_id: number;
        can_view_all: boolean;
        qrs_user_id: number | null;
        tqs_user_id: number | null;
        note: string | undefined;
    }>;
}
