/**
 * Booking Repository Port
 *
 * Defines the interface for Booking persistence operations.
 * This is a secondary port (output port) in hexagonal architecture.
 */

import { Booking } from '../../entities/booking.entity';
import { BookingNumber } from '../../value-objects/booking-number.vo';
import { BookingStatus } from '../../value-objects/booking-status.vo';

export const BOOKING_REPOSITORY = 'BookingRepository';

export interface BookingRepository {
  /**
   * Save a booking entity
   */
  save(booking: Booking): Promise<Booking>;

  /**
   * Find booking by ID
   */
  findById(id: string): Promise<Booking | null>;

  /**
   * Find booking by booking number
   */
  findByBookingNumber(bookingNumber: BookingNumber): Promise<Booking | null>;

  /**
   * Find all bookings for a specific user
   */
  findByUser(userId: string): Promise<Booking[]>;

  /**
   * Find all bookings for an organization
   */
  findByOrganization(organizationId: string): Promise<Booking[]>;

  /**
   * Find all bookings with a specific status
   */
  findByStatus(status: BookingStatus): Promise<Booking[]>;

  /**
   * Find all bookings in the system (admin only)
   */
  findAll(): Promise<Booking[]>;

  /**
   * Delete booking by ID
   */
  delete(id: string): Promise<void>;
}
