import { Repository } from 'typeorm';
import { NodeBillableIntervalEntity } from '../entities/node-billable-interval.entity';
import { VolumeBillableIntervalEntity, VolumeBillableKind } from '../entities/volume-billable-interval.entity';
import { ClusterEntity } from '../entities/cluster.entity';
import { NodeType } from '../entities/cluster-node.entity';
interface OpenNodeIntervalInput {
    clusterId: string;
    nodeId: string;
    serverName: string;
    providerResourceId?: string;
    provider: string;
    region: string;
    location?: string;
    serverType: string;
    nodeType: NodeType;
    startedAt?: Date;
    metadata?: Record<string, any>;
}
interface OpenVolumeIntervalInput {
    clusterId: string;
    volumeProviderId: string;
    provider: string;
    region: string;
    kind: VolumeBillableKind;
    sizeGb: number;
    startedAt?: Date;
    metadata?: Record<string, any>;
}
export declare class BillingIntervalsService {
    private readonly nodeIntervalRepo;
    private readonly volumeIntervalRepo;
    private readonly logger;
    constructor(nodeIntervalRepo: Repository<NodeBillableIntervalEntity>, volumeIntervalRepo: Repository<VolumeBillableIntervalEntity>);
    openNodeInterval(input: OpenNodeIntervalInput): Promise<void>;
    closeNodeIntervals(nodeId: string, at?: Date): Promise<void>;
    openVolumeInterval(input: OpenVolumeIntervalInput): Promise<void>;
    closeVolumeIntervals(volumeProviderId: string, at?: Date): Promise<void>;
    /**
     * Backfill: for every node and shared volume of every cluster without an
     * open interval, open one starting at the resource's createdAt. Idempotent —
     * called on app startup so pre-existing clusters become billable.
     */
    backfillFromClusters(clusters: ClusterEntity[]): Promise<{
        nodes: number;
        volumes: number;
    }>;
}
export {};
