package com.example.skychasemk.model;

import jakarta.persistence.*;
import lombok.Data;

import java.time.Instant;
import java.time.LocalDate;

@Entity
@Data
@Table(name="ApplicationUser")
public class ApplicationUser {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "userid")

    private Long userid;
    @Column(name = "name")

    private String name;
    @Column(name = "surname")

    private String surname;

    @Column(name="email")
    private String email;
    @Column(name = "password")

    private String password;
    @Column(name = "phoneNumber")

    private String phoneNumber;

    @Column(name = "dateJoined")
    private LocalDate dateJoined;

    @PrePersist
    protected void onCreate() {
        this.dateJoined = LocalDate.now();
    }

}
