package dev.adriankuta.flights.ui.home.sample

import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import dev.adriankuta.flights.domain.types.Flight
import dev.adriankuta.flights.domain.types.RegularFare
import dev.adriankuta.flights.domain.types.Segment
import dev.adriankuta.flights.domain.types.Trip
import dev.adriankuta.flights.domain.types.TripDate
import dev.adriankuta.flights.domain.types.TripFare
import dev.adriankuta.flights.domain.types.TripFlight
import kotlinx.datetime.LocalDate

internal class FlightPreviewParameterProvider : PreviewParameterProvider<Flight> {
    override val values: Sequence<Flight> = sequenceOf(
        Flight(
            currency = "EUR",
            currPrecision = 2,
            trips = listOf(
                Trip(
                    origin = "WAW",
                    destination = "LDN",
                    dates = listOf(
                        TripDate(
                            dateOut = LocalDate(2023, 6, 15),
                            flights = listOf(
                                TripFlight(
                                    faresLeft = 5,
                                    regularFare = RegularFare(
                                        fares = listOf(
                                            TripFare(
                                                type = "ADULT",
                                                amount = 99.99,
                                                count = 1,
                                            ),
                                        ),
                                    ),
                                    flightNumber = "FR1234",
                                    dateTimes = listOf(
                                        "2023-06-15T10:00:00",
                                        "2023-06-15T12:30:00",
                                    ),
                                    duration = "2h 30m",
                                    segments = listOf(
                                        Segment(
                                            origin = "WAW",
                                            destination = "LDN",
                                            flightNumber = "FR1234",
                                            dateTimes = listOf(
                                                "2023-06-15T10:00:00",
                                                "2023-06-15T12:30:00",
                                            ),
                                            duration = "2h 30m",
                                        ),
                                    ),
                                    operatedBy = "Ryanair",
                                ),
                            ),
                        ),
                        TripDate(
                            dateOut = LocalDate(2023, 6, 16),
                            flights = listOf(
                                TripFlight(
                                    faresLeft = 3,
                                    regularFare = RegularFare(
                                        fares = listOf(
                                            TripFare(
                                                type = "ADULT",
                                                amount = 129.99,
                                                count = 1,
                                            ),
                                        ),
                                    ),
                                    flightNumber = "FR5678",
                                    dateTimes = listOf(
                                        "2023-06-16T14:00:00",
                                        "2023-06-16T16:15:00",
                                    ),
                                    duration = "2h 15m",
                                    segments = listOf(
                                        Segment(
                                            origin = "WAW",
                                            destination = "LDN",
                                            flightNumber = "FR5678",
                                            dateTimes = listOf(
                                                "2023-06-16T14:00:00",
                                                "2023-06-16T16:15:00",
                                            ),
                                            duration = "2h 15m",
                                        ),
                                    ),
                                    operatedBy = "Ryanair",
                                ),
                            ),
                        ),
                    ),
                ),
                Trip(
                    origin = "LDN",
                    destination = "WAW",
                    dates = listOf(
                        TripDate(
                            dateOut = LocalDate(2023, 6, 22),
                            flights = listOf(
                                TripFlight(
                                    faresLeft = 10,
                                    regularFare = RegularFare(
                                        fares = listOf(
                                            TripFare(
                                                type = "ADULT",
                                                amount = 89.99,
                                                count = 1,
                                            ),
                                        ),
                                    ),
                                    flightNumber = "FR9876",
                                    dateTimes = listOf(
                                        "2023-06-22T08:30:00",
                                        "2023-06-22T10:45:00",
                                    ),
                                    duration = "2h 15m",
                                    segments = listOf(
                                        Segment(
                                            origin = "LDN",
                                            destination = "WAW",
                                            flightNumber = "FR9876",
                                            dateTimes = listOf(
                                                "2023-06-22T08:30:00",
                                                "2023-06-22T10:45:00",
                                            ),
                                            duration = "2h 15m",
                                        ),
                                    ),
                                    operatedBy = "Ryanair",
                                ),
                            ),
                        ),
                    ),
                ),
            ),
        ),
    )
}
