20 lines
687 B
Python
20 lines
687 B
Python
from ...sync_system.strategy import DefaultSyncStrategy
|
|
from ...sync_system.config import StrategyConfig, OrphanAction, UpdateDirection
|
|
from schemas.power.power import PowerResponse
|
|
|
|
|
|
class PersonnelSyncStrategy(DefaultSyncStrategy[PowerResponse]):
|
|
"""
|
|
Personnel 同步策略(合同子业务)。
|
|
"""
|
|
|
|
schema = PowerResponse
|
|
|
|
default_config = StrategyConfig(
|
|
auto_bind=True,
|
|
auto_bind_fields=["project_id", "code"],
|
|
depend_fields={"project_id": "project", "contract_id": "contract"},
|
|
local_orphan_action=OrphanAction.CREATE_REMOTE,
|
|
remote_orphan_action=OrphanAction.NONE,
|
|
update_direction=UpdateDirection.PUSH,
|
|
) |