Done ticket GEPAFINBE-3

This commit is contained in:
harish
2024-08-14 15:31:00 +05:30
parent 2773dfa034
commit e09f61f918
51 changed files with 2107 additions and 70 deletions

View File

@@ -0,0 +1,77 @@
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 net.gepafin.tendermanagement.entities.BaseEntity;
import java.time.LocalDateTime;
@Entity
@Table(name = "\"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;
}
}
}