package com.ffii.fpsms.modules.deliveryOrder.web.models

import java.time.LocalDateTime
import java.time.LocalDate
import java.time.LocalTime

data class TicketReleaseTableResponse(
    val id: Long?,
    val storeId: String?,
    val ticketNo: String?,
    val pickOrderId: Long?,
    val doOrderId: Long?,
    val pickOrderCode: String?,
    val deliveryOrderCode: String?,
    val loadingSequence: Int?,
    val ticketStatus: String?,
    val truckId: Long?,
    val truckDepartureTime: LocalTime?,
    val shopId: Long?,
    val handledBy: Long?,
    val ticketReleaseTime: LocalDateTime?,
    val ticketCompleteDateTime: LocalDateTime?,
    val truckLanceCode: String?,
    val shopCode: String?,
    val shopName: String?,
    val requiredDeliveryDate: LocalDate?,
    val handlerName: String?,
    val numberOfFGItems: Int = 0,
    /** true：資料來自進行中的 do_pick_order，id 可作 force-complete / revert-assignment；false：來自已歸檔的 record */
    val isActiveDoPickOrder: Boolean = false,
)
data class TruckInfoDto(
    val id: Long?,
    val truckLanceCode: String?,
    val departureTime: String?, // or LocalTime?
    val storeId: String?,
    val shopCode: String?,
    val shopName: String?
)

data class ProblemDoDto(
    val deliveryOrderId: Long,
    val deliveryOrderCode: String?,
    val targetDate: LocalDate,
    val availableTrucks: List<TruckInfoDto>
)

data class Check4FTruckBatchResponse(
    val hasProblem: Boolean,
    val problems: List<ProblemDoDto>
)