feat(performance): 직접 추가 쇼핑몰(수동 입력)·쇼핑몰 그룹·설정 드래그 순서

- 마이그레이션 009: perf_marketplaces.is_custom·is_group·parent_code
- 설정: [+ 쇼핑몰 추가(수동 입력)]·[+ 그룹 추가], 이름 변경·삭제, 직접 추가 쇼핑몰 그룹 select
- custom_ 코드는 registry.get_adapter 가 수동 입력 전용 어댑터(CustomManualAdapter)로
- 매출 실적 표: 그룹 열 = 보이는 하위 쇼핑몰 합계(일 합계엔 안 더함), ▾/▸ 하위 열 접기(localStorage)
- 설정 표 ⠿ 드래그 → PUT /api/marketplace-order → sort_order, 화면 순서는 ordered_marketplaces 한 곳
- 테스트: test_custom_groups.py, perf_groups.browser.test.js

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 10:57:03 +09:00
parent 5ef9a55d91
commit e3a8649b41
18 changed files with 948 additions and 44 deletions
@@ -23,3 +23,10 @@ class CoupangRocketAdapter(ManualOnlyAdapter):
class AtomyAzmallAdapter(ManualOnlyAdapter):
code = "atomy"
name = "애터미아자몰"
class CustomManualAdapter(ManualOnlyAdapter):
"""실적 설정에서 사용자가 직접 추가한 쇼핑몰(마이그레이션 009, 코드 custom_…) — 이름은 DB(perf_marketplaces.name)."""
def __init__(self, code: str) -> None:
self.code = code
+10 -2
View File
@@ -14,7 +14,7 @@ from .gmarket import GmarketAdapter
from .gsshop import GsshopAdapter
from .kakao import KakaoAdapter
from .lotteon import LotteonAdapter
from .manual import AtomyAzmallAdapter, CoupangRocketAdapter
from .manual import AtomyAzmallAdapter, CoupangRocketAdapter, CustomManualAdapter
from .naver import NaverAdapter
from .ohouse import OhouseAdapter
from .toss import TossAdapter
@@ -36,10 +36,18 @@ _ADAPTERS: tuple[MarketplaceAdapter, ...] = (
)
_BY_CODE = {a.code: a for a in _ADAPTERS}
# 실적 설정에서 직접 추가한 행(마이그레이션 009) — 쇼핑몰은 수동 입력 전용 어댑터, 그룹은 어댑터 없음(매출 없음)
CUSTOM_PREFIX = "custom_"
GROUP_PREFIX = "group_"
def all_adapters() -> tuple[MarketplaceAdapter, ...]:
return _ADAPTERS
def get_adapter(code: str) -> MarketplaceAdapter | None:
return _BY_CODE.get(code)
"""코드 → 어댑터. 직접 추가 쇼핑몰(custom_…)은 수동 입력 전용 어댑터, 그룹·모르는 코드는 None."""
adapter = _BY_CODE.get(code)
if adapter is None and code.startswith(CUSTOM_PREFIX):
return CustomManualAdapter(code)
return adapter