first commit

This commit is contained in:
strepsiades
2026-03-09 16:31:42 +08:00
commit 4a9c444b10
486 changed files with 52479 additions and 0 deletions
@@ -0,0 +1,29 @@
from ...sync_system.strategy import DefaultSyncStrategy
from ...sync_system.config import StrategyConfig, OrphanAction, UpdateDirection
from schemas.company.company import CompanyResponse
class CompanySyncStrategy(DefaultSyncStrategy[CompanyResponse]):
"""
Company 同步策略
业务规则:
1. 使用 (code) 作为业务唯一键
2. 支持自动绑定
3. 默认配置为日常推送模式(本地创建推送到远程,不拉取远程孤儿)
schema 已在类定义中设置,禁止在初始化时传入其他 schema。
"""
# 类变量:schema 固定为 ContractResponse
schema = CompanyResponse
# 类变量:默认配置
default_config = StrategyConfig(
auto_bind=True,
auto_bind_fields=["credit_code"],
depend_fields={},
local_orphan_action=OrphanAction.NONE,
remote_orphan_action=OrphanAction.CREATE_LOCAL,
update_direction=UpdateDirection.PULL,
)