feat(dispatch): Order ID 강조 + 송장번호 배송조회 딥링크
- Order ID 를 카드에서 가장 크게(22px bold) 표시 — 가장 자주 보는 값 - Tracking 번호 클릭 시 배송사 조회 페이지로 송장번호 채워 새 탭 이동 (store.courier_tracking_url + Jinja 필터 courier_track) - Ninja Van/J&T 등 말레이시아 주요 배송사 URL 매핑(미매핑은 텍스트 폴백) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,7 @@ from __future__ import annotations
|
||||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
from typing import Any, Iterable
|
||||
from urllib.parse import quote
|
||||
|
||||
# ── 작업 상태 필드(토글 대상) ──
|
||||
# 순서 = 작업 진행 순서. label_ko/label_en 은 버튼 표기.
|
||||
@@ -258,6 +259,30 @@ def courier_logo_url(provider: Any) -> str:
|
||||
return _logo_url_for_slug(courier_slug(provider))
|
||||
|
||||
|
||||
# ── 배송사별 송장 조회 딥링크 ──
|
||||
# {t} 자리에 송장번호를 넣어 조회 페이지로 바로 이동(자동 입력 효과).
|
||||
# ⚠️ 배송사 사이트 URL 은 바뀔 수 있다. 안 열리면 여기만 고치면 된다.
|
||||
# 매핑 없는 배송사는 링크 없이 텍스트로 표시(courier_tracking_url 가 "" 반환).
|
||||
_COURIER_TRACK_URL: dict[str, str] = {
|
||||
"ninjavan": "https://www.ninjavan.co/en-my/tracking?id={t}",
|
||||
"jnt": "https://www.jtexpress.my/tracking?billcode={t}",
|
||||
"flash": "https://www.flashexpress.my/fle/tracking?se={t}",
|
||||
"citylink": "https://www.citylinkexpress.com/tracking-result/?track_no={t}",
|
||||
"poslaju": "https://track.pos.com.my/postal-services/quick-access/?track-trace&trackingNo03={t}",
|
||||
"gdex": "https://web.gdexpress.com/official/web/ConsignmentSearch.html?capcheck=true&input_search={t}",
|
||||
"spx": "https://spx.com.my/track?tracking_number={t}",
|
||||
}
|
||||
|
||||
|
||||
def courier_tracking_url(tracking: Any, provider: Any = "") -> str:
|
||||
"""송장번호 + 배송사명 → 조회 딥링크. 매핑/번호 없으면 ""."""
|
||||
t = clean_text(tracking)
|
||||
tmpl = _COURIER_TRACK_URL.get(courier_slug(provider))
|
||||
if not t or not tmpl:
|
||||
return ""
|
||||
return tmpl.replace("{t}", quote(t, safe=""))
|
||||
|
||||
|
||||
def sku_summary(parcels: list[dict[str, Any]]) -> list[dict[str, Any]]:
|
||||
"""전체 박스 기준 SKU별 총 수량(피킹 요약). seller_sku 오름차순."""
|
||||
totals: dict[str, dict[str, Any]] = {}
|
||||
|
||||
Reference in New Issue
Block a user