from ...sync_system.strategy import DefaultSyncStrategy
from ...sync_system.config import StrategyConfig, OrphanAction, UpdateDirection
from schemas.project_extensions.contract_change import ContractChangeResponse


class ContractChangeSyncStrategy(DefaultSyncStrategy[ContractChangeResponse]):
    """
    Contract Change 同步策略。
    """

    schema = ContractChangeResponse

    default_config = StrategyConfig(
        auto_bind=True,
        auto_bind_fields=["contract_id", "change_time", "title"],
        depend_fields={"project_id": "project", "contract_id": "contract"},
        local_orphan_action=OrphanAction.CREATE_REMOTE,
        remote_orphan_action=OrphanAction.NONE,
        update_direction=UpdateDirection.PUSH,
    )