package com.ffii.fpsms.modules.master.entity

import com.ffii.core.entity.BaseEntity
import jakarta.persistence.Column
import jakarta.persistence.Entity
import jakarta.persistence.Table
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Size
import java.time.LocalDateTime

@Table(name = "equipment_detail")
@Entity
open class EquipmentDetail : BaseEntity<Long>() {

    @Size(max = 255)
    @Column(name = "equipmentCode", nullable = true, length = 255)
    open var equipmentCode: String? = null

    @Column(name = "repairAndMaintenanceStatus", nullable = true)
    open var repairAndMaintenanceStatus: Boolean? = null

    @Column(name = "latestRepairAndMaintenanceDate", nullable = true)
    open var latestRepairAndMaintenanceDate: LocalDateTime? = null

    @Column(name = "lastRepairAndMaintenanceDate", nullable = true)
    open var lastRepairAndMaintenanceDate: LocalDateTime? = null

    @Size(max = 255)
    @Column(name = "repairAndMaintenanceRemarks", nullable = true, length = 255)
    open var repairAndMaintenanceRemarks: String? = null

    @Size(max = 255)
    @NotNull
    @Column(name = "code", nullable = false, length = 255)
    open var code: String? = null

    @Size(max = 255)
    @NotNull
    @Column(name = "name", nullable = false, length = 255)
    open var name: String? = null

    @Size(max = 500)
    @NotNull
    @Column(name = "description", nullable = false, length = 500)
    open var description: String? = null

    @Column(name = "equipmentTypeID")
    open var equipmentTypeId: Long? = null

}