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

import com.ffii.fpsms.modules.deliveryOrder.entity.DeliveryOrderLine
import com.ffii.fpsms.modules.deliveryOrder.enums.DeliveryOrderStatus
import com.ffii.fpsms.modules.deliveryOrder.enums.DeliveryOrderStatusConverter
import com.ffii.fpsms.modules.master.entity.Shop
import jakarta.persistence.Convert
import org.springframework.beans.factory.annotation.Value
import java.time.LocalDateTime

interface DeliveryOrderInfo{
    val id: Long
    val code: String
    val orderDate: LocalDateTime?
    val estimatedArrivalDate: LocalDateTime?

    @get:Value("#{target.status.value}")
    val status: String?

    @get:Value("#{target.shop?.name}")
    val shopName: String?

    @get:Value("#{target.supplier?.name}")
    val supplierName: String?

    @get:Value("#{target.shop?.addr3}")
    val shopAddress: String?

    val deliveryOrderLines: List<DeliveryOrderLineInfo>

}
interface DeliveryOrderInfoLite {
    val id: Long
    val code: String
    val orderDate: LocalDateTime?
    val estimatedArrivalDate: LocalDateTime?

    @get:Value("#{target.status.value}")
    val status: String?

    @get:Value("#{target.shop?.name}")
    val shopName: String?

    @get:Value("#{target.supplier?.name}")
    val supplierName: String?
    @get:Value("#{target.supplier?.code}")
    val supplierCode: String?
    @get:Value("#{target.shop?.addr3}")
    val shopAddress: String?

    @get:Value("#{target.isExtra}")
    val isExtra: Boolean
}
data class DeliveryOrderInfoLiteDto(
    val id: Long,
    val code: String,
    val orderDate: LocalDateTime?,
    val estimatedArrivalDate: LocalDateTime?,
    val status: String?,
    val shopName: String?,
    val supplierName: String?,
    val shopAddress: String?,
    val truckLanceCode: String?,
    val isExtra: Boolean = false,
)