package llc.arma.fleet.monitor.data.entity

import jakarta.persistence.Column
import jakarta.persistence.Entity
import jakarta.persistence.FetchType
import jakarta.persistence.GeneratedValue
import jakarta.persistence.GenerationType
import jakarta.persistence.Id
import jakarta.persistence.JoinColumn
import jakarta.persistence.ManyToOne
import jakarta.persistence.Table

@Entity
@Table(name = "machine_calibration_rules")
class MachineCalibrationRuleEntity(
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    var id: Long? = null,

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "machine_id", nullable = false)
    var machine: MachineEntity = MachineEntity(),

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "state_definition_id", nullable = false)
    var stateDefinition: MachineStateDefinitionEntity = MachineStateDefinitionEntity(),

    @Column(nullable = false)
    var vibrationMin: Double = 0.0,

    @Column(nullable = false)
    var vibrationMax: Double = 0.0,
) : BaseEntity()
