Class BookingService

java.lang.Object
springboot.bg.harisauto.booking.service.BookingService

@Service public class BookingService extends Object
BookingService.java - Service class for managing bookings.
Author:
Kristian Popov
  • Constructor Details

  • 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 id
      bookingDate - - booking date
      serviceIds - - service ids
      vehicleId - - vehicle id
      additionalNotes - - additional notes
      paymentMethod - - payment method
      phoneNumber - - phone number
      totalPrice - - total price
      status - - status
    • getBookingsByUser

      public List<BookingResponse> getBookingsByUser(UUID userId)
      Get bookings by user id.
      Parameters:
      userId - - user id
      Returns:
      List of bookings
    • getAllBookings

      public List<BookingResponse> getAllBookings()
      Lists every booking, newest first, enriched with vehicle and service names.
      Returns:
      All bookings the booking service knows about.
    • cancelBooking

      public void cancelBooking(UUID bookingId)
      Cancels a booking.
      Parameters:
      bookingId - The booking to cancel.
    • archiveBooking

      public void archiveBooking(UUID bookingId)
      Archives a booking.
      Parameters:
      bookingId - The booking to archive.