Skip to content

Commit

Permalink
kahluaband#69 Feat: add reservation entity
Browse files Browse the repository at this point in the history
  • Loading branch information
woogieon8on committed Oct 12, 2024
1 parent edbce48 commit 5435dc9
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
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; // 예약 상태 - 진행중, 예약됨, 취소됨
}
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
}

0 comments on commit 5435dc9

Please sign in to comment.