fix(loyalty): terminal icons, server-side i18n, category in transactions
Some checks failed
Some checks failed
- Fix icons: plus-circle → plus, backspace → arrow-left - Convert terminal $t() calls to server-side _() for card_label, stamps_until_reward, reward_label, not_enough_stamps - Inject transaction type labels as server-rendered window._txLabels object (eliminates all async i18n warnings on terminal page) - Resolve category_names in store transactions list endpoint Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -652,11 +652,22 @@ def list_store_transactions(
|
||||
db, merchant_id, skip=skip, limit=limit
|
||||
)
|
||||
|
||||
from app.modules.loyalty.services.category_service import category_service
|
||||
|
||||
tx_responses = []
|
||||
for t in transactions:
|
||||
tx = TransactionResponse.model_validate(t)
|
||||
if t.card and t.card.customer:
|
||||
tx.customer_name = t.card.customer.full_name
|
||||
if t.category_ids and isinstance(t.category_ids, list):
|
||||
names = []
|
||||
for cid in t.category_ids:
|
||||
name = category_service.validate_category_for_store(
|
||||
db, cid, t.store_id or 0
|
||||
)
|
||||
if name:
|
||||
names.append(name)
|
||||
tx.category_names = names if names else None
|
||||
tx_responses.append(tx)
|
||||
|
||||
return TransactionListResponse(transactions=tx_responses, total=total)
|
||||
|
||||
Reference in New Issue
Block a user