Feature #11229
openMaintain restock level & reorder level per variant of the product if product has variants
Added by Yalavarthi Thriveni about 1 month ago. Updated 20 days ago.
Subtasks
Related issues
Updated by Yalavarthi Thriveni 28 days ago
- Assignee changed from Pavan Kumar Murala to Yalavarthi Thriveni
- Target version changed from Sprint (09/28/2026 - 10/02/2026) to Sprint (10/05/2026- 10/09/2026)
- Estimated time set to 4:00 h
Updated by Yalavarthi Thriveni 24 days ago
- Assignee changed from Yalavarthi Thriveni to Ajit A
- Target version changed from Sprint (10/05/2026- 10/09/2026) to sprint (10/12/2026 - 10/31/2026)
Updated by Ajit A 20 days ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Repository: evergreen_pos_fe (Frontend)
1. Key Modifications & Features
Reordered Create/Edit Product Flow:
Reorganized sections into an industry-standard logical flow:
Product Basics & Media (Title, Category, Subcategory, Descriptions, Media).
Category Specifications & Attributes (Moved directly beneath Category selection for immediate contextual configuration).
Pricing & Base Inventory Card (Purchase price, unit price, offer price, tax inclusive, base stock, warehouse hierarchy, availability).
Multi-SKU Product Variants & Pack Bundles (Enclosed in a dedicated card with green theme, dimension selection, and matrix table).
Shipping & Package Information (Dedicated modular <ShippingSection />).
Customer Policies & Risk Controls (Unified collapsible accordion grouping Return Policy, Cancellation Policy with variant overrides, and Expiry Tracking).
Barcode & Print Labeling (<BarcodeSection /> placed before action buttons).
Form Actions (Discard, Draft, Save/Update).
Variant-Level Inventory Thresholds:
Added dedicated Restock Level and Reorder Level numerical inputs directly inside the Multi-SKU Variant matrix table with custom tooltips and min-widths.
Product Details Inventory Badges:
Added real-time inventory health status indicators (Out of Stock, Needs Reorder, Near Restock, Available) for individual variants in PeoductDetails.tsx.
Low Stock & Restock Indicators on Product Listings:
Enhanced the product list stock quantity column in Products.tsx to highlight when child variants are nearing or below restock levels (e.g., 2 variants low).
Inventory Warning Slideshow Support for Variants:
Updated WarningSlideshow.tsx to unpack multi-variant products, alerting inventory managers to individual low-stock SKUs alongside single products.
2. Technical & UI Enhancements
Resolved horizontal column clipping in variant table by applying overflowX: 'auto' container styling and minimum column widths for SKU, Cost, Price, Offer Price, Stock, Restock, and Reorder inputs.
Preserved 100% of existing event handlers, state bindings, batch modals, and validation schemas.
Repository: evergreen_pos_be (Backend)
1. Schema Updates
nursery.product.js & productModel.js:
Extended variantSchema to support:
purchasePrice (Number, default 0)
restock_level (Number, min 0, default 0)
reorder_level (Number, min 0, default 0)
2. Service Logic & Validations (product.service.js)
Normalization Middleware (normalizeAndValidateVariantStockLevels):
Added normalization pipeline during createProduct and editProduct to sanitize variant restock and reorder levels to non-negative integers.
Automatically calculates aggregate parent product levels when variants are present to ensure parent-level inventory monitors remain accurate.
Enhanced Restock Level Queries:
Updated getProductsNearRestockLevel and getUnderRestockLevel aggregation queries to evaluate both parent product quantity and nested variant quantities against their respective thresholds.
Added lowStockVariants array to query responses to give frontend views immediate visibility into which specific variants require reordering.