package com.gnx.telemedicine.model;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

import java.time.Instant;
import java.util.UUID;

@Getter
@Setter
@Entity
@Table(name = "login_attempts")
public class LoginAttempt {
    @Id
    @GeneratedValue(strategy = GenerationType.UUID)
    @Column(name = "id")
    private UUID id;

    @Column(name = "email", nullable = false, length = 100)
    private String email;

    @Column(name = "ip_address", length = 45)
    private String ipAddress;

    @Column(name = "success")
    private Boolean success = false;

    @Column(name = "failure_reason", length = 255)
    private String failureReason;

    @Column(name = "timestamp", nullable = false)
    private Instant timestamp = Instant.now();
}

