import 'package:dio/dio.dart';

class HealthApi {
  HealthApi(this._dio);
  final Dio _dio;

  /// Returns {status, min_client_version}. Hits the unauthenticated
  /// `/healthz` endpoint at the configured base URL.
  Future<Map<String, String>> check() async {
    final r = await _dio.get<Map<String, dynamic>>('/healthz');
    return (r.data ?? const <String, dynamic>{})
        .map((k, v) => MapEntry(k, v.toString()));
  }
}
