package com.cameleer.server.app.alerting.dto;

import com.cameleer.server.core.alerting.AlertSilence;
import com.cameleer.server.core.alerting.SilenceMatcher;

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

public record AlertSilenceResponse(
        UUID id,
        UUID environmentId,
        SilenceMatcher matcher,
        String reason,
        Instant startsAt,
        Instant endsAt,
        String createdBy,
        Instant createdAt
) {
    public static AlertSilenceResponse from(AlertSilence s) {
        return new AlertSilenceResponse(
                s.id(), s.environmentId(), s.matcher(), s.reason(),
                s.startsAt(), s.endsAt(), s.createdBy(), s.createdAt());
    }
}
