-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #172 add UserRegistrationRequest entity
- Loading branch information
1 parent
ea95bb2
commit d095bd1
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
src/main/java/com/faforever/api/data/domain/UserRegistrationRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package com.faforever.api.data.domain; | ||
|
||
import com.faforever.api.data.checks.permission.IsModerator; | ||
import com.yahoo.elide.annotation.Include; | ||
import com.yahoo.elide.annotation.ReadPermission; | ||
import lombok.Setter; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.EnumType; | ||
import javax.persistence.Enumerated; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.ManyToOne; | ||
import javax.persistence.OneToOne; | ||
import javax.persistence.Table; | ||
|
||
@Entity | ||
@Table(name = "registration_queue") | ||
@Setter | ||
@Include(rootLevel = true, type = "userRegistrationRequest") | ||
@ReadPermission(expression = IsModerator.EXPRESSION) | ||
public class UserRegistrationRequest extends AbstractEntity { | ||
private String username; | ||
private String email; | ||
private Status status; | ||
private String rejectReason; | ||
private User reviewer; | ||
private User createdUser; | ||
|
||
@Column(name = "username") | ||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
@Column(name = "email") | ||
public String getEmail() { | ||
return email; | ||
} | ||
|
||
@Column(name = "status") | ||
@Enumerated(EnumType.STRING) | ||
public Status getStatus() { | ||
return status; | ||
} | ||
|
||
@Column(name = "reject_reason") | ||
public String getRejectReason() { | ||
return rejectReason; | ||
} | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "reviewer") | ||
public User getReviewer() { | ||
return reviewer; | ||
} | ||
|
||
@OneToOne | ||
@JoinColumn(columnDefinition = "created_user") | ||
public User getCreatedUser() { | ||
return createdUser; | ||
} | ||
|
||
public enum Status { | ||
PENDING, | ||
APPROVED, | ||
REJECTED | ||
} | ||
} |