Refactor discrete material cleaner to improve maintainability and testability: - Introduce dependency injection pattern for service components - Add interfaces (IPageNavigator, IMaterialExtractor, IDeletionChecker) - Extract PageNavigator service for page navigation logic - Extract MaterialExtractor service for data extraction - Extract DatabaseDeletionChecker service for deletion logic - Add MaterialInfo data model for structured data - Centralize configuration (CleanerConfig, UIConstants) - Implement separation of concerns across services layer Also includes comprehensive execution mechanism documentation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
25 lines
485 B
Python
25 lines
485 B
Python
"""
|
|
删除判断接口
|
|
定义判断物料是否需要删除的抽象接口
|
|
"""
|
|
|
|
from abc import ABC, abstractmethod
|
|
from models.material_info import MaterialInfo
|
|
|
|
|
|
class IDeletionChecker(ABC):
|
|
"""删除判断接口"""
|
|
|
|
@abstractmethod
|
|
def should_delete(self, material: MaterialInfo) -> bool:
|
|
"""
|
|
判断物料是否需要删除
|
|
|
|
Args:
|
|
material: 物料信息对象
|
|
|
|
Returns:
|
|
是否需要删除
|
|
"""
|
|
pass
|