package pl.firmatpp.kierowca.data.model

data class RequestOtpBody(val phoneNumber: String)

data class VerifyOtpBody(
    val phoneNumber: String,
    val code: String,
    val deviceName: String,
)

data class OtpResponse(
    val ok: Boolean,
    val phoneMasked: String?,
    val expiresInSeconds: Int?,
)

data class VerifyOtpResponse(
    val ok: Boolean,
    val accessToken: String?,
    val expiresAt: String?,
    val driver: DriverDto?,
)

data class DriverDto(
    val id: String,
    val displayName: String,
    val anonymousLabel: String?,
)

data class BootstrapResponse(
    val session: DriverSessionDto,
    val routes: RoutesBucketDto,
    val driverAppSettings: DriverAppSettingsDto?,
)

data class DriverAppSettingsDto(
    val minDate: String,
    val maxDate: String,
    val today: String,
    val selectedDate: String,
    val maxPastDays: Int,
    val autoRefreshSeconds: Int,
    val allowGalleryUploads: Boolean?,
)

data class DriverSessionDto(
    val driver: DriverDto,
    val lastSyncAt: String,
)

data class RoutesBucketDto(
    val today: List<DriverRouteDto> = emptyList(),
)

data class RouteResponse(
    val route: DriverRouteDto,
)

data class DriverRouteDto(
    val id: String,
    val startsAt: String,
    val originName: String,
    val destinationName: String,
    val contractorName: String,
    val contractName: String?,
    val contractCode: String?,
    val relationLabel: String,
    val status: String,
    val distanceKm: Double?,
    val notes: String?,
    val truck: TruckDto?,
    val originNavigation: NavigationPointDto? = null,
    val destinationNavigation: NavigationPointDto? = null,
    val photos: List<RoutePhotoDto> = emptyList(),
)

data class TruckDto(
    val id: String,
    val registration: String?,
    val trailerRegistration: String? = null,
    val name: String?,
)

data class NavigationPointDto(
    val id: String,
    val label: String?,
    val latitude: Double?,
    val longitude: Double?,
)

data class RoutePhotoDto(
    val id: String,
    val routeId: String,
    val source: String,
    val mimeType: String?,
    val size: Long,
    val url: String,
    val takenAt: String?,
    val latitude: Double?,
    val longitude: Double?,
    val locationAccuracyMeters: Double?,
    val createdAt: String?,
)

data class PhotoUploadResponse(
    val photo: RoutePhotoDto,
)
