from typing import Optional, Dict, Any

from app.components.http.infrastructure.repositories.http_repository_impl import HttpRepositoryImpl

class CustomerExternalService:
    def __init__(self, base_url: str, token: str):
        self.http = HttpRepositoryImpl(
            base_url=base_url,
            headers={
                "validate": token,
                "Content-Type": "application/json",
                "Accept": "application/json"
            }
        )

    async def get(self, path: str, params: Optional[Dict[str, Any]] = None, config: Optional[Dict[str, Any]] = None) -> Any:
        return await self.http.get(path, params, config)

    async def post(self, path: str, params: Optional[Dict[str, Any]] = None, config: Optional[Dict[str, Any]] = None) -> Any:
        return await self.http.post(path, params, config)

    async def put(self, path: str, params: Optional[Dict[str, Any]] = None, config: Optional[Dict[str, Any]] = None) -> Any:
        return await self.http.put(path, params, config)

    async def delete(self, path: str, params: Optional[Dict[str, Any]] = None, config: Optional[Dict[str, Any]] = None) -> Any:
        return await self.http.delete(path, params, config)