fix(카페24): 옵션 팝업에서 추가한 옵션값이 저장 후 사라지는 버그

- 원인: 카페24 PUT options 는 옵션값 추가를 지원하지 않음(문서). 끝에 덧붙여 보내면
  오류 없이 무시되는데 화면은 "반영했습니다"로 표시하고 다시 읽으면 사라짐
- 기존 옵션에 새 행이 있으면 「저장」이 확인창을 거쳐 옵션 재생성(DELETE → POST →
  자체코드·추가금액·진열/판매·썸네일 재반영)으로 저장. 품목코드는 새로 부여됨
- 서버 build_update_options_request: 옵션값 개수 증가를 400 으로 거부(재생성 안내),
  덧붙이기 경로(allow_append·wait_for_variants·added) 제거
- 테스트·문서 갱신, cafe24-options.js 캐시 버전 올림

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-06 16:45:36 +09:00
parent ab6c243ab7
commit e385b38885
8 changed files with 48 additions and 99 deletions
+6 -11
View File
@@ -519,20 +519,15 @@ def test_route_10_rename_with_lagging_variants_keeps_rows():
assert created["variants"]
def test_route_08_appended_value_pending_until_variant_appears():
def test_route_08_append_value_rejected_before_put():
# 카페24 PUT 은 옵션값 추가를 오류 없이 무시한다 — "저장했는데 사라짐" 대신 400 으로 재생성 안내.
no, cafe = _new_product()
_create_options(no, ["A"])
cafe.hidden_variants = 99 # 새 품목이 한동안 안 보인다
puts = len([c for c in cafe.calls if c[0] == "PUT"])
resp = req("PUT", f"/cafe24/products/{no}/options", json={"options": [{
"option_name": "구성", "option_value": [{"option_text": "A"}, {"option_text": "B"}]}]}).json()
values = resp["option"]["options"][0]["option_value"]
assert values[1]["option_text"] == "B" and values[1]["pending"] is True
got = req("GET", f"/cafe24/products/{no}/options").json()
assert got["option"]["options"][0]["option_value"][1]["pending"] is True
cafe.hidden_variants = 0
got = req("GET", f"/cafe24/products/{no}/options").json()
assert got["option"]["options"][0]["option_value"][1]["pending"] is False
assert len(got["variants"]) == 2
"option_name": "구성", "option_value": [{"option_text": "A"}, {"option_text": "B"}]}]})
assert resp.status_code == 400 and "옵션 재생성" in resp.text, resp.text
assert len([c for c in cafe.calls if c[0] == "PUT"]) == puts
def test_route_11_deleted_variant_stays_hidden():