feat(growth): automate sales source reconciliation

This commit is contained in:
ogt
2026-07-14 18:37:14 +08:00
parent 5cdf1403bf
commit 3c142c1950
10 changed files with 705 additions and 43 deletions

View File

@@ -1175,7 +1175,7 @@ class ImportService:
logger.error(traceback.format_exc())
return False
def auto_import_from_drive(self) -> Dict[str, Any]:
def auto_import_from_drive(self, *, send_stale_alert: bool = True) -> Dict[str, Any]:
"""
從 Google Drive 自動匯入檔案
@@ -1243,7 +1243,7 @@ class ImportService:
days_since = (datetime.now(TAIPEI_TZ).date() - normalized_last_date).days
data_lag_days = days_since
latest_sales_date = str(normalized_last_date)
if days_since >= 3:
if days_since >= 3 and send_stale_alert:
_send_data_stale_alert(
report_type="upstream_drive",
last_date=str(normalized_last_date),