Skip to content

Commit

Permalink
RSWW-134 remove "Delete hotel" action
Browse files Browse the repository at this point in the history
  • Loading branch information
Danzigerrr committed Jun 4, 2024
1 parent 2ed4d05 commit f549e86
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
public class HotelsDataGenerator {
enum DataUpdateType {
CREATE,
UPDATE,
DELETE
UPDATE
}

private final HotelRepository hotelRepository;
Expand All @@ -39,9 +38,6 @@ public void updateRandomHotelData() {
case 1:
updateRandomRoom();
break;
case 2:
deleteRandomRoom();
break;
}
}

Expand Down Expand Up @@ -78,17 +74,6 @@ private void updateRandomRoom() {
updateHotelDataInHotelModules(DataUpdateType.UPDATE, randomRoom);
}

private void deleteRandomRoom() {
Hotel randomHotel = getRandomHotel();
if (randomHotel == null) return;

Room randomRoom = randomHotel.getRooms().get(random.nextInt(randomHotel.getRooms().size()));

System.out.println("Deleting room: " + randomRoom);

updateHotelDataInHotelModules(DataUpdateType.DELETE, randomRoom);
}

private Hotel getRandomHotel() {
List<Hotel> hotels = hotelRepository.findAll();

Expand Down

0 comments on commit f549e86

Please sign in to comment.