/**
 * Repository Interface: ISponsorshipRequestRepository
 * 
 * Defines operations for SponsorshipRequest aggregate persistence
 */

import type { SponsorshipRequest, SponsorableEntityType, SponsorshipRequestStatus } from '../entities/SponsorshipRequest';

export interface ISponsorshipRequestRepository {
  findById(id: string): Promise<SponsorshipRequest | null>;
  
  /**
   * Find all requests for a specific entity (driver, team, race, or season)
   */
  findByEntity(entityType: SponsorableEntityType, entityId: string): Promise<SponsorshipRequest[]>;
  
  /**
   * Find pending requests for an entity that need review
   */
  findPendingByEntity(entityType: SponsorableEntityType, entityId: string): Promise<SponsorshipRequest[]>;
  
  /**
   * Find all requests made by a sponsor
   */
  findBySponsorId(sponsorId: string): Promise<SponsorshipRequest[]>;
  
  /**
   * Find requests by status
   */
  findByStatus(status: SponsorshipRequestStatus): Promise<SponsorshipRequest[]>;
  
  /**
   * Find requests by sponsor and status
   */
  findBySponsorIdAndStatus(sponsorId: string, status: SponsorshipRequestStatus): Promise<SponsorshipRequest[]>;
  
  /**
   * Check if a sponsor already has a pending request for an entity
   */
  hasPendingRequest(sponsorId: string, entityType: SponsorableEntityType, entityId: string): Promise<boolean>;
  
  /**
   * Count pending requests for an entity
   */
  countPendingByEntity(entityType: SponsorableEntityType, entityId: string): Promise<number>;
  
  create(request: SponsorshipRequest): Promise<SponsorshipRequest>;
  update(request: SponsorshipRequest): Promise<SponsorshipRequest>;
  delete(id: string): Promise<void>;
  exists(id: string): Promise<boolean>;
}