from ...sync_system.strategy import DefaultSyncStrategy
from ...sync_system.config import StrategyConfig, OrphanAction, UpdateDirection
from schemas.project.project_base import ProjectResponseBase


class ProjectSyncStrategy(DefaultSyncStrategy[ProjectResponseBase]):
    """
    Project 同步策略
    
    业务规则：
    1. 手动绑定（根节点）
    2. 允许拉取更新（不自动创建）
    3. 依赖公司（company）
    
    schema 已在类定义中设置，禁止在初始化时传入其他 schema。
    """
    
    # 类变量：schema 固定为 ProjectResponseBase
    schema = ProjectResponseBase
    
    # 类变量：默认配置
    default_config = StrategyConfig(
        auto_bind=False,
        auto_bind_fields=[],
        depend_fields={"company_id": "company"},
        local_orphan_action=OrphanAction.CREATE_REMOTE,
        remote_orphan_action=OrphanAction.NONE,
        update_direction=UpdateDirection.PUSH,
    )