feat(growth): automate sales source reconciliation
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user