from ...sync_system.strategy import DefaultSyncStrategy
from ...sync_system.config import StrategyConfig, OrphanAction, UpdateDirection
from schemas.contract_settlement.contract_settlement_detail import ContractSettlementDetailResponse


class ContractSettlementDetailSyncStrategy(DefaultSyncStrategy[ContractSettlementDetailResponse]):
    """
    Contract Settlement Detail 同步策略（合同子业务明细）。
    """

    schema = ContractSettlementDetailResponse

    default_config = StrategyConfig(
        auto_bind=True,
        auto_bind_fields=["parent_id", "date"],
        depend_fields={"parent_id": "contract_settlement"},
        local_orphan_action=OrphanAction.CREATE_REMOTE,
        remote_orphan_action=OrphanAction.NONE,
        update_direction=UpdateDirection.PUSH,
    )