feat: backfill missing PnL for submitted alphas
This commit is contained in:
@@ -187,7 +187,7 @@ class BulkUpdate(BulkInput):
|
||||
|
||||
|
||||
class JobInput(Contract):
|
||||
kind: Literal["full_sync", "daily_sync", "alpha_refresh", "pnl_refresh", "self_correlation"]
|
||||
kind: Literal["full_sync", "daily_sync", "alpha_refresh", "pnl_refresh", "pnl_backfill", "self_correlation"]
|
||||
alpha_ids: list[str] = Field(default_factory=list)
|
||||
submission: Submission | None = None
|
||||
date_from: date | None = None
|
||||
@@ -195,7 +195,10 @@ class JobInput(Contract):
|
||||
|
||||
@model_validator(mode="after")
|
||||
def validate_ids(self):
|
||||
if self.kind in ("full_sync", "daily_sync"):
|
||||
if self.kind == "pnl_backfill":
|
||||
if self.alpha_ids or self.submission is not None or self.date_from is not None or self.date_to is not None:
|
||||
raise ValueError("检查 PnL 自动覆盖全部本地已提交 Alpha,不接受 ID、分组或日期范围")
|
||||
elif self.kind in ("full_sync", "daily_sync"):
|
||||
if self.alpha_ids:
|
||||
raise ValueError("列表同步不接受 Alpha ID")
|
||||
if self.kind == "full_sync":
|
||||
|
||||
Reference in New Issue
Block a user