Implementa la tienda /store (catálogo BENNU: 750 categorías, 3068 ítems)

Porta la tienda de ítems/transfiguración del sistema antiguo: elegir personaje →
árbol de categorías (3 niveles) → carrito → enviar por correo. Se paga con el
saldo PD o PV de la cuenta (cada ítem lleva su precio y moneda).

- BD: home_store_category (árbol por code "1-1-1") + home_store_item
  (mismos item_id, nombres, iconos, precios y moneda que el original;
  2947 en PD, 121 en PV). Seed en sql/store_catalog.sql, extraído del HTML real.
- lib/store.ts: getStoreCatalog (árbol anidado), getStoreBalances, priceStoreCart
  (precios REALES de BD), purchaseStoreCart (cobro atómico PD+PV con FOR UPDATE y
  reembolso si el envío SOAP falla; `.send items` troceado a 12/correo).
- API: GET /api/store/catalog (tras elegir personaje) y POST /api/store/send.
- components/StoreBrowser.tsx: selector de personaje, árbol colapsable (ítems
  montados solo al abrir), carrito con totales PD/PV, enviar, modal de resultado.
- página /store con la info y el título "Tienda - REINO". Enlaces de ítems e
  iconos por wowhead/zamimg (con tooltip y locale). El enlace ya existía en
  AccountTools. i18n namespace Store (es/en). CSS del árbol/carrito/modal.

Verificado: catálogo E2E (750 cats/3068 ítems), cobro atómico + reembolso y
detección de saldo insuficiente (cuenta 15). SOAP real sin probar (worldserver
caído en este entorno).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-14 23:54:57 +00:00
parent 033ebc6861
commit 026fbcb81c
9 changed files with 4537 additions and 0 deletions
+30
View File
@@ -1927,5 +1927,35 @@
"vpCost": "{cost} VP",
"insufficientVp": "Insufficient balance ({cost} VP)",
"balanceVp": "VP: {balance}"
},
"Store": {
"title": "Store",
"infoTooltip": "- Hover over an item's name to preview its tooltip.",
"infoDb": "- You can click the item names to visit them in our <link>database</link>. There you can view weapons, armor, mounts and pets in 3D!",
"choosePlayer": "Choose the character the items will be sent to",
"selectPlaceholder": "Select a character",
"noCharacters": "You don't have any characters on this account yet.",
"loading": "Loading the store…",
"quantity": "Quantity",
"add": "Add",
"added": "Added",
"colItem": "Item",
"colQty": "Qty",
"colValue": "Value",
"remove": "Remove item",
"empty": "Empty cart",
"send": "Send",
"sending": "Sending…",
"cartEmpty": "Your cart is empty.",
"confirm": "Send the items to {character} for {pd} PD and {vp} VP?",
"successMsg": "Items sent to {character}! Check your in-game mail.",
"errors": {
"insufficientPd": "You don't have enough PD for this purchase.",
"insufficientVp": "You don't have enough VP for this purchase.",
"deliveryFailed": "The items could not be sent (game server unavailable). Your balance has been refunded.",
"invalidCharacter": "Invalid character.",
"emptyCart": "Your cart is empty.",
"generic": "An error occurred. Please try again."
}
}
}