package com.lingniu.ingest.api.event;

/**
 * 实时数据载荷（扁平 record，字段用 {@code Double} / {@code Integer} 允许 null，表达"未上报")。
 *
 * <p>不再复刻旧服务 {@code VehicleDataActual} 的 273 字段巨型类 —— 协议特有细节通过
 * {@link VehicleEvent#metadata()} 传递。此处只保留跨协议通用字段。
 */
public record RealtimePayload(
        // ===== 动力 & 能源 =====
        Double speedKmh,
        Double totalMileageKm,
        Double batterySoc,
        Double batteryVoltageV,
        Double batteryCurrentA,

        // ===== 燃料电池 / 氢能 =====
        Double fcVoltageV,
        Double fcCurrentA,
        Double fcTempC,
        Double hydrogenRemainingKg,
        Double hydrogenHighPressureMpa,
        Double hydrogenLowPressureMpa,

        // ===== 车辆状态 =====
        VehicleState vehicleState,
        ChargingState chargingState,
        RunningMode runningMode,
        Integer gearLevel,
        Double acceleratorPedal,
        Double brakePedal,

        // ===== 位置（冗余一份便于单主题消费）=====
        Double longitude,
        Double latitude,
        Double altitudeM,
        Double directionDeg,

        // ===== 环境 =====
        Double ambientTempC,
        Double coolantTempC
) {

    public enum VehicleState { STARTED, SHUTDOWN, OTHER, INVALID }

    public enum ChargingState { UNCHARGED, PARKED_CHARGING, DRIVING_CHARGING, CHARGED, OTHER, INVALID }

    public enum RunningMode { ELECTRIC, HYBRID, FUEL, OTHER, INVALID }
}
