from ...sync_system.strategy import DefaultSyncStrategy
from ...sync_system.config import StrategyConfig, OrphanAction, UpdateDirection
from schemas.material.material_detail import MaterialDetailResponse


class MaterialDetailSyncStrategy(DefaultSyncStrategy[MaterialDetailResponse]):
    """
    Material Detail 同步策略（合同子业务明细）。
    """

    schema = MaterialDetailResponse

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