CLEANING_STAMPING_METHOD = "清洗" LEGACY_CLEANING_PROCESS_NAME = "清洗" def clean_text(value: str | None) -> str: return str(value or "").strip() def is_cleaning_stamping_method(value: str | None) -> bool: return clean_text(value) == CLEANING_STAMPING_METHOD def is_legacy_cleaning_process(value: str | None) -> bool: return clean_text(value) == LEGACY_CLEANING_PROCESS_NAME def is_cleaning_product(product) -> bool: return bool(product) and is_cleaning_stamping_method(getattr(product, "stamping_method", None)) def is_cleaning_item(item) -> bool: return is_cleaning_stamping_method(getattr(item, "stamping_method", None))