77 lines
1.8 KiB
Java
77 lines
1.8 KiB
Java
package net.gepafin.tendermanagement.entities;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonValue;
|
|
import jakarta.persistence.*;
|
|
import jakarta.validation.constraints.Email;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
|
import lombok.Getter;
|
|
import lombok.Setter;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
@Entity
|
|
@Table(name = "GEPAFIN_USER")
|
|
@Getter
|
|
@Setter
|
|
public class UserEntity extends BaseEntity {
|
|
|
|
@Column(name = "PASSWORD", columnDefinition = "TEXT",nullable = false)
|
|
@JsonIgnore
|
|
private String password;
|
|
|
|
@Email
|
|
@Column(name = "EMAIL", length = 255, unique = true, nullable = false)
|
|
private String email;
|
|
|
|
@ManyToOne
|
|
@JoinColumn(name = "ROLE_ID")
|
|
@JsonIgnore
|
|
private RoleEntity roleEntity;
|
|
|
|
|
|
@Column(name = "LAST_LOGIN")
|
|
private LocalDateTime lastLogin;
|
|
|
|
@Column(name = "STATUS", length = 30, nullable = true)
|
|
private String status;
|
|
|
|
@Column(name = "FIRST_NAME", length = 50, nullable = true)
|
|
private String firstName;
|
|
|
|
@Column(name = "LAST_NAME", length = 50, nullable = true)
|
|
private String lastName;
|
|
|
|
@Column(name = "PHONE_NUMBER", length = 15, nullable = true)
|
|
private String phoneNumber;
|
|
|
|
@Column(name = "ORGANIZATION", length = 255, nullable = true)
|
|
private String organization;
|
|
|
|
@Column(name = "ADDRESS", length = 255, nullable = true)
|
|
private String address;
|
|
|
|
@Column(name = "CITY", length = 50, nullable = true)
|
|
private String city;
|
|
|
|
@Column(name = "COUNTRY", length = 50, nullable = true)
|
|
private String country;
|
|
|
|
public enum UserStatusEnum {
|
|
ACTIVE("ACTIVE"),
|
|
INACTIVE("INACTIVE");
|
|
|
|
private String value;
|
|
|
|
UserStatusEnum(String value) {
|
|
this.value = value;
|
|
}
|
|
|
|
@JsonValue
|
|
public String getValue() {
|
|
return value;
|
|
}
|
|
}
|
|
}
|