Project

General

Profile

Edit Copy Actions

Feature #10697

open

search bar enhancement & order flow tesing

Added by Ajit A 16 days ago. Updated 15 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
09/02/2026
Due date:
% Done:

100%

Estimated time:
2:00 h
Spent time:

Add

Subtasks


Add

Related issues

Updated by Ajit A 16 days ago

  • % Done changed from 0 to 100
  • Estimated time changed from 2:00 h to 3:00 h

1. POS Backend (evergreen_pos_be)
Offer Date Range Query Fix (setting.service.js):
Expanded offer query date boundaries (startDate set to 00:00:00.000 and endDate set to 23:59:59.999) to include offers expiring later on the target end date.
Corrected date range overlap formula to { startDate: { $lte: filterEnd }, endDate: { $gte: filterStart } } so active offers display properly on the POS Admin Offers list page.
2. POS Admin Frontend (evergreen_pos_fe)
Form.Item RangePicker Binding (offerForm.tsx):
Removed wrapping <div> containers inside <Form.Item name="dateRange"> to enable direct state binding to Ant Design <RangePicker>, resolving the "Please select date range" validation error.
Special Character Support for Offer Names (offerForm.tsx):
Updated Offer Name validation regex pattern to /^[a-zA-Z0-9\s%:\-&$!,\.\/\(\)#]+$/ to allow percentage signs (20%), colons (:), hyphens (-), and common offer special characters.
Atomic Date Range State Updates (offerDataFetching.ts, offerTable.tsx, offerindex.tsx):
Refactored handleDateRangeChange for atomic React state updates when picking date ranges.
3. E-Commerce Web Storefront (evergreenpos_E-commerce_new)
Header Real Offer Search Placeholder Priority (Header.tsx):
Integrated active company offer API (/v1/nus-global/offer/all).
Prioritized real offer placeholders (e.g. Offer: September Festive - 20% Off On Entire Category) to appear immediately as item #2 in the search bar animated typing sequence.
Implemented single-timer state machine for typing animation to prevent stuck typing timers.
Live Search Offer Matching & Query Normalization (Header.tsx):
Added Offer: prefix stripping (cleanQuery) so searching for offer titles (e.g., Offer: September Festive...) accurately queries and retrieves matching category and product items without returning empty results.
Calculated and attached offer discount properties (offer: 20, finalPrice) to search result cards so the red -20% OFF badge and original price strikethroughs (e.g. $54.00 $43.20) display in search dropdown cards.
Resolved Maximum update depth exceeded React warning by stabilizing useEffect dependency arrays.
Home OFFERS Section Integration (HomeMerchTabs.tsx):
Updated merch-offer-pool query to combine both individual product-level discount items (e.g. Ear buds -90%) and global company offer items (e.g. 20% Off Category).
Enhanced mapCard to calculate finalPrice and attach red -20% / -90% badges and price strikethroughs across all cards in the OFFERS tab.

Actions #2

Updated by Ajit A 16 days ago

  • % Done changed from 100 to 80
Actions #3

Updated by Ajit A 16 days ago

  • % Done changed from 80 to 100
  • Estimated time changed from 3:00 h to 2:00 h
Actions #4

Updated by Ajit A 15 days ago

  • Status changed from New to Resolved
Edit Copy Actions

Also available in: Atom PDF