JhHardwareWRS_BackPoint/app/services/cleaning.py
2026-06-24 15:19:14 +08:00

23 lines
658 B
Python

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))