import { PrismaService } from '@hed-hog/api-prisma';
import { OutboxEvent, OutboxEventStatus } from '../types';
export interface CreateOutboxEventDto {
    eventName: string;
    sourceModule: string;
    aggregateType: string;
    aggregateId: string;
    payload: Record<string, any>;
}
export interface OutboxEventPersistenceClient {
    outbox_event: PrismaService['outbox_event'];
}
export declare class OutboxService {
    private readonly prisma;
    constructor(prisma: PrismaService);
    private toDomainEvent;
    private toDatabaseId;
    private toDatabaseUpdate;
    /**
     * Write a new event to the outbox
     */
    createEvent(dto: CreateOutboxEventDto, persistenceClient?: OutboxEventPersistenceClient): Promise<OutboxEvent>;
    /**
     * Find pending events available for processing, ordered by creation time
     */
    findPending(limit: number, leaseMs: number): Promise<OutboxEvent[]>;
    /**
     * Update event status and related fields
     */
    updateStatus(eventId: string | number, status: OutboxEventStatus, partialUpdate?: {
        attemptCount?: number;
        lastError?: string | null;
        availableAt?: Date;
        processedAt?: Date | null;
    }): Promise<OutboxEvent>;
    /**
     * Mark event as processing and set lease time
     */
    markProcessing(eventId: string | number, leaseMs: number): Promise<OutboxEvent>;
    /**
     * Increment attempt count and optionally update error
     */
    incrementAttempt(eventId: string | number, error?: string): Promise<OutboxEvent>;
    /**
     * Get event by ID
     */
    getById(eventId: string | number): Promise<OutboxEvent | null>;
    /**
     * Count events by status
     */
    countByStatus(status: OutboxEventStatus): Promise<number>;
}
//# sourceMappingURL=outbox.service.d.ts.map