refactor: extract domain.py (shared site/file/colmap config)

Move ALL_REPORT_SITES / SITE_UNDELIVERED_FILE / BAISHI_FILE / BAISHI_COLUMNS / arrived_pieces_* / STATIONS / _site_cfg out of expected_undelivered into a new leaf module inbound_verify/domain.py. store.py and runtime.py now read site/file config from domain directly instead of through the compare engine (store keeps eu only for _read_business_dates). Behavior identical.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-07-24 08:38:18 +08:00
parent bd0df8909f
commit 91ef8970b8
4 changed files with 114 additions and 94 deletions

View File

@@ -22,6 +22,7 @@ import yaml
from playwright.sync_api import sync_playwright
from inbound_verify.paths import DOWNLOAD_DIR, CONFIG_PATH
from inbound_verify.domain import SITE_UNDELIVERED_FILE
from inbound_verify import state_store
from inbound_verify.sites import shunxin, baishi, zto, yunda, anneng
@@ -444,9 +445,7 @@ def _site_undelivered_handler(site):
)
if exp_ok and act_ok:
return expected_undelivered.write_site_file(site)
stale = os.path.join(
DOWNLOAD_DIR, expected_undelivered.SITE_UNDELIVERED_FILE.format(name=site)
)
stale = os.path.join(DOWNLOAD_DIR, SITE_UNDELIVERED_FILE.format(name=site))
if os.path.exists(stale):
os.remove(stale)
return False