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

import com.fasterxml.jackson.annotation.JsonBackReference
import com.ffii.core.entity.BaseEntity
import jakarta.persistence.*
import java.time.LocalDateTime

@Entity
@Table(name = "production_schedule_line")
open class ProductionScheduleLine : BaseEntity<Long>() {
//        @Column(name = "prodScheduleId")
//        open var prodScheduleId: Long = 0L

        @OneToOne
        @JoinColumn(name = "itemId")
        open var item: Items = Items()
//        @Column(name = "itemId")
//        open var itemId: Long = 0L

        @Column(name = "lastMonthAvgSales")
        open var lastMonthAvgSales: Double = 0.0

        @Column(name = "prodQty")
        open var prodQty: Double = 0.0

        @Column(name = "estCloseBal")
        open var estCloseBal: Double = 0.0

        @Column(name = "type")
        open var type: String = "rough"

        @Column(name = "approverId")
        open var approverId: Long? = 0

        @Column(name = "refScheduleId")
        open var refScheduleId: Long? = 0

        //in Integer (i.e.: Day1, Day2, Day3)
        @Column(name = "assignDate")
        open var assignDate: Long = 0L

        @Column(name = "itemPriority")
        open var itemPriority: Long = 0L

        @Column(name = "weightingRef")
        open var weightingRef: Double = 0.0

        @Column(name = "outputQty")
        open var outputQty: Double = 0.0

        @Column(name = "stockQty")
        open var stockQty: Double = 0.0

        @Column(name = "daysLeft")
        open var daysLeft: Double = 0.0

        @Column(name = "batchNeed")
        open var batchNeed: Int = 0

        @Column(name = "needNoOfJobOrder")
        open var needNoOfJobOrder: Int = 0

        @Column(name = "avgQtyLastMonth")
        open var avgQtyLastMonth: Double = 0.0

        @JsonBackReference
        @ManyToOne
        @JoinColumn(name = "prodScheduleId", nullable = false)
        open var productionSchedule: ProductionSchedule = ProductionSchedule()
}
