Commit Graph

6 Commits

Author SHA1 Message Date
king cf7c44ce49 fix(performance): coupang 504 timeouts shrink the query window instead of failing
A 31-day FINAL_DELIVERY ordersheet query times out at Coupang's gateway
(504 "Request timed out"). On 502/503/504 or a client timeout the window
is halved (31 -> 15 -> 7 -> 3 -> 1 day) and retried; the shrunk size is
kept for the same status's next windows. Rocket Growth orders do the same.
A 1-day window that still times out is retried twice (3s, 6s) then fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 05:53:07 +09:00
king d5fd617425 fix(performance): coupang API errors name the failing period and status
Long updates are split into 31-day (seller) / 30-day (Rocket Growth)
calls; the error now says which window failed so long-range failures can
be diagnosed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 05:49:17 +09:00
king 6ebf705e27 feat(performance): new marketplace order, 쿠팡(윙) rename, manual-only 쿠팡(로켓)·애터미아자몰
- Column order: 카페24 · 네이버 · 쿠팡(윙) · 쿠팡(로켓) · 오늘의집 · G마켓 · 카카오 ·
  GS샵 · 11번가 · 롯데ON · 토스 · 애터미아자몰 (registry + migration 003 sort_order)
- Existing coupang (WING API) renamed to 쿠팡(윙)
- New manual-only marketplaces coupang_rocket / atomy (adapters/manual.py,
  manual_only flag): skipped by sync_all, no credentials / connection test in
  settings, status "수동 입력", manual input always on (API refuses turning it off)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 02:35:18 +09:00
king 53bead6691 feat(performance): coupang sales - seller-delivery ordersheets + Rocket Growth orders by payment date, reconcile candidates
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:07:41 +09:00
king dd6a849fbd feat(performance): 쿠팡 연결 테스트 — HMAC(CEA) 서명으로 발주서 실제 조회
쿠팡 OPEN API 키를 입력했지만 연결 테스트가 "다음 단계에서 구현"만 돌려줘
키가 이 서버에서 통하는지 알 수 없었다. 키는 판매자당 1개이고 사방넷용
(연동업체 선택)으로 발급한 키는 이 서버 IP 에서 막힐 수 있어 먼저 확인이 필요.

- CEA HMAC-SHA256 서명(signed-date + METHOD + path + query, 공식 예제 방식),
  쿠팡 예시와 같은 쿼리 인코딩(+ → %2B, : 유지)
- test_connection: 오늘 결제완료 발주서(v5 ordersheets) 1건 조회
- 401/403 → 인증 실패 + "연동업체 키면 자체개발로 바꾸고 이 서버 IP 허용" 안내
- 매출 수집은 아직 — 맞출 WING 화면을 정한 뒤 구현(주석에 API 조사 결과)
- 테스트: 서명 형식·쿼리 인코딩·403 메시지·비밀값 미노출

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 00:14:06 +09:00
king aa669553db feat(performance): 실적(쇼핑몰 통합 매출) 모듈 1단계 — 대시보드·설정·보안·어댑터 구조
- 네 영역 분리: ① 수집(adapters/ 쇼핑몰 10곳 + sync.py) ② 보안(security/ + credentials.py)
  ③ 계산·저장(calc.py + db.py) ④ 화면(dashboard.py, router.py, templates, performance.css/js)
- 대시보드: 기간(오늘/이번주/이번달/올해/직접선택, 이전·다음), 쇼핑몰 필터, KPI 5개(진행 중 기간은
  직전 기간 같은 경과일 대비), 일자×쇼핑몰 표(주간합계, 총매출/수수료/차감매출 전환), 일별 추이·
  쇼핑몰 비중(SVG), 월 누적(비중)·연간 누적, 금액 클릭 → 주문 상세
- 설정(관리자): 사용/매출 집계, 수수료율 이력(적용 시작일), 쇼핑몰별 API 인증정보 입력·연결 테스트·
  연결 상태, 마스터 키 상태·재암호화, 테스트(모의) 데이터 생성/삭제
- 인증정보: 설정 화면 입력 → AES-256-GCM(키 버전, AAD=쇼핑몰+항목) 암호화 저장, secret 원문은
  화면으로 다시 보내지 않음, 오류·로그·raw 는 비밀값 가린 뒤 저장. 마스터 키는 APP_ENCRYPTION_KEY(.env)
- 매출 기준일: 결제=결제일, 취소·반품=발생일. 금액 원 단위 정수, 수수료 반올림은 calc.commission 한 곳
- 동기화: 같은 쇼핑몰 동시 실행 차단(running 부분 유니크), 쇼핑몰별 실패 격리, 중복 방지 UNIQUE+UPSERT
- 카페24 어댑터는 기존 app/integrations/cafe24 OAuth 토큰 재사용, 나머지는 입력칸만(수집은 다음 단계)
- performance_db 초기화 스크립트, 권한키 performance(설정은 is_admin), 문서·.env.example

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 16:07:46 +09:00