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 lombok.experimental.Accessors;
import org.hibernate.annotations.ColumnDefault;

import java.time.Instant;

@Getter
@Setter
@Entity
@Table(name = "tb_user")
@Accessors(chain = true)
public class UserModel extends BaseModel {
    @Id
    @Size(max = 36)
    @Column(name = "id", nullable = false, length = 36)
    private String id;

    @Size(max = 125)
    @Column(name = "phone_number", length = 125)
    private String phoneNumber;

    @Size(max = 25)
    @Column(name = "area_code", length = 25)
    private String areaCode;

    @Size(max = 125)
    @Column(name = "email", length = 125)
    private String email;

    @Size(max = 36)
    @Column(name = "password", length = 36)
    private String password;

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

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

}