# app/exceptions/address.py """ Address-related custom exceptions. Used for customer address management operations. """ from .base import BusinessLogicException, ResourceNotFoundException class AddressNotFoundException(ResourceNotFoundException): """Raised when a customer address is not found.""" def __init__(self, address_id: str | int): super().__init__( resource_type="Address", identifier=str(address_id), ) class AddressLimitExceededException(BusinessLogicException): """Raised when customer exceeds maximum number of addresses.""" def __init__(self, max_addresses: int = 10): super().__init__( message=f"Maximum number of addresses ({max_addresses}) reached", error_code="ADDRESS_LIMIT_EXCEEDED", ) class InvalidAddressTypeException(BusinessLogicException): """Raised when an invalid address type is provided.""" def __init__(self, address_type: str): super().__init__( message=f"Invalid address type '{address_type}'. Must be 'shipping' or 'billing'", error_code="INVALID_ADDRESS_TYPE", )