Skip to content

Commit

Permalink
Merge pull request #64 from Hoang-Nguyen-Huy/refactor/PBS-36/room-typ…
Browse files Browse the repository at this point in the history
…e-filter

Refactor/pbs 36/room type filter
  • Loading branch information
Hoang-Nguyen-Huy authored Oct 7, 2024
2 parents dfa2b6e + 32dc750 commit 5d84c8a
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.swp.PodBookingSystem.dto.respone.PaginationResponse;
import com.swp.PodBookingSystem.dto.respone.Room.RoomResponse;
import com.swp.PodBookingSystem.entity.Room;
import com.swp.PodBookingSystem.service.OrderDetailService;
import com.swp.PodBookingSystem.service.RoomService;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
@FieldDefaults(level = AccessLevel.PRIVATE)
public class RoomCreationRequest {
String name;
int price;
String description;
String image;
RoomStatus status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@FieldDefaults(level = AccessLevel.PRIVATE)
public class RoomTypeCreationRequest {
String name;
int price;
int quantity;
int capacity;
Integer buildingId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
public class RoomResponse {
Integer id;
String name;
int price;
String description;
String image;
RoomStatus status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
public class RoomTypeResponse {
Integer id;
String name;
int price;
int quantity;
int capacity;
Building building;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/swp/PodBookingSystem/entity/Room.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class Room {
Integer id;

String name;
int price;
String description;

@Column(nullable = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class RoomType {
Integer id;

String name;
int price;
int quantity;
int capacity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public RoomTypeResponse updateRoomType(int roomTypeId, RoomTypeCreationRequest r
Optional<RoomType> existingRoomTypeOpt = roomTypeRepository.findById(roomTypeId);

RoomType existingRoomType = existingRoomTypeOpt.orElseThrow(() -> new RuntimeException("RoomType not found"));
System.out.println(request.toString());

Integer newBuildingId = request.getBuildingId();
Optional<Building> newBuilding = buildingRepository.findById(newBuildingId);
Expand Down

0 comments on commit 5d84c8a

Please sign in to comment.