import { Repository } from 'typeorm';
import { Invoice } from '../entities/Invoice';
import { BaseRepository } from './base.repository';
export declare class InvoiceRepository extends BaseRepository<Invoice> {
    constructor(repository: Repository<Invoice>);
    findByIdWithStoredFiles(id: string): Promise<Invoice | null>;
    private parseAmount;
    private parseS3ArtifactKeys;
    private resolveInvoiceFileRefs;
    private isMissingInvoiceDetailsRelationError;
    /** Invoice row -> 1-based O&M display year (1..10) from om_start_date; fallback to cached scheme.om_year. */
    private deriveOmYearFromBillRow;
    /** 1–12 for display (ordinal month within O&M cycle or calendar month fallback). */
    private resolveOmPeriodMonth;
    private mapDashboardRow;
    private mapSubmittedInvoiceRow;
    private invoiceYearCondition;
    /**
     * Parse YYYY-MM-DD for query filters; returns null if invalid.
     */
    private parseOptionalYmdDate;
    /**
     * When both start and end are valid and start <= end, append date params to filterValues
     * and return a parameterized BETWEEN on the invoice business date; otherwise return year-based condition (no extra params).
     */
    private appendInvoiceDateFilter;
    private pushSchemeFilters;
    /** Filter aggregated scheme rows (use WHERE on subquery alias `agg`). */
    private dashboardRowWhereClause;
    getDashboardData(filters?: any, page?: number, limit?: number): Promise<{
        data: any[];
        pagination: any;
        summary: any;
    }>;
    getSchemeDashboardDetail(schemeId: string, options?: {
        fromPage?: string;
        year?: number | null;
    }): Promise<any | null>;
    findByAgencyId(agencyId: string, page?: number, limit?: number): Promise<{
        data: Invoice[];
        pagination: any;
    }>;
    findBySchemeId(schemeId: string, page?: number, limit?: number): Promise<{
        data: Invoice[];
        pagination: any;
    }>;
    /**
     * All non-deleted invoices for a scheme, ordered for O&M 10-year billing aggregation.
     * Unpaginated — do not use for large list APIs.
     */
    listAllBySchemeIdOrdered(schemeId: string): Promise<Invoice[]>;
    findByInvoiceNumber(agencyId: string, invoiceNumber: string): Promise<Invoice | null>;
    findBySubmitStatus(agencyId: string, submitStatus: boolean): Promise<Invoice[]>;
    private resolveSubmittedListSummaryFilter;
    getSubmittedInvoiceData(filters?: any, page?: number, limit?: number): Promise<{
        data: any[];
        pagination: any;
        summary: any;
    }>;
    findByStatus(agencyId: string, status: string): Promise<Invoice[]>;
    getUnsubmittedSchemesSummary(filters?: any): Promise<{
        schemeSummary: {
            totalSchemes: number;
            activeOmSchemes: number;
        };
        data: any[];
    }>;
    isInvoiceNumberUnique(agencyId: string, invoiceNumber: string, excludeId?: string | null): Promise<boolean>;
    findByDateRange(agencyId: string, startDate: Date, endDate: Date): Promise<Invoice[]>;
    /**
     * Active invoice for scheme + billing month, including s3_artifact_keys (normally select:false).
     */
    findActiveBySchemeBillingPeriodWithS3Keys(schemeId: string, billingPeriodKey: string): Promise<Invoice | null>;
    existsForSchemeBillingPeriodKey(schemeId: string, billingPeriodKey: string): Promise<boolean>;
    /**
     * Per-scheme paid totals + all-invoice totals (all workflow statuses except deleted).
     */
    getPaidSchemesAggregates(filters?: any, page?: number, limit?: number): Promise<{
        data: any[];
        pagination: any;
    }>;
    updateGeneratedHtmlPath(id: string, relativePath: string): Promise<void>;
    updateGeneratedDocumentPaths(id: string, htmlFileName: string, pdfFileName: string): Promise<void>;
    updateGeneratedPdfPath(id: string, relativePath: string): Promise<void>;
}
//# sourceMappingURL=invoice.repository.d.ts.map