Skip to content

Commit

Permalink
Merge pull request kahluaband#36 from kjiyun/tickets
Browse files Browse the repository at this point in the history
kahluaband#9 Feat: modify freshman ticket status
  • Loading branch information
kjiyun authored Jul 25, 2024
2 parents 4b8d810 + efe8ece commit db7abd2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/kahlua/KahluaProject/domain/ticket/Ticket.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
}
}

0 comments on commit db7abd2

Please sign in to comment.