def METHOD_NAME(location_type, record: dict) -> Optional[str]:
    """Dictionary key order impacts Elasticsearch behavior!!!"""
    if record[f"{location_type}_country_code"] is None:
        return None
    return json.dumps(
        {
            "country_code": record[f"{location_type}_country_code"],
            "country_name": record[f"{location_type}_country_name"],
        }
    )