feat(performance): 카페24 마켓 연동 주문을 해당 쇼핑몰 열로 집계

- 카페24 마켓 통합관리가 가져온 주문(market_id ≠ self)을 MARKET_MAP 으로 네이버·쿠팡·11번가 등 열에
  (SaleEvent.marketplace_code). 연결표에 없는 마켓은 카페24 열 — 전체 합계는 카페24 일별 매출내역과 같음
- 환불도 원 주문의 마켓으로 같은 열에
- 카페24 사건 ID 에 c24: 접두어, 기간 교체는 카페24 열 + 다른 열의 c24: 행만 — 직접 연동분은 보존
- 매출 대조 마켓별 표에 "반영 열", 설정 화면에 "카페24 경유" 표시

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-29 16:54:10 +09:00
parent 4cb37688ed
commit 19396f1745
10 changed files with 156 additions and 61 deletions
+4
View File
@@ -157,9 +157,12 @@ def build_settings(store: Any, *, configured: Mapping[str, bool], key_info: Mapp
key_versions_in_use: Mapping[int, int], sample_count: int) -> dict[str, Any]:
from app.timezone import today_kst # noqa: WPS433
from .adapters.cafe24 import MARKET_MAP # noqa: WPS433
statuses = store.statuses()
rates = store.rate_table()
today = today_kst()
via_cafe24 = set(MARKET_MAP.values()) # 카페24 마켓 통합관리 경유로 매출이 들어오는 쇼핑몰
rows = []
by_code = {m["code"]: m for m in store.list_marketplaces()}
for adapter in all_adapters():
@@ -178,6 +181,7 @@ def build_settings(store: Any, *, configured: Mapping[str, bool], key_info: Mapp
"auth_type": adapter.auth_type, "shared": adapter.uses_shared_integration,
"implemented": adapter.implemented, "note": adapter.note, "docs_url": adapter.docs_url,
"configured": configured.get(adapter.code, False),
"via_cafe24": adapter.code in via_cafe24,
"status": st, "status_label": STATUS_LABELS.get(st, st),
"last_test_at": st_row.get("last_test_at"), "last_test_ok": st_row.get("last_test_ok"),
"last_sync_at": st_row.get("last_sync_at"), "last_success_sync_at": st_row.get("last_success_sync_at"),