package com.ffii.fpsms.modules.pickOrder.web.models
import jakarta.validation.constraints.NotBlank
import java.time.LocalTime
data class SaveTruckRequest(
    val id: Long? = null,
    val store_id: String,
    val truckLanceCode: String,
    val departureTime: LocalTime,
    val shopId: Long,
    val shopName: String,
    val shopCode: String,
    val loadingSequence: Int,
    val remark: String? = null,
    val districtReference: String? = null,
    val logisticId: Long? = null,
)
data class SaveTruckLane(
    val id: Long,
    val truckLanceCode: String,
    val departureTime: LocalTime,
    val loadingSequence: Long,
    val districtReference: String?,
    val storeId: String,
    val remark: String? = null,
    val logisticId: Long? = null,
    /** When true, apply [logisticId] (including null to clear); when false, leave truck.logistic unchanged. */
    val updateLogistic: Boolean = false,
)
data class deleteTruckLane(
    val id: Long
)
data class UpdateTruckShopDetailsRequest(
    val id: Long,
    val shopId: Long? = null,
    val shopName: String?,
    val shopCode: String?,
    val loadingSequence: Int,
    val remark: String? = null,
)
data class CreateTruckWithoutShopRequest(
    val store_id: String,
    val truckLanceCode: String,
    val departureTime: LocalTime,
    val loadingSequence: Int = 0,
    val districtReference: String? = null,
    val remark: String? = null,
    val logisticId: Long? = null,
)

/** 單一 transaction 更新同 (truckLanceCode, remark) 桶內所有 truck 的 logistic。 */
data class UpdateLaneLogisticRequest(
    @field:NotBlank
    val truckLanceCode: String,
    val remark: String? = null,
    val logisticId: Long? = null,
)
