package com.cameleer.server.core.alerting;

import java.time.Instant;
import java.util.List;
import java.util.Optional;
import java.util.UUID;

public interface AlertNotificationRepository {
    AlertNotification save(AlertNotification n);
    Optional<AlertNotification> findById(UUID id);
    List<AlertNotification> listForInstance(UUID alertInstanceId);
    List<AlertNotification> claimDueNotifications(String instanceId, int batchSize, int claimTtlSeconds);
    void markDelivered(UUID id, int status, String snippet, Instant when);
    void scheduleRetry(UUID id, Instant nextAttemptAt, int status, String snippet);
    void markFailed(UUID id, int status, String snippet);
    /** Resets a FAILED notification for operator-triggered retry: attempts → 0, status → PENDING. */
    void resetForRetry(UUID id, Instant nextAttemptAt);
    void deleteSettledBefore(Instant cutoff);
}
