Spaces:
Build error
Build error
| """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.""" | |
| 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. | |
| """ | |
| 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). | |
| """ | |