from typing import List


def generate_patterns(import_path: str, module_prefix: str) -> List[str]:
    """Generate a list of patterns to discover.

    For example, gen_patterns("myapp", "models") generates patterns that make matchers
    discover the content in the following files.

        myapp/users/models.py
        myapp/invoices/models.py
        (etc. for all domain packages beyond "users" and "invoices")
        ...

        myapp/users/models_roles.py
        myapp/users/models_groups.py
        (etc. for all modules started with "models_" in all domain packages)
        ...

        myapp/users/models/roles.py
        myapp/users/models/groups.py
        (if you prefer nested structures)
    """
    return [
        f"{import_path}.*.{module_prefix}",
        f"{import_path}.*.{module_prefix}_*",
        f"{import_path}.*.{module_prefix}.*",
    ]