package space.nstart.pcp.pcp_satellites_service.service

import org.springframework.stereotype.Component
import space.nstart.pcp.pcp_satellites_service.entity.SatelliteModeSnapshotEntity
import space.nstart.pcp.pcp_types_lib.dto.satellite.mission.SatelliteModeSnapshotResponseDTO

@Component
class SatelliteModeSnapshotMapper {

    fun toResponse(entity: SatelliteModeSnapshotEntity): SatelliteModeSnapshotResponseDTO =
        SatelliteModeSnapshotResponseDTO(
            id = entity.id ?: 0,
            satelliteId = entity.satelliteId,
            intervalStart = entity.intervalStart,
            intervalEnd = entity.intervalEnd,
            createdAt = entity.createdAt,
            isActive = entity.isActive,
            complexPlanRunId = entity.complexPlanRun?.id
        )
}
