Project

General

Profile

Edit Copy Actions

Feature #10407

open

To implement preferred countries in the company details schema and the country selection dropdown in the e-commerce header and checkout address section, as well as in the admin-side address component.

Added by Ajit A about 1 month ago. Updated about 1 month ago.

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

100%

Estimated time:
3:00 h
Spent time:

Add

Subtasks


Add

Related issues

Updated by Ajit A about 1 month ago

  • Status changed from New to In Progress

Summary of Changes: Preferred Countries & Address Autocomplete Enhancements
1. Backend Enhancements (API Updates):

Company Schema (company-model.js): Replaced the legacy preferredLocation (string) field with a preferredCountries (array of strings) field to support multi-select functionality for locations.
Contact Details API (shop-controller.js): Updated the /v1/nus-shop/get-company-store-contact-details and /v1/nus-shop/get-public-company-settings endpoints to successfully retrieve and expose the preferredCountries array to the frontend applications.
2. Company Profile (Settings Panel):

Multi-Select Country Dropdown (CompanyProfile.tsx):
Migrated the "Preferred Location" plain text input to a rich Autocomplete multi-select dropdown.
Pre-populated a comprehensive hardcoded list of global countries, prioritizing "India" and "United States" at the top.
Updated the UI to use styled Chip components (size="small") to handle multiple selections cleanly without breaking the grid layout.
Updated Form Validation (Yup) and CompanySettings interfaces to expect the new string array format.
3. E-commerce Storefront (Header):

Dynamic Currency/Country Selector (CountryCurrencySelector.tsx):
Linked the Header dropdown to the company profile settings (useCompanyFeatures).
The dropdown now dynamically generates its available options strictly based on the preferredCountries configured in the backend.
Implemented a generic initial-based flag fallback component for countries that do not have custom SVGs natively defined (like US/IN).
4. POS Dashboard (Address Autocomplete Integration):

Redux Store Integration (companySlice.ts): Added the preferredCountries array to the CompanyState interface so it is readily available globally across the POS dashboard.
MUI Address Autocomplete (AddressAutocomplete.tsx):
Integrated the preferredCountries list directly into the component via Redux (useSelector).
Rendered a small, compact Select dropdown next to the Address input field for the user to select the country context.
Implemented an ISO code mapping function (e.g. mapping "India" to "in").
Updated the Google Places API call (/places/autocomplete) to restrict search results to the selected country dynamically via the components: country:<ISO> parameter.
Ant Design Address Autocomplete (antdaddressautocomplate.tsx):
Mirrored the exact same dynamic logic (Redux integration, UI dropdown container, and ISO-restricted Google Places API search) into the Ant Design version of the component.
This ensures 100% consistency in country selection across all forms in the POS system (e.g., Product Details, Create User, Company Settings).

Updated by Ajit A about 1 month ago

  • Status changed from In Progress to Resolved

Completed

Actions #3

Updated by Ajit A about 1 month ago

  • % Done changed from 0 to 100
Edit Copy Actions

Also available in: Atom PDF