package com.ffii.fpsms.modules.pickOrder.entity

import com.ffii.core.entity.BaseEntity
import com.ffii.fpsms.modules.master.entity.Shop
import jakarta.persistence.*
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Size
import java.math.BigDecimal
import java.time.LocalTime

@Entity
@Table(name = "truck")
open class Truck : BaseEntity<Long>() {
    
    @Size(max = 50)
    @NotNull
    @Column(name = "truckNo", nullable = false, unique = true)
    open var truckNo: String? = null

    @Size(max = 100)
    @Column(name = "truckName")
    open var truckName: String? = null

    @Column(name = "DepartureTime")
    open var departureTime: LocalTime? = null

    @ManyToOne
    @JoinColumn(name = "shopId")
    open var shop: Shop? = null

    @Column(name = "capacity", precision = 10, scale = 2)
    open var capacity: BigDecimal? = null

    @Size(max = 20)
    @Column(name = "status")
    open var status: String? = null
}