package com.gcsc.connection.monitoring.dto;

import com.gcsc.connection.monitoring.entity.SnpServiceHealthLog;

import java.time.LocalDateTime;

public record RecentCheckResponse(
    String status,
    Integer responseTime,
    String errorMessage,
    LocalDateTime checkedAt
) {
    public static RecentCheckResponse from(SnpServiceHealthLog log) {
        return new RecentCheckResponse(
            log.getCurrentStatus(),
            log.getResponseTime(),
            log.getErrorMessage(),
            log.getCheckedAt()
        );
    }
}
