Subject changed from To implement the Contactus form in E-commerce to To implement the Contact form submission with manage notfication in E-commerce and loyalty program action history
% Done changed from 0 to 100
1. Backend Repository (evergreen_pos_be) 📩 Contact Form Submissions Feature Public Submission Endpoint: Added POST /api/v1/nus-shop/submit-contact (publicSubmitContact) to handle customer contact form submissions from the public storefront, save entries to MongoDB, and trigger in-app notifications. Admin Management APIs: GET /api/v1/nus-shop/admin/contact-submissions (getAllContactSubmissions) PATCH /api/v1/nus-shop/admin/contact-submissions/:id/status (updateContactSubmissionStatus) DELETE /api/v1/nus-shop/admin/contact-submissions/:id (deleteContactSubmission) Multi-Tenant DB Fallback: Configured tenant fallback resolution across company.dbName, user.dbName, tenant.dbName, "evergreen", "pos", and "nexshop". Dual String & ObjectId _id Matching: Updated ContactSubmissionSchema to use _id: { type: Schema.Types.Mixed } and query via $or: [{ _id: targetId }, { _id: new ObjectId(targetId) }]. This supports documents inserted with either string _ids or BSON ObjectIds without 404 casting errors. ⚙️ Schema & Model Mappings Created: src/models/Contact/contactSubmissionSchema.js Updated dbUtils.js & modelMap.js: Registered ContactSubmission (contactsubmissions collection). Updated notificationSchema.js: Added "Contact_Submission_Created" event under the "Contact" category. Loyalty Service Adjustments: Minor refactorings in loyaltyEngine.js and loyaltyProgram.service.js. 2. Admin & POS Frontend Repository (evergreen_pos_fe) 📋 Admin Contact Forms Page Created Page: src/pages/Nuresy/Ecommerce/ContactForms.tsx featuring search, status filter (All, New, Reviewed, Resolved), pagination, column sorting, inline status updates, action history tooltips, and deletion. Sidebar Integration: Added "Contact Forms" link with ContactMailIcon in src/components/Sidebar/index.tsx under the Trust section. 🔒 Routing & Auth Session Fix (Page Reload Issue) Router Linking: Added /admin/contact-forms route entry to dashboardRoutes in src/router/router.link.tsx. Session Protection & Static Segment Fix: Added 'admin', 'contact-forms', 'review-moderation', 'content-studio', 'product-qa', and 'return-requests' to STATIC_ROUTE_SEGMENTS (src/utils/tenantSession.ts) and reservedPaths (src/api/api.tsx). Resolved Reload Bug: Prevents /admin/... from being misidentified as a tenant slug upon browser refresh, eliminating unwanted redirects to the login screen. 3. Storefront Repository (evergreenpos_E-commerce_new) 🛒 Contact Us Page Redesign Updated Component: src/layout/Contact/Contact.tsx Redesigned 2-column contact section with Corporate Office details, Phone, Email, and Social links. Added customer benefits breakdown alongside the inquiry form. Integrated public submission API handler with loading and success feedback. Breadcrumb Navigation: Minor refinement in src/components/AutoBreadcrumbs.tsx.