feat(카페24): 옵션/품목 팝업에 재고관리·재고 수량·품절표시 설정
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -257,6 +257,7 @@ def _variant_view(v: dict[str, Any]) -> dict[str, Any]:
|
||||
"selling": products._flag(v.get("selling")), # noqa: SLF001
|
||||
"quantity": v.get("quantity"),
|
||||
"use_inventory": products._flag(v.get("use_inventory"), default=False), # noqa: SLF001
|
||||
"display_soldout": products._flag(v.get("display_soldout"), default=False), # noqa: SLF001
|
||||
"image": str(v.get("image") or ""),
|
||||
}
|
||||
|
||||
@@ -664,7 +665,7 @@ def variants_update(
|
||||
product_no: int,
|
||||
payload: dict[str, Any] = Body(default_factory=dict),
|
||||
) -> dict[str, Any]:
|
||||
"""품목 여러 건의 자체코드 · 추가금액 · 진열 · 판매를 한 번에 바꾼다 — **행별 결과**.
|
||||
"""품목 여러 건의 자체코드 · 추가금액 · 진열 · 판매 · 재고(사용·수량·품절표시)를 한 번에 바꾼다 — **행별 결과**.
|
||||
|
||||
응답 {"ok": 전부 성공?, "partial": 일부만?, "updated": {code: 반영된 값},
|
||||
"failed": {code: 사유}, "unknown": {code: 사유}}
|
||||
@@ -697,7 +698,8 @@ def variants_update(
|
||||
code = result["variant_code"]
|
||||
if result["status"] == products.VARIANT_OK:
|
||||
patch = dict(sent.get(code) or {})
|
||||
for key in ("custom_variant_code", "additional_amount", "display", "selling", "display_order"):
|
||||
for key in ("custom_variant_code", "additional_amount", "display", "selling", "display_order",
|
||||
"use_inventory", "display_soldout", "quantity"):
|
||||
value = (result.get("variant") or {}).get(key)
|
||||
if value is not None:
|
||||
patch[key] = value
|
||||
|
||||
Reference in New Issue
Block a user