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

import com.ffii.core.entity.BaseEntity
import jakarta.persistence.*
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Size

@Table(name = "equipment")
@Entity
open class Equipment : BaseEntity<Long>() {
    @Size(max = 255)
    @NotNull
    @Column(name = "code", nullable = false, length = 255)
    open var code: String? = null

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

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

    @ManyToOne
    @JoinColumn(name = "equipmentTypeId")
    open var EquipmentDetail: EquipmentDetail? = null
}