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

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
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_map_trajectory_log")
public class MapTrajectoryLogModel extends BaseModel {
    @Id
    @Column(name = "trajectory_id", nullable = false)
    private Long trajectoryId;

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

    @Size(max = 255)
    @NotNull
    @Column(name = "url", nullable = false)
    private String url;

    @NotNull
    @Column(name = "channel", nullable = false)
    private Byte channel;

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

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

    @NotNull
    @ColumnDefault("0")
    @Column(name = "is_successful", nullable = false)
    private Byte isSuccessful;

    @NotNull
    @ColumnDefault("0")
    @Column(name = "is_fence_warn", nullable = false)
    private Byte isFenceWarn;

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

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

}