Spaces:
Build error
Build error
File size: 1,217 Bytes
f188029 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | """Abstract interface for visa data providers."""
from abc import ABC, abstractmethod
from typing import List, Optional
from app.models.visa_data import VisaEligibility, VisaGuideline
class VisaDataProvider(ABC):
"""Base class all visa data providers must implement."""
@abstractmethod
async def check_eligibility(
self, nationality: str, destination: str
) -> Optional[VisaEligibility]:
"""
Check visa eligibility for a nationality/destination pair.
Args:
nationality: ISO-2 country code of the passport holder.
destination: ISO-2 country code of the destination.
Returns:
VisaEligibility or None if the provider cannot determine it.
"""
@abstractmethod
async def get_visa_details(
self, nationality: str, destination: str
) -> List[VisaGuideline]:
"""
Fetch detailed visa guidelines for a nationality/destination pair.
Args:
nationality: ISO-2 country code of the passport holder.
destination: ISO-2 country code of the destination.
Returns:
List of VisaGuideline objects (may be empty if no data found).
"""
|