package com.sikey.wa04.business.infrastructure.dto.model;

import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;

import java.time.Instant;

@Getter
@Setter
@Entity
@Table(name = "tb_device_config")
public class DeviceConfigModel extends BaseModel {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;

    @Column(name = "device_id")
    private Long deviceId;

    @Size(max = 125)
    @NotNull
    @Column(name = "`key`", nullable = false, length = 125)
    private String key;

    @Size(max = 125)
    @NotNull
    @Column(name = "value", nullable = false, length = 125)
    private String value;

    @Size(max = 125)
    @Column(name = "before_value", length = 125)
    private String beforeValue;

    @Column(name = "deleted_at")
    private Instant deletedAt;

    /*@ManyToOne(targetEntity = DeviceModel.class, fetch = FetchType.LAZY)
    @JoinColumn(
            name = "device_id",
            referencedColumnName = "id",
            foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private DeviceModel deviceModel;*/

}