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

import com.fasterxml.jackson.annotation.JsonBackReference
import com.fasterxml.jackson.annotation.JsonManagedReference
import com.ffii.core.entity.BaseEntity
import com.ffii.core.entity.IdEntity
import jakarta.persistence.*
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Size

@Entity
@Table(name = "qc_item_category")
open class QcItemCategory : IdEntity<Long>() {
    @JsonBackReference
    @NotNull
    @ManyToOne
    @JoinColumn(name = "qcCategoryId")
    open var qcCategory: QcCategory? = null

    @com.fasterxml.jackson.annotation.JsonIgnoreProperties("qcItemCategory")
    @NotNull
    @ManyToOne
    @JoinColumn(name = "qcItemId")
    open var qcItem: QcItem? = null

    @NotNull
    @Column(name = "`order`")
    open var order: Int = 0

    @Size(max = 1000)
    @Column(name = "description", length = 1000)
    open var description: String? = null

}