feat(실적): 틱톡 탭 삭제 + [말레이시아 실적] 모듈 추가

- 실적 틱톡 탭·tiktok_ads 광고 API·테스트 삭제, 틱톡 데이터 삭제 SQL(performance_db 012)
- 말레이시아 실적: 실적 라우터·화면을 /malaysia/performance 에 한 번 더 마운트,
  차이는 performance/variant.py(KR·MY) 한 곳 — 저장소·권한키·주소·광고 채널·통화
- 틱톡·쇼피·라자다 그룹(쇼핑몰 + 라이브커머스 하위, 그룹 열 = 합계), 광고비 채널 3개
- 금액 RM 소수 2자리 = 센 정수 저장(입력·엑셀 scale, 화면 num/money, JS money)
- malaysia_performance_db = performance_db 구조 복사 + seed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 16:03:18 +09:00
parent e9f57b6ff6
commit 62cc5e2778
34 changed files with 790 additions and 892 deletions
+5 -4
View File
@@ -80,12 +80,13 @@ class _Parser:
return Decimal(tok)
def parse_amount(raw: object) -> tuple[int | None, str | None]:
"""칸 입력 → (원 단위 금액, 계산식). 빈 칸 = (None, None)(지움). 숫자 하나(부호 포함)면 계산식 없음."""
def parse_amount(raw: object, scale: int = 1) -> tuple[int | None, str | None]:
"""칸 입력 → (저장 단위 금액, 계산식). scale=100 = 센(말레이시아 실적 RM 소수 2자리 — 12.5 → 1250).
빈 칸 = (None, None)(지움). 숫자 하나(부호 포함)면 계산식 없음."""
text = str(raw if raw is not None else "").strip()
for a, b in _OPS.items():
text = text.replace(a, b)
text = re.sub(r"[,\s원]", "", text)
text = re.sub(r"[,\s원]|RM", "", text, flags=re.IGNORECASE)
if text.startswith("="): # 엑셀 버릇으로 = 를 붙여도 된다
text = text[1:]
if text == "":
@@ -100,7 +101,7 @@ def parse_amount(raw: object) -> tuple[int | None, str | None]:
raise FormulaError("계산할 수 없는 식입니다.") from None
if p.peek() is not None:
raise FormulaError("계산식이 올바르지 않습니다.")
amount = int(value.quantize(Decimal("1"), rounding=ROUND_HALF_UP))
amount = int((value * scale).quantize(Decimal("1"), rounding=ROUND_HALF_UP))
# 숫자 하나(앞 부호만 있는 것 포함)는 계산식이 아니다
is_formula = any(t in "+-*/()" for t in tokens[1:]) or (tokens[0] == "(")
return amount, (text if is_formula else None)