Files
ecm_sync_system/sync_state_machine/domain/material/sync_strategy.py
T
strepsiades 4a9c444b10 first commit
2026-03-09 16:31:42 +08:00

20 lines
710 B
Python

from ...sync_system.strategy import DefaultSyncStrategy
from ...sync_system.config import StrategyConfig, OrphanAction, UpdateDirection
from schemas.material.material import MaterialResponse
class MaterialSyncStrategy(DefaultSyncStrategy[MaterialResponse]):
"""
Material 同步策略(合同子业务)。
"""
schema = MaterialResponse
default_config = StrategyConfig(
auto_bind=True,
auto_bind_fields=["contract_id", "material_type"],
depend_fields={"contract_id": "contract", "project_id": "project"},
local_orphan_action=OrphanAction.CREATE_REMOTE,
remote_orphan_action=OrphanAction.NONE,
update_direction=UpdateDirection.PUSH,
)