import { IAggregationCounter } from './IAggregationCounter'; import { AggregationCounterRef } from './IMessage'; export interface IAggregationCounterAPI { // Tạo counter mới createCounter(params: { requestId: string; stepId: string; targetMessageType: string; expectedCount: number; timeoutMs?: number; parentResults?: any; delayMs?: number; targetMessageAggregationCounters?: AggregationCounterRef[]; }): Promise; // Increment counter incrementCounter(params: { aggregationKey: string; taskType: string; result: any; workerId?: string; messageId?: string; // ID của message đã hoàn thành }): Promise<{ counter: IAggregationCounter | null; isComplete: boolean; messageCreated?: boolean; }>; // Lấy counter theo key getCounterByKey(aggregationKey: string): Promise; // Lấy counters theo requestId getCountersByRequestId(requestId: string): Promise; }