/**
 * @ai-summary Type definitions for community-submitted gas stations feature
 * @ai-context 93 octane gas station submissions with auto-approval and removal tracking
 */

/** Status for community station submissions */
export type CommunityStationStatus = 'pending' | 'approved' | 'rejected' | 'removed';

/** Octane submission type for radio button selection */
export type OctaneSubmissionType =
  | 'has_93_with_ethanol'
  | 'has_93_without_ethanol'
  | 'no_longer_has_93';

export interface CommunityStation {
  id: string;
  submittedBy: string;
  name: string;
  address: string;
  city?: string;
  state?: string;
  zipCode?: string;
  latitude: number;
  longitude: number;
  brand?: string;
  has93Octane: boolean;
  has93OctaneEthanolFree: boolean;
  price93?: number;
  notes?: string;
  status: CommunityStationStatus;
  reviewedBy?: string;
  reviewedAt?: Date;
  rejectionReason?: string;
  removalReportCount?: number;
  removedAt?: Date;
  createdAt: Date;
  updatedAt: Date;
}

export interface SubmitCommunityStationBody {
  name: string;
  address: string;
  city?: string;
  state?: string;
  zipCode?: string;
  latitude: number;
  longitude: number;
  brand?: string;
  has93Octane?: boolean;
  has93OctaneEthanolFree?: boolean;
  price93?: number;
  notes?: string;
}

export interface ReviewStationBody {
  status: 'approved' | 'rejected';
  rejectionReason?: string;
}

export interface CommunityStationFilters {
  status?: CommunityStationStatus;
  submittedBy?: string;
  limit?: number;
  offset?: number;
}

export interface CommunityStationListResult {
  total: number;
  stations: CommunityStation[];
}

export interface NearbyStationParams {
  latitude: number;
  longitude: number;
  radiusKm?: number;
}

/** Bounding box for map-based station queries */
export interface StationBounds {
  north: number;
  south: number;
  east: number;
  west: number;
}

/** Removal report record */
export interface RemovalReport {
  id: string;
  stationId: string;
  reportedBy: string;
  reason: string;
  createdAt: Date;
}

/** Result of submitting a removal report */
export interface RemovalReportResult {
  reportCount: number;
  stationRemoved: boolean;
}
