forked from kahluaband/Homepage_BE_SpringBoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kahluaband#69 Feat: add reservation entity
- Loading branch information
1 parent
edbce48
commit 5435dc9
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
src/main/java/kahlua/KahluaProject/domain/reservation/Reservation.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,48 @@ | ||
package kahlua.KahluaProject.domain.reservation; | ||
|
||
import jakarta.persistence.*; | ||
import kahlua.KahluaProject.domain.BaseEntity; | ||
import kahlua.KahluaProject.domain.user.User; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalTime; | ||
|
||
import static jakarta.persistence.FetchType.*; | ||
import static jakarta.persistence.GenerationType.*; | ||
|
||
@Entity | ||
@Getter | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class Reservation extends BaseEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = IDENTITY) | ||
@Column(nullable = false) | ||
private Long id; | ||
|
||
@ManyToOne(fetch = LAZY) | ||
@JoinColumn(name = "user_id") | ||
private User user; | ||
|
||
@Column(name = "club_room_username") | ||
private String clubRoomUsername; // 동방 예약자명(팀명) | ||
|
||
@Column(name = "reservation_date", nullable = false) | ||
private LocalDate reservationDate; // 예약날짜 | ||
|
||
@Column(name = "start_time", nullable = false) | ||
private LocalTime startTime; // 사용 시작 시간 | ||
|
||
@Column(name = "end_time", nullable = false) | ||
private LocalTime endTime; // 사용 종료 시간 | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(name = "reservation_status", nullable = false) | ||
private ReservationStatus status; // 예약 상태 - 진행중, 예약됨, 취소됨 | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/kahlua/KahluaProject/domain/reservation/ReservationStatus.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,6 @@ | ||
package kahlua.KahluaProject.domain.reservation; | ||
|
||
public enum ReservationStatus { | ||
|
||
PROCEEDING, RESERVED, CANCELLED | ||
} |