From efe8ece8c170d13564b2647cb22538ce71de10af Mon Sep 17 00:00:00 2001 From: Jiyun Date: Thu, 25 Jul 2024 14:35:30 +0900 Subject: [PATCH] #9 Feat: modify freshman ticket status --- .../java/kahlua/KahluaProject/domain/ticket/Ticket.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/kahlua/KahluaProject/domain/ticket/Ticket.java b/src/main/java/kahlua/KahluaProject/domain/ticket/Ticket.java index 6bd8ea5..c340fa9 100644 --- a/src/main/java/kahlua/KahluaProject/domain/ticket/Ticket.java +++ b/src/main/java/kahlua/KahluaProject/domain/ticket/Ticket.java @@ -5,6 +5,9 @@ import kahlua.KahluaProject.domain.BaseEntity; import lombok.*; +import static kahlua.KahluaProject.domain.ticket.Type.FRESHMAN; +import static kahlua.KahluaProject.domain.ticket.Type.GENERAL; + @Entity @Builder @Getter @@ -41,8 +44,11 @@ public class Ticket extends BaseEntity { @PrePersist public void onCreate() { - if (status == null) { + if (status == null && type == GENERAL) { status = Status.WAIT; // default 값 설정 } + else if (status == null && type == FRESHMAN) { + status = Status.FINISH; // 신입생의 경우 바로 FINISH + } } }