import { get, post } from './apiClient';
import type { HeartbeatStatus, HealthHistory, ServiceStatusDetail } from '../types/service';

export const getHeartbeatStatus = () => get<HeartbeatStatus[]>('/heartbeat/status');
export const getHealthHistory = (serviceId: number) => get<HealthHistory[]>(`/heartbeat/${serviceId}/history`);
export const triggerCheck = (serviceId: number) => post<HeartbeatStatus>(`/heartbeat/${serviceId}/check`);
export const getAllStatusDetail = () => get<ServiceStatusDetail[]>('/heartbeat/status/detail');
export const getServiceStatusDetail = (serviceId: number) => get<ServiceStatusDetail>(`/heartbeat/${serviceId}/status/detail`);
