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 lombok.experimental.Accessors;
import org.hibernate.annotations.ColumnDefault;

import java.time.Instant;

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

    @Size(max = 36)
    @NotNull
    @Column(name = "child_id", nullable = false, length = 36)
    private String childId;

    @Size(max = 255)
    @Column(name = "fence_name")
    private String fenceName;

    @NotNull
    @ColumnDefault("0")
    @Column(name = "fence_type", nullable = false)
    private Integer fenceType;

    @NotNull
    @ColumnDefault("0")
    @Column(name = "state", nullable = false)
    private Boolean state;

    @Size(max = 25)
    @Column(name = "longitude", length = 25)
    private String longitude;

    @Size(max = 25)
    @Column(name = "latitude", length = 25)
    private String latitude;

    @NotNull
    @ColumnDefault("0")
    @Column(name = "`range`", nullable = false)
    private Integer range;

    @Size(max = 255)
    @Column(name = "address")
    private String address;

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

}