package com.flightticket.service;

import com.flightticket.dto.booking.BookingResponse;
import com.flightticket.dto.booking.CreateBookingRequest;
import com.flightticket.model.entity.Booking;

import java.util.List;
import java.util.UUID;

/**
 * Service interface for booking operations
 * Requirements: 6.1, 6.2, 6.3, 6.4, 6.5, 6.6
 */
public interface BookingService {
    
    /**
     * Create a new booking with PNR creation in Amadeus
     * Requirements: 6.1, 6.2, 6.3, 6.4, 6.5
     * 
     * @param request Booking creation request with passenger and flight details
     * @param agencyId Agency ID creating the booking
     * @param agentId Agent ID creating the booking
     * @return Created booking response
     */
    BookingResponse createBooking(CreateBookingRequest request, UUID agencyId, UUID agentId);
    
    /**
     * Get booking by ID
     * 
     * @param bookingId Booking ID
     * @return Booking entity
     */
    Booking getBooking(UUID bookingId);
    
    /**
     * Get booking response by ID
     * 
     * @param bookingId Booking ID
     * @return Booking response DTO
     */
    BookingResponse getBookingResponse(UUID bookingId);
    
    /**
     * Get all bookings for an agency
     * 
     * @param agencyId Agency ID
     * @return List of booking responses
     */
    List<BookingResponse> getBookingsByAgency(UUID agencyId);
    
    /**
     * Cancel a booking and release reserved funds
     * Requirements: 6.6
     * 
     * @param bookingId Booking ID to cancel
     * @param cancelledBy User ID who is cancelling
     */
    void cancelBooking(UUID bookingId, UUID cancelledBy);
    
    /**
     * Process expired bookings (scheduled task)
     * Requirements: 6.5
     */
    void processExpiredBookings();
}
