package space.nstart.pcp.pcp_satellites_service.model.mode

import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import java.time.LocalDateTime

class SurveyModeTest {

    @Test
    fun `toDTO preserves slot ids and coordinates`() {
        val timeStart = LocalDateTime.of(2026, 3, 31, 12, 0)
        val timeStop = timeStart.plusMinutes(10)
        val surveyMode = SurveyMode(
            revolution = 42,
            time = timeStart,
            timeStop = timeStop,
            roll = 3.5,
            latitude = 55.75,
            longitude = 37.62,
            duration = 600.0,
            contourWKT = "POLYGON ((0 0, 1 0, 1 1, 0 0))",
            bookedSlotIds = listOf(10L, 20L)
        )

        val dto = surveyMode.toDTO()

        assertEquals(timeStart, dto.time)
        assertEquals(timeStop, dto.timStop)
        assertEquals(listOf(10L, 20L), dto.slotIds)
        assertEquals(55.75, dto.latitude)
        assertEquals(37.62, dto.longitude)
    }
}
