Feature #10224
openImplement POS Loyalty Rewards Redemption, Sales Mapping & Customer Accounts Aggregation
Start date:
08/04/2026
Due date:
08/04/2026 (2 days late)
% Done:
100%
Estimated time:
8:00 h
Description
Summary of Changes
Implemented full POS loyalty reward points redemption, fixed backend customer account metrics aggregation, mapped loyalty data to the Sales list page, and added URL query parameter tab synchronization.
1. POS Billing & Redemption Controls (Frontend)- Added Quick "⚡ Full Redeem" button in POS Cart billing view.
- Added custom numeric Points and Currency ($) redemption inputs with two-way synced rate calculation.
- Forwarded `pointsToRedeem`, `loyaltyDiscount`, and `estimatedPointsEarned` in POS checkout payloads (`PaymentComponentNew.tsx`).
- Updated `saleSchema` in `nursery.product.js` to store `pointsEarned`, `pointsRedeemed`, and `loyaltyDiscount`.
- Updated `loyaltyWalletSchema.js` to track cumulative `earnedPoints` and `redeemedPoints`.
- Updated `processSaleLoyalty` in `sale.service.js` to save points earned and redeemed directly onto sale documents and customer wallets.
- Fixed `listTenantCustomerLoyaltyAccounts` in `loyaltyProgram.service.js` to aggregate `LoyaltyLedger` matching both `ObjectId` and `String` representations of `clientId`.
- Added wallet fallbacks to ensure customer `redeemedPoints` and `earnedPoints` accurately display in the Customer Accounts table.
- Mapped `pointsEarned` and `pointsRedeemed` into the "Amount Details" column on the Sales page (`/sales?tab=2`).
- Synced top-level settings tabs with URL query parameters (`?tab=programs|accounts|ledger`) in `LoyaltyRewardSettings.tsx`.
- Aligned stat cards into a single horizontal row for Customer Accounts and Reward Points Ledger tabs.
Subtasks
Related issues