From 92a434530f308c9babaf7c4da9870a588a7b7416 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Tue, 24 Feb 2026 23:04:01 +0100 Subject: [PATCH] refactor: rename points earn endpoint to /points/earn for clarity Use /points/earn and /points/redeem consistently for explicit intent. Co-Authored-By: Claude Opus 4.6 --- app/modules/loyalty/routes/api/store.py | 2 +- app/modules/loyalty/static/store/js/loyalty-terminal.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/modules/loyalty/routes/api/store.py b/app/modules/loyalty/routes/api/store.py index cf3cef55..127ca205 100644 --- a/app/modules/loyalty/routes/api/store.py +++ b/app/modules/loyalty/routes/api/store.py @@ -647,7 +647,7 @@ def void_stamps( # ============================================================================= -@store_router.post("/points", response_model=PointsEarnResponse) +@store_router.post("/points/earn", response_model=PointsEarnResponse) def earn_points( request: Request, data: PointsEarnRequest, diff --git a/app/modules/loyalty/static/store/js/loyalty-terminal.js b/app/modules/loyalty/static/store/js/loyalty-terminal.js index 5d2a97c3..652272a6 100644 --- a/app/modules/loyalty/static/store/js/loyalty-terminal.js +++ b/app/modules/loyalty/static/store/js/loyalty-terminal.js @@ -220,7 +220,7 @@ function storeLoyaltyTerminal() { async earnPoints() { loyaltyTerminalLog.info('Earning points...', { amount: this.earnAmount }); - const response = await apiClient.post('/store/loyalty/points', { + const response = await apiClient.post('/store/loyalty/points/earn', { card_id: this.selectedCard.id, purchase_amount_cents: Math.round(this.earnAmount * 100), staff_pin: this.pinDigits