from ...sync_system.strategy import DefaultSyncStrategy
from ...sync_system.config import StrategyConfig, OrphanAction, UpdateDirection
from schemas.construction.construction_detail import ConstructionDetailResponse


class ConstructionTaskDetailSyncStrategy(DefaultSyncStrategy[ConstructionDetailResponse]):
    """
    Construction Task Detail 同步策略（合同子业务明细）。
    """

    schema = ConstructionDetailResponse

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