Feature #10704
opento test and fix the bugs in Ecommerce and Admin dashboard
Subtasks
Related issues
Updated by Ajit A 16 days ago
- Estimated time changed from 8:00 h to 16:00 h
🔹 Backend (evergreen_pos_be)
Gift Card Management & Validation:
Added suitability validation to quoteGiftCard (card status, active balance, expiration date, and maxPayable > 0 check).
Added gift card balance recharge endpoint (POST /api/v1/growth/gift-cards/recharge).
Added /api/v1/growth to STOREFRONT_PREFIXES in tenantPermissions.js to ensure proper tenant database resolution.
Order Placement & Payment Service Fixes:
Stripe Discount Breakdown: Itemized active discount breakdown strings (Coupon, Reward Points, Gift Card, Referral Credit) directly inside Stripe Checkout session coupons.
Deferred Gift Card Redemption: Updated persistPendingStripeOrder so gift cards are only redeemed upon order payment completion (completed or cash), avoiding premature balance deduction when opening Stripe Checkout.
Stripe Back / Cancel Navigation: Updated Stripe cancel_url to include all active discount params (couponCode, pointsToRedeem, giftCardCode, referralCredit) so returning to checkout preserves applied discounts.
Mongoose Validation Fix: Updated $0 net order payment status assignment from "paid" to "completed" to match Order schema enum values.
Gift Wrap Eligibility: Handled fallback fee calculation so missing product gift wrap flags don't throw blocking 400 errors on order placement.
Loyalty Program:
Updated loyalty reward settings and earning/redemption calculations in loyaltyProgram.service.js.
🔹 E-Commerce Frontend (evergreenpos_E-commerce_new)
Discount Persistence & URL Synchronization:
Dynamically synchronized applied discount states (couponCode, pointsToRedeem, giftCardCode, referralCredit) with browser URL query parameters.
Restored and re-applied all active discounts on page refresh and when returning from Stripe.
Shipping Error Handling & Retry UX:
Handled network socket reset errors (read ECONNRESET) gracefully with friendly user alerts and 1-time auto-retry.
Added interactive "Retry" buttons in the shipping alert banner and Order Summary line.
UI Enhancements:
Redesigned the Remove button in the Gift Card and Coupon UI sections into clean text buttons.
🔹 POS Admin Frontend (evergreen_pos_fe)
Loyalty & Reward Settings:
Updated tabbed UI layout and form configuration in LoyaltyRewardSettings.tsx.
Updated by Ajit A 15 days ago
- Subject changed from to find and fix the bugs in Ecommerce and Admin dashboard to to test and fix the bugs in Ecommerce and Admin dashboard
- % Done changed from 0 to 100
Fix Pre-Order Catalog E-Commerce APIs & Runtime Errors
Issue: Pre-order catalogs returned catalog: [] on e-commerce frontend endpoints due to restrictive date filtering, and viewing single catalogs crashed with ReferenceError: endDate is not defined.
Fix: Updated catalog date evaluation in order.service.js to allow active pick/delivery catalogs and defined endDate.
Pre-Order Quick Cart UX & Quiet Item Addition
Issue: Every click on pre-order buttons automatically popped open the Quick Cart drawer drawer, interrupting shopping.
Fix: Removed drawer auto-opening on pre-order item increment/decrement. Added green initial PRE-ORDER button and side-by-side quantity selector [- N +] with green GO TO CART → button.
Hide Empty "Items Needing Attention (0)" Section
Issue: "Items Needing Attention (0)" header section was visible in the cart drawer even when there were 0 issues.
Fix: Updated HeaderPreorderCart.tsx and PreorderCartPanel.tsx to conditionally render the section only when issueItems.length > 0.
URL Parameter Persistence & Auto-Sync on Pre-Order Checkout
Issue: Applied offer coupons (couponCode) and reward points (pointsToRedeem) were lost when refreshing (F5) on pre-order checkout (/checkout-payment-preorder).
Fix: Added real-time URL search parameter synchronization (window.history.replaceState) and initial URL parameter restoration on mount in CheckoutPreorder.tsx.
Stripe Checkout Itemized Coupon Splitups & Single Currency Enforcement
Issue:
Stripe payment gateway did not show combined discount names (Coupons + Rewards).
Stripe Adaptive Pricing automatically converted USD to INR (₹7,055.24) based on buyer IP.
Fix:
Updated payment.service.js to create combined Stripe discount line items (e.g., SRAV11 + Rewards).
Added adaptive_pricing: { enabled: false } to stripe.checkout.sessions.create so Stripe Checkout presents ONLY the store's selected currency ($71.80 USD).
Fix Stripe Cancellation Return URL & Parameter Cleanup
Issue: Cancelling Stripe Checkout and returning to pre-order checkout lost couponCode and included empty params (&giftCardCode=&referralCredit=).
Fix: Updated payment.service.js to build cancel_url dynamically using URLSearchParams, correctly passing couponCode and omitting empty params.
Toast Notification Suppression on Page Reload
Issue: Reloading the checkout page popped up redundant notification toasts ("Coupon Applied!", "Delivery charge: $16.00").
Fix: Added isSilent = true parameters during initial restoration in CheckoutPreorder.tsx to suppress reload toast noise.
📂 File Changes Summary
🎨 Frontend Repository (evergreenpos_E-commerce_new)
catlogproducts.tsx
: Updated pre-order button UI to green side-by-side controls and quiet quantity changes.
ProductUnifiedCard.tsx
: Disabled auto drawer open on pre-order add.
productdetailsui.tsx
: Disabled auto drawer open on product detail pre-order add.
PreorderCartPanel.tsx
: Hidden empty "Items Needing Attention (0)" section.
HeaderPreorderCart.tsx
: Hidden empty "Items Needing Attention (0)" section.
CheckoutPreorder.tsx
: Added URL parameter restoration, URL sync, and quiet toast restoration for coupons, reward points, and delivery charges.
Checkout.tsx
: Added URL parameter persistence and restoration for standard checkout.
QuickCart.tsx
: Standardized cart drawer handlers.
⚙️ Backend Repository (evergreen_pos_be)
order.service.js
: Fixed pre-order catalog date query filters and defined endDate.
payment.service.js
: Passed couponCode in orderData, created itemized Stripe discount coupon names, disabled Stripe adaptive pricing (adaptive_pricing: { enabled: false }), and built clean cancel_url parameters.
cart.service.js
: Updated pre-order cart item resolution logic.
tax-engine.service.js
: Aligned tax calculation payload formatting.