package com.walkguide.entity;

import jakarta.persistence.*;
import lombok.*;
import java.time.LocalDateTime;

@Entity
@Table(name = "obstacle_logs")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ObstacleLog {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "user_id", nullable = false)
    private Long userId;

    @Column(nullable = false)
    private String label; // 'person', 'car', 'motorcycle', dll

    @Column(nullable = false)
    private Double confidence;

    @Column(nullable = false)
    private String direction; // LEFT, CENTER, RIGHT

    @Column(name = "estimated_dist", nullable = false)
    private String estimatedDist; // Very Close, Close, Medium, Far

    private Double lat;
    private Double lng;

    @Column(name = "created_at", nullable = false, updatable = false)
    private LocalDateTime createdAt;

    @PrePersist
    protected void onCreate() {
        createdAt = LocalDateTime.now();
    }
}
