# app/config/maps_api_config.py
"""
Google Maps API Configuration for RateRight
Prepared for future job location features
"""

import os
from flask import current_app

class MapsAPIConfig:
    """Secure Google Maps API configuration"""
    
    # Maps API Key for location services
    GOOGLE_MAPS_API_KEY = "AIzaSyB4acJl8TjEb7hfvBowGM5KusQuG2OZQA"
    
    # Maps API endpoints
    GEOCODING_API_URL = "https://maps.googleapis.com/maps/api/geocode/json"
    PLACES_API_URL = "https://maps.googleapis.com/maps/api/place/nearbysearch/json"
    DISTANCE_MATRIX_API_URL = "https://maps.googleapis.com/maps/api/distancematrix/json"
    
    @classmethod
    def get_api_key(cls):
        """Get Maps API key with environment variable override"""
        return os.environ.get('GOOGLE_MAPS_API_KEY', cls.GOOGLE_MAPS_API_KEY)
    
    @classmethod
    def get_geocoding_url(cls):
        """Get geocoding API URL with key"""
        return f"{cls.GEOCODING_API_URL}?key={cls.get_api_key()}"
    
    @classmethod
    def get_places_url(cls):
        """Get places API URL with key"""
        return f"{cls.PLACES_API_URL}?key={cls.get_api_key()}"
    
    @classmethod
    def get_distance_matrix_url(cls):
        """Get distance matrix API URL with key"""
        return f"{cls.DISTANCE_MATRIX_API_URL}?key={cls.get_api_key()}"

# Future job location features preparation
class JobLocationService:
    """Prepared service for future job location matching"""
    
    @staticmethod
    def geocode_location(location_string):
        """Future: Convert location string to coordinates"""
        # TODO: Implement geocoding for job location matching
        pass
    
    @staticmethod
    def find_nearby_workers(job_location, radius_km=50):
        """Future: Find workers within radius of job location"""
        # TODO: Implement worker location matching
        pass
    
    @staticmethod
    def calculate_travel_distance(worker_location, job_location):
        """Future: Calculate travel distance for job matching"""
        # TODO: Implement distance calculation
        pass

# Configuration ready for future integration with:
# - Job posting location validation
# - Worker-job proximity matching
# - Travel distance calculations
# - Location-based notifications
