fix(performance): 11번가 원본 데이터 확인 — "해당 건 없음"은 0건, 기간 조회·구매확정 후보

9/9 확인 결과: 취소·반품 주소는 코드 -1 "해당 건이 없습니다"(= 0건)인데 실패로
표시했고, 주문 목록 4개는 지금 그 상태인 주문만 주는 듯해 이미 구매확정된
9/9 주문이 어디에도 없었다. 정산 내역은 정산확정일 기준일 가능성이 있다.

- 결과 문구가 "해당 건이 없습니다" 류면 오류가 아니라 0건
- 기간 조회(최대 31일, 7일씩 나눠 호출) — 매출일부터 정산확정일까지 넓게 확인
- 구매확정 목록 후보 주소 추가
- 테스트 갱신

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 01:14:32 +09:00
parent 1952e4f0b1
commit 7d96f2e738
7 changed files with 55 additions and 27 deletions
@@ -861,14 +861,22 @@ def test_elevenst_connection():
def route(url, headers=None, timeout=None):
if "/ordservices/complete/" in url:
return httpx.Response(200, content=rows)
if "/ordservices/purchaseconfirm/" in url:
return httpx.Response(404, content=b"<html>not found</html>")
if "/ordservices/" in url:
return httpx.Response(200, content=b"<ns2:orders xmlns:ns2='x'/>")
if "/claimservice/" in url:
return httpx.Response(200, content="<ns2:orders xmlns:ns2='x'><ns2:result_code>-1</ns2:result_code>"
"<ns2:result_text>해당 건이 없습니다.</ns2:result_text></ns2:orders>".encode())
return httpx.Response(404, content=b"<html>not found</html>")
httpx.get = route
rec = ev.ElevenstAdapter().reconcile(ctx, date(2026, 9, 29))
wide = ev.ElevenstAdapter().reconcile(ctx, date(2026, 9, 1), to=date(2026, 9, 20)) # 7일씩 3번
assert wide["to"] == "2026-09-20" and {p["key"]: p.get("count") for p in wide["probes"]}["complete"] == 6
by = {p["key"]: p for p in rec["probes"]}
assert by["complete"]["ok"] and by["complete"]["count"] == 2 and by["shipping"]["count"] == 0
assert not by["canceledorders"]["ok"] and "404" in by["canceledorders"]["error"]
assert not by["purchaseconfirm"]["ok"] and "404" in by["purchaseconfirm"]["error"]
assert by["canceledorders"]["ok"] and by["canceledorders"]["count"] == 0 # 코드 -1 "해당 건이 없습니다" = 0건
f = {x["name"]: x for x in by["complete"]["fields"]}
assert f["ordPayAmt"]["sum"] == 15_500 and f["rcvrNm"]["personal"] and f["rcvrNm"]["sample"] == ""
assert f["prdNm"]["sample"] == "상품1" and "홍길동" not in repr(rec)