This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package ru.soune.nocopy.entity.user;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum ModerationStatus {
|
||||
NOT_VERIFIED("not_verified") , VERIFICATION_IN_PROGRESS("verification_in_progress"),
|
||||
VERIFIED("verified"), VERIFICATION_FAILED("verification_failed");
|
||||
|
||||
private final String name;
|
||||
|
||||
private ModerationStatus(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -106,6 +106,9 @@ public class User {
|
||||
@ToString.Exclude
|
||||
private UserNotActive userNotActive;
|
||||
|
||||
@Column(name = "verification_status")
|
||||
private ModerationStatus verificationStatus = ModerationStatus.NOT_VERIFIED;
|
||||
|
||||
public TariffInfo getActiveTariffInfo() {
|
||||
if (company != null && company.getTariffInfo() != null) {
|
||||
return company.getTariffInfo();
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package ru.soune.nocopy.entity.user.moderation;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
import ru.soune.nocopy.entity.user.ModerationStatus;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Table(name = "user_verification")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Getter
|
||||
@Setter
|
||||
public class UserVerification {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "user_id", unique = true, nullable = false)
|
||||
private Long userId;
|
||||
|
||||
@CreatedDate
|
||||
@Column(name = "created_at", updatable = false, nullable = false)
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@LastModifiedDate
|
||||
@Column(name = "updated_at")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Column(name = "message")
|
||||
private String message;
|
||||
|
||||
@Column(name = "admin_id")
|
||||
private Long adminId;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "status")
|
||||
private ModerationStatus moderationStatus;
|
||||
}
|
||||
Reference in New Issue
Block a user