Files
ecm_sync_system/sync_state_machine/domain/project/sync_strategy.py
T
strepsiades 4a9c444b10 first commit
2026-03-09 16:31:42 +08:00

29 lines
961 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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,
)