Class BookingService
java.lang.Object
springboot.bg.harisauto.booking.service.BookingService
BookingService.java - Service class for managing bookings.
- Author:
- Kristian Popov
-
Constructor Summary
ConstructorsConstructorDescriptionBookingService(BookingClient client, VehicleService vehicleService, CatalogService catalogService) -
Method Summary
Modifier and TypeMethodDescriptionvoidarchiveBooking(UUID bookingId) Archives a booking.voidcancelBooking(UUID bookingId) Cancels a booking.voidcreateBooking(UUID userId, LocalDateTime bookingDate, List<UUID> serviceIds, UUID vehicleId, String additionalNotes, String paymentMethod, String phoneNumber, BigDecimal totalPrice, String status) Create booking.Lists every booking, newest first, enriched with vehicle and service names.getBookingsByUser(UUID userId) Get bookings by user id.
-
Constructor Details
-
BookingService
@Autowired public BookingService(BookingClient client, VehicleService vehicleService, CatalogService catalogService)
-
-
Method Details
-
createBooking
public void createBooking(UUID userId, LocalDateTime bookingDate, List<UUID> serviceIds, UUID vehicleId, String additionalNotes, String paymentMethod, String phoneNumber, BigDecimal totalPrice, String status) Create booking.- Parameters:
userId- - user idbookingDate- - booking dateserviceIds- - service idsvehicleId- - vehicle idadditionalNotes- - additional notespaymentMethod- - payment methodphoneNumber- - phone numbertotalPrice- - total pricestatus- - status
-
getBookingsByUser
Get bookings by user id.- Parameters:
userId- - user id- Returns:
- List of bookings
-
getAllBookings
Lists every booking, newest first, enriched with vehicle and service names.- Returns:
- All bookings the booking service knows about.
-
cancelBooking
Cancels a booking.- Parameters:
bookingId- The booking to cancel.
-
archiveBooking
Archives a booking.- Parameters:
bookingId- The booking to archive.
-