"""Shared validation logic.""" from datetime import date, datetime from abacus_common_data.country import Country from abacus_contract.constants import error def validate_country_code(country_code: str) -> None: """Validate a country code parameter.""" try: Country(country_code) except KeyError: raise Exception(error.ERROR_UNKNOWN_COUNTRY.format(code=country_code))