From 48cae3b16388d4738e44a5eaa7554980de479b6d Mon Sep 17 00:00:00 2001 From: king Date: Wed, 21 Oct 2026 10:44:50 +0900 Subject: [PATCH] =?UTF-8?q?feat(performance):=20=EC=88=98=EB=8F=99=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=20=EC=BC=A0=20=EC=87=BC=ED=95=91=EB=AA=B0?= =?UTF-8?q?=EC=9D=80=20=EB=A7=A4=EC=B6=9C=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=EC=97=90=EC=84=9C=20=EC=A0=9C=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API 가 설정돼 있어도 설정에서 수동 입력을 켠 쇼핑몰은 수동·자동 매출 업데이트(과거 매출 가져오기 포함)에서 빠진다. 설정 화면 안내 문구 갱신. Co-Authored-By: Claude Opus 5.5 --- app/modules/performance/CLAUDE.md | 1 + app/modules/performance/sync.py | 3 ++- .../templates/performance/settings.html | 4 ++-- app/modules/performance/tests/test_performance.py | 14 ++++++++++++++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/modules/performance/CLAUDE.md b/app/modules/performance/CLAUDE.md index 2da498c..6ca204c 100644 --- a/app/modules/performance/CLAUDE.md +++ b/app/modules/performance/CLAUDE.md @@ -37,6 +37,7 @@ ## 수동 입력 - 설정의 쇼핑몰별 **수동 입력** 토글(마이그레이션 002 `manual_input`·`perf_manual_sales`) — 켜면 일자별 표 날짜 칸에 총매출 직접 입력, 넣은 날은 API 값 대신(`daily_amounts` 한 곳). + 수동 입력 켠 쇼핑몰은 **API 가 설정돼 있어도 매출 업데이트(수동·자동·과거 매출 가져오기)에서 빠진다**(2026-10-21, `sync.sync_all` 대상 고르기 한 곳) — 예전에 받은 API 값은 그대로 남음. - 일자별 표 [엑셀 업로드] 팝업(`manual_upload.py`, `POST /performance/api/manual-sales/upload`) — 1열 날짜·2열부터 쇼핑몰 이름 머리글, 수동 입력 켜진 쇼핑몰 열의 값 있는 칸만 반영(덮어씀, 빈 칸 그대로), 잘못된 칸이 하나라도 있으면 전부 저장 안 함, 샘플 = 모듈 폴더 `upload_sample.xlsx`. - 열 순서 카페24·네이버·쿠팡(윙)·쿠팡(로켓)·오늘의집·G마켓·카카오·GS샵·11번가·롯데ON·토스·애터미아자몰(마이그레이션 003). - 쿠팡(로켓)·애터미아자몰은 **수동 입력 전용**(`adapters/manual.py`, `manual_only` — 매출 업데이트에서 빠지고 인증 설정·연결 테스트 없음, 수동 입력 늘 켜짐). diff --git a/app/modules/performance/sync.py b/app/modules/performance/sync.py index 91780d9..a9fc7d8 100644 --- a/app/modules/performance/sync.py +++ b/app/modules/performance/sync.py @@ -164,7 +164,8 @@ class SyncService: """job: jobs.SyncJob — 주면 쇼핑몰마다 진행 상황(ShopProgress)을 채운다(매출 업데이트 창).""" end = end or today_kst() start = start or (end - timedelta(days=sync_days() - 1)) - enabled = {m["code"] for m in self._store.list_marketplaces() if m["enabled"]} + # 설정에서 수동 입력을 켠 쇼핑몰은 API 가 설정돼 있어도 매출 업데이트(수동·자동·과거 매출 가져오기)에서 뺀다 + enabled = {m["code"] for m in self._store.list_marketplaces() if m["enabled"] and not m.get("manual_input")} # 수동 입력 전용 쇼핑몰(manual_only)은 가져올 API 가 없어 매출 업데이트에서 뺀다 targets = [a for a in all_adapters() if a.code in enabled and not a.manual_only and (not codes or a.code in codes)] diff --git a/app/modules/performance/templates/performance/settings.html b/app/modules/performance/templates/performance/settings.html index f78d2dc..0659123 100644 --- a/app/modules/performance/templates/performance/settings.html +++ b/app/modules/performance/templates/performance/settings.html @@ -21,7 +21,7 @@

쇼핑몰 설정

{% if is_admin %} 사용 · 매출 집계 · 수동 입력 · 수수료율은 바로 저장됩니다. API 인증정보는 [설정]에서 입력합니다. - 수동 입력을 켜면 실적 일자별 표에서 그 쇼핑몰 날짜 칸에 매출을 직접 넣을 수 있습니다. + 수동 입력을 켜면 실적 일자별 표에서 그 쇼핑몰 날짜 칸에 매출을 직접 넣을 수 있고, API 가 설정돼 있어도 매출 업데이트(수동·자동)에서 빠집니다. {% else %} 쇼핑몰별 수수료율을 설정합니다. 바로 저장되며 실적 화면의 수수료·수수료 차감 매출에 반영됩니다. {% endif %} @@ -57,7 +57,7 @@ -