Inventory Page
Route: /inventory
File: app/inventory/page.tsx
Page Ka Maqsad
Inventory page shop ke saare products manage karne ka main hub hai. Yahan se products add, edit, delete kar sakte hain, categories manage kar sakte hain, aur stock levels track kar sakte hain.
Page Layout
┌─────────────────────────────────────────────────────┐
│ Inventory Management [Categories] [Add] │
├─────────────────────────────────────────────────────┤
│ Search: [________________________] │
│ Brand Filter: [All Brands ▼] Category: [All ▼] │
├─────────────────────────────────────────────────────┤
│ Products Table │
│ Name | Brand | Category | Cost | Sell | Stock | ⚙ │
└─────────────────────────────────────────────────────┘
Kya Kar Sakte Hain?
Products
| Action | Kaise |
|---|---|
| Naya product add | Add Product button → form fill → Create |
| Product edit | Table row mein ✏️ Edit icon |
| Product delete | Table row mein 🗑️ Delete icon (confirm dialog) |
| Products search | Search bar — name, brand, ya IMEI se |
| Brand filter | Dropdown se specific brand |
| Category filter | Dropdown se category ya "No Category" |
| Filters clear | "Clear Filters" button |
Categories
| Action | Kaise |
|---|---|
| Category add | Manage Categories → name enter → Add |
| Category edit | Category list mein ✏️ icon |
| Category delete | Category list mein 🗑️ icon (confirm) |
Add/Edit Product Form Fields
| Field | Required | Description |
|---|---|---|
| Product Name | ✅ Yes | e.g. "Samsung Galaxy A54" |
| Brand | No | e.g. Samsung, Apple, Xiaomi |
| Category | No | Dropdown se select |
| IMEI/Serial No | No | Mobile phone tracking ke liye |
| Cost Price | ✅ Yes | Kitne mein khareeda |
| Selling Price | ✅ Yes | Kitne mein bechna hai |
| Stock Quantity | ✅ Yes | Kitne units available |
| Min Stock Level | No (default: 5) | Low stock alert threshold |
| Description | No | Extra notes |
Search & Filter
Search in fields par kaam karta hai:
- Product name
- Brand
- IMEI/Serial number
Brand Filter: Products se unique brands auto-detect hote hain
Category Filter options:
- All Categories
- No Category (uncategorized products)
- Specific category
Active filters hone par dikhta hai: "Showing X of Y products"
Stock Display
- Normal stock: default text color
- Low stock (quantity ≤ min level): red bold text
Example:
Stock: 3 (red) — min_stock_level = 5
Stock: 15 (normal) — min_stock_level = 5
Activity Logging
Har product/category action automatically log hota hai:
| Action | Log Message Example |
|---|---|
| Product create | Product "Samsung A54" added to inventory |
| Product update | Product "Samsung A54" updated |
| Product delete | Product "Samsung A54" deleted from inventory |
| Category create | Category "Smartphones" created |
| Category update | Category "Smartphones" updated |
| Category delete | Category "Smartphones" deleted |
Database Tables Used
products— main product datacategories— product categoriesactivity_logs— action history
Empty States
| Condition | Message |
|---|---|
| Koi product nahi | "No products found" + Add First Product button |
| Filter match nahi | "No products match your filters" + Clear Filters |
| Loading | "Loading products..." |
Tips for Shop Owners
- Pehle categories banao — Smartphones, Accessories, Tablets, etc.
- IMEI zaroor add karein mobile phones ke liye — search easy ho jati hai
- Min stock level set karein — Dashboard par low stock alert aayega
- Cost vs Selling price — profit margin track karne ke liye dono fill karein
Related Pages
- Sales (POS) — yahan se added products sell hote hain
- Dashboard — total product count aur low stock alerts
- Suppliers — products ko suppliers se link kar sakte hain (DB ready, UI mein abhi product form mein supplier field nahi)