-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: requirement 도메인 구현 * refactor: requirement를 embeddable로 변경
- Loading branch information
1 parent
9ee3af9
commit b6197e1
Showing
3 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
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
42 changes: 42 additions & 0 deletions
42
src/main/java/com/gdschongik/gdsc/domain/requirement/domain/Requirement.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,42 @@ | ||
package com.gdschongik.gdsc.domain.requirement.domain; | ||
|
||
import static com.gdschongik.gdsc.domain.requirement.domain.RequirementStatus.*; | ||
|
||
import jakarta.persistence.Embeddable; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Embeddable | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Requirement { | ||
|
||
@Enumerated(EnumType.STRING) | ||
private RequirementStatus univStatus; | ||
|
||
@Enumerated(EnumType.STRING) | ||
private RequirementStatus discordStatus; | ||
|
||
@Enumerated(EnumType.STRING) | ||
private RequirementStatus paymentStatus; | ||
|
||
@Builder(access = AccessLevel.PRIVATE) | ||
private Requirement( | ||
RequirementStatus univStatus, RequirementStatus discordStatus, RequirementStatus paymentStatus) { | ||
this.univStatus = univStatus; | ||
this.discordStatus = discordStatus; | ||
this.paymentStatus = paymentStatus; | ||
} | ||
|
||
public static Requirement createRequirement() { | ||
return Requirement.builder() | ||
.univStatus(PENDING) | ||
.discordStatus(PENDING) | ||
.paymentStatus(PENDING) | ||
.build(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/gdschongik/gdsc/domain/requirement/domain/RequirementStatus.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,13 @@ | ||
package com.gdschongik.gdsc.domain.requirement.domain; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum RequirementStatus { | ||
PENDING("PENDING"), | ||
VERIFIED("VERIFIED"); | ||
|
||
private final String value; | ||
} |