Skip to content

Commit

Permalink
Merge pull request #280 from PLADI-ALM/fix/PDS-73-getBookings
Browse files Browse the repository at this point in the history
[PDS-73/fix] 예약 내역 전체 조회, 이용목적 및 예약 대상 id res 추가
  • Loading branch information
sojungpp authored Dec 3, 2023
2 parents 7711102 + 22e1feb commit 827fca5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
@Builder
public class AdminBookingRes {

@Schema(type = "Long", description = "회의실 Id / 자원 Id", example = "1")
@Schema(type = "Long", description = "예약 Id", example = "1")
private Long id;
@Schema(type = "Long", description = "회의실 Id / 자원 Id", example = "1")
private Long targetId;
@Schema(type = "String", description = "회의실명 / 자원명", example = "'회의실1' / '카메라1'")
private String name;
@Schema(type = "String", description = "회의실 위치 / 카테고리", example = "'401호' / '촬영장비'")
Expand All @@ -24,18 +26,22 @@ public class AdminBookingRes {
private String reservatorName;
@Schema(type = "String", description = "예약자 전화번호", example = "010-4158-8124")
private String reservatorPhone;
@Schema(type = "String", description = "이용목적", example = "드라마 촬영")
private String memo;
@Schema(type = "String", description = "상태", example = "'예약중' / '사용중'")
private String status;

public static AdminBookingRes toDto(OfficeBooking officeBooking){
return AdminBookingRes.builder()
.id(officeBooking.getOfficeBookingId())
.targetId(officeBooking.getOffice().getOfficeId())
.name(officeBooking.getOffice().getName())
.detailInfo(officeBooking.getOffice().getLocation())
.startDateTime(DateTimeUtil.dateAndTimeToString(officeBooking.getDate(),officeBooking.getStartTime()))
.endDateTime(DateTimeUtil.dateAndTimeToString(officeBooking.getDate(),officeBooking.getEndTime()))
.reservatorName(officeBooking.getUser().getName())
.reservatorPhone(officeBooking.getUser().getPhone())
.memo(officeBooking.getMemo())
.status(officeBooking.getStatus().getValue())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
@Builder
public class BookingRes {

@Schema(type = "Long", description = "Id", example = "1")
@Schema(type = "Long", description = "예약 Id", example = "1")
private Long id;
@Schema(type = "Long", description = "예약 대상 Id", example = "1")
private Long targetId;
@Schema(type = "String", description = "회의실명 / 장비명 / 차량명", example = "'회의실1' / '카메라1' / '벤틀리'")
private String name;
@Schema(type = "String", description = "회의실 위치 / 보관장소", example = "'401호' / '3층 A홀' / '주차장'")
Expand All @@ -30,6 +32,7 @@ public class BookingRes {
public static BookingRes toDto(OfficeBooking officeBooking) {
return BookingRes.builder()
.id(officeBooking.getOfficeBookingId())
.targetId(officeBooking.getOffice().getOfficeId())
.name(officeBooking.getOffice().getName())
.detailInfo(officeBooking.getOffice().getLocation())
.startDateTime(DateTimeUtil.dateAndTimeToString(officeBooking.getDate(), officeBooking.getStartTime()))
Expand All @@ -42,6 +45,7 @@ public static BookingRes toDto(OfficeBooking officeBooking) {
public static BookingRes toDto(ResourceBooking resourceBooking) {
return BookingRes.builder()
.id(resourceBooking.getResourceBookingId())
.targetId(resourceBooking.getResource().getResourceId())
.name(resourceBooking.getResource().getName())
.detailInfo(resourceBooking.getResource().getLocation())
.startDateTime(DateTimeUtil.dateTimeToString(resourceBooking.getStartDate()))
Expand All @@ -54,6 +58,7 @@ public static BookingRes toDto(ResourceBooking resourceBooking) {
public static BookingRes toDto(CarBooking carBooking) {
return BookingRes.builder()
.id(carBooking.getCarBookingId())
.targetId(carBooking.getCar().getCarId())
.name(carBooking.getCar().getName())
.detailInfo(carBooking.getCar().getLocation())
.startDateTime(DateTimeUtil.dateTimeToString(carBooking.getStartDate()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
@Data
@Builder
public class AdminProductRes {
@Schema(type = "Long", description = "Id", example = "1")
@Schema(type = "Long", description = "예약 Id", example = "1")
private Long id;
@Schema(type = "Long", description = "예약 대상 Id", example = "1")
private Long targetId;
@Schema(type = "String", description = "장비 이름", example = "'벤츠'")
private String name;
@Schema(type = "String", description = "보관장소", example = "'4층 창고'")
Expand All @@ -24,31 +26,37 @@ public class AdminProductRes {
private String reservatorName;
@Schema(type = "String", description = "예약자 전화번호", example = "010-0000-0000")
private String reservatorPhone;
@Schema(type = "String", description = "이용목적", example = "드라마 촬영")
private String memo;
@Schema(type = "String", description = "상태", example = "'예약중' / '사용중'")
private String status;

public static AdminProductRes toDto(ResourceBooking resourceBooking){
return AdminProductRes.builder()
.id(resourceBooking.getResourceBookingId())
.targetId(resourceBooking.getResource().getResourceId())
.name(resourceBooking.getResource().getName())
.location(resourceBooking.getResource().getLocation())
.startDateTime(DateTimeUtil.dateTimeToString(resourceBooking.getStartDate()))
.endDateTime(DateTimeUtil.dateTimeToString(resourceBooking.getEndDate()))
.reservatorName(resourceBooking.getUser().getName())
.reservatorPhone(resourceBooking.getUser().getPhone())
.memo(resourceBooking.getMemo())
.status(resourceBooking.getStatus().getValue())
.build();
}

public static AdminProductRes toDto(CarBooking carBooking){
return AdminProductRes.builder()
.id(carBooking.getCarBookingId())
.targetId(carBooking.getCar().getCarId())
.name(carBooking.getCar().getName())
.location(carBooking.getCar().getLocation())
.startDateTime(DateTimeUtil.dateTimeToString(carBooking.getStartDate()))
.endDateTime(DateTimeUtil.dateTimeToString(carBooking.getEndDate()))
.reservatorName(carBooking.getUser().getName())
.reservatorPhone(carBooking.getUser().getPhone())
.memo(carBooking.getMemo())
.status(carBooking.getStatus().getValue())
.build();
}
Expand Down

0 comments on commit 827fca5

Please sign in to comment.