add optional type param support to get_cases_by_domain