Project

General

Profile

Edit Copy Actions

Feature #10224

open

Implement POS Loyalty Rewards Redemption, Sales Mapping & Customer Accounts Aggregation

Added by Ajit A 1 day ago. Updated 1 day ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
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`).
2. Backend Models & POS Sale Persistence
  • 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.
3. Customer Accounts & Ledger Aggregation Fix
  • 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.
4. Sales List Page & Settings Navigation UI
  • 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.

Add

Subtasks


Add

Related issues

Actions #1

Updated by Ajit A 1 day ago

  • Status changed from New to Resolved
Edit Copy Actions

Also available in: Atom PDF