from typing import Union


def stringify_company_id(company_id: Union[int, str]) -> str:
    """Enforce correct company number as string of length >= 8."""
    company_id = str(company_id)
    if company_id and len(company_id) < 8:
        return company_id.rjust(8, "0")  # Shorter need preceeding '0's
    return company_id