import { DataSource } from 'typeorm';
import { PdfService } from '../pdf/pdf.service';
import { CompanyDocumentsService } from './company-documents.service';
import { Auditee } from './auditee';
export declare const CRM_JOB_SOURCE = "crm-company";
export declare const JOB_DOCS_MODULE = "job-documents";
export interface CreateJobsBody {
    audit_schedule_row_id: number;
    stage?: string;
    templateIds: number[];
    leadAuditorId?: number | null;
    standardIds?: number[];
    date?: string;
    docReview?: string | null;
    numEmployees?: number | string | null;
    naceEacCodes?: string | null;
    md?: string | null;
    mdRisk?: string | null;
    scheduleSlot?: string | null;
    technicalExpert?: string | null;
    expectedSurveillanceDate?: string | null;
    expectedIADate?: string | null;
    expectedMRMDate?: string | null;
    expectedInitialInquiryDate?: string | null;
    expectedInitial_Stage1_Date?: string | null;
    prepareDate?: string | null;
    approvedDate?: string | null;
    auditee?: Auditee | null;
    updateCompany?: boolean;
}
export declare class CompanyJobsService {
    private readonly db;
    private readonly cert;
    private readonly pdf;
    private readonly docs;
    private readonly logger;
    private tplCache;
    constructor(db: DataSource, cert: DataSource, pdf: PdfService, docs: CompanyDocumentsService);
    access(userId: number): Promise<{
        view: boolean;
        stages: ('Stage 1' | 'Stage 2')[];
        source: 'legacy' | 'permissions' | 'none';
    }>;
    canUse(userId: number): Promise<boolean>;
    legacyCanUse(userId: number): Promise<boolean>;
    private assert;
    private templateList;
    private recommendedIds;
    formData(companyId: number, userId: number): Promise<{
        company: any;
        audits: any[];
        templates: {
            id: number;
            name: string;
            stage_name: "Stage 1" | "Stage 2";
            prints: string[];
        }[];
        allowed_stages: ("Stage 1" | "Stage 2")[];
        initial_only: boolean;
        duplicates: {
            id: number;
            name: any;
            company_code: any;
            contact_person: any;
            mobile: any;
            email: any;
        }[];
        can_update_company: boolean;
        users: {
            id: any;
            name: any;
            is_auditor: boolean;
        }[];
        standards: any[];
    }>;
    createJobs(companyId: number, body: CreateJobsBody, userId: number): Promise<{
        created: number;
        jobs: {
            id: number;
            jobCode: string;
            template: string;
            stage: string;
        }[];
        company_updated: string[];
    }>;
    private nextJobCode;
    listForCompany(companyId: number, userId: number): Promise<{
        id: any;
        jobCodes: string[];
        stage: any;
        date: any;
        template: any;
        standards: any[];
        lead_auditor: any;
        audit_schedule_row_id: any;
        created_at: any;
        pdf_url: string;
    }[]>;
    jobPdf(jobId: number, userId: number): Promise<{
        buf: Buffer;
        name: string;
    }>;
    private renderJob;
    private renderJobDocx;
    jobDocx(jobId: number, userId: number): Promise<{
        buf: Buffer;
        name: string;
    }>;
    private wordQueue;
    private htmlToDocx;
    private wordLayoutHtml;
    private imgCache;
    private embedImages;
    private wordFriendlyHtml;
    private renderJobHtml;
    zipStage(companyId: number, stage: string, userId: number, res: any, format?: 'pdf' | 'docx'): Promise<void>;
    private snapKey;
    private auditeeSources;
    private saveAuditeeToCompany;
    private assertAdmin;
    transferUsers(userId: number): Promise<{
        id: number;
        name: any;
        email: any;
        job_docs: boolean;
        transferred: number;
    }[]>;
    transferPreview(userId: number, month: string, type: string): Promise<{
        ready: boolean;
        month: string;
        audits: {
            id: number;
            audit_code: any;
            audit_type: any;
            audit_stage: any;
            status: any;
            company_id: number;
            company_name: any;
            company_code: any;
            schedule_date: any;
            lead_auditor: any;
            standards: any[];
            documents: number;
            assigned_to: number | null;
            assigned_to_name: any;
            assigned_at: any;
        }[];
    }>;
    private assertReady;
    transfer(userId: number, body: {
        toUserId: number;
        rowIds: number[];
        note?: string;
    }): Promise<{
        transferred: number;
        to: number;
    }>;
    untransfer(userId: number, body: {
        rowIds: number[];
    }): Promise<{
        removed: number;
    }>;
    transferSummary(userId: number): Promise<{
        ready: boolean;
        groups: {
            user_id: number;
            name: any;
            month: any;
            audits: number;
            companies: number;
            row_ids: number[];
        }[];
    }>;
    myTransfers(userId: number): Promise<{
        mode: "all";
        audits: number;
        months: string[];
    } | {
        mode: "initial";
        audits: number;
        months: string[];
    } | {
        mode: "transferred";
        audits: number;
        months: any[];
    }>;
    private json;
    static isCrmSnapshot(snap: any): any;
}
