Skip to content

Commit

Permalink
[PDS-73] fix: 예약 내역 전체 조회 시, 예약 대상 targetId 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sojungpp committed Dec 3, 2023
1 parent 7711102 commit 337dcca
Show file tree
Hide file tree
Showing 3 changed files with 15 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 @@ -30,6 +32,7 @@ public class AdminBookingRes {
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()))
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 @@ -30,6 +32,7 @@ public class AdminProductRes {
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()))
Expand All @@ -43,6 +46,7 @@ public static AdminProductRes toDto(ResourceBooking resourceBooking){
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()))
Expand Down

0 comments on commit 337dcca

Please sign in to comment.