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_map_trajectory")
@Accessors(chain = true)
public class MapTrajectoryModel 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;

    @NotNull
    @Column(name = "device_id", nullable = false)
    private Long deviceId;

    @NotNull
    @Column(name = "position_time", nullable = false)
    private Instant positionTime;

    @NotNull
    @Column(name = "type", nullable = false)
    private Integer type;

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

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

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

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

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

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

}