fix(performance): 카페24 매출 대조 채널 표를 market_id × 주문경로로 — self 를 "PC"로 잘못 표시하던 문제
실데이터 확인: market_id "self" 는 PC 전용이 아니라 자체몰 전체이고, 그 안에 주문경로 "PC쇼핑몰"·"모바일웹"이 섞여 있다. 구분을 "자체몰"로 고치고, (market_id, 주문경로) 한 쌍을 한 줄로 나눠 표시. 환불도 원 주문의 주문경로로 같은 줄에 붙인다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -483,6 +483,12 @@ def test_cafe24_normalize_matches_daily_report():
|
||||
# 기기: PC 채널(self)이어도 휴대폰 주문(order_from_mobile=T)은 모바일
|
||||
assert ch["self"]["mobile_orders"] == 1 and ch["self"]["pc_orders"] == 0 and ch["self"]["mobile_total"] == 47_000
|
||||
assert ch["NCHECKOUT"]["pc_orders"] == 1 and ch["mobile"]["mobile_orders"] == 1
|
||||
# self 는 PC 전용이 아니다 — 주문경로(PC쇼핑몰/모바일웹)별로 한 줄씩(실데이터 확인)
|
||||
fake3 = _FakeCafe24([[_c24_order("P1", order_place_name="PC쇼핑몰"), _c24_order("P2", order_place_name="PC쇼핑몰"),
|
||||
_c24_order("M1", order_place_name="모바일웹", order_from_mobile="T")]])
|
||||
rows3 = {(b["market_id"], b["place"]): b for b in fake3.reconcile(ctx, date(2026, 9, 29))["by_channel"]}
|
||||
assert rows3[("self", "PC쇼핑몰")]["orders"] == 2 and rows3[("self", "모바일웹")]["mobile_orders"] == 1
|
||||
assert rows3[("self", "PC쇼핑몰")]["label"] == "자체몰"
|
||||
# 결제수단별(카페24 열만 — 외부 마켓 B 제외)
|
||||
pay = {p["method"]: p for p in rec["by_payment"]}
|
||||
assert pay["신용카드"]["orders"] == 2 and pay["신용카드"]["total"] == 94_000
|
||||
|
||||
Reference in New Issue
Block a user