package com.cameleer.server.core.alerting;

import java.time.Instant;
import java.util.Map;
import java.util.UUID;

public record AlertNotification(
        UUID id,
        UUID alertInstanceId,
        UUID webhookId,
        UUID outboundConnectionId,
        NotificationStatus status,
        int attempts,
        Instant nextAttemptAt,
        String claimedBy,
        Instant claimedUntil,
        Integer lastResponseStatus,
        String lastResponseSnippet,
        Map<String, Object> payload,
        Instant deliveredAt,
        Instant createdAt) {

    public AlertNotification {
        payload = payload == null ? Map.of() : Map.copyOf(payload);
    }
}
