TGM Manager includes predictive inventory analytics to help optimize spare parts management, reduce stockouts, and minimize excess inventory.
Overview¶
The inventory forecasting system provides:
- Demand Forecasting - Predict future inventory needs based on historical data
- Reorder Recommendations - Automated suggestions for when and how much to order
- Analytics Dashboard - Visual insights into inventory health
- Risk Assessment - Identify items at risk of stockout
REST API¶
Forecasting¶
Get Item Forecast¶
Generate a demand forecast for a specific inventory item.
GET /inventory/forecast/item/{itemId}
Response:
{
"data": {
"itemId": 123,
"itemName": "Bearing 6205-2RS",
"currentStock": 15,
"reorderLevel": 10,
"averageDailyUsage": 0.5,
"forecast": {
"next7Days": 3.5,
"next30Days": 15,
"next90Days": 45
},
"daysUntilStockout": 30,
"recommendedOrderQuantity": 25,
"seasonalTrend": "STABLE",
"confidence": 0.85,
"lastUpdated": "2024-01-31T10:00:00"
}
}
Required Role: ADMIN, MANAGER, or OPERATOR
Get All Forecasts¶
Generate forecasts for all active inventory items.
GET /inventory/forecast/all
Response:
{
"data": [
{
"itemId": 123,
"itemName": "Bearing 6205-2RS",
"currentStock": 15,
"daysUntilStockout": 30,
"riskLevel": "LOW"
},
{
"itemId": 456,
"itemName": "Oil Filter",
"currentStock": 3,
"daysUntilStockout": 5,
"riskLevel": "HIGH"
}
]
}
Required Role: ADMIN or MANAGER
Reorder Recommendations¶
Get Reorder Recommendations¶
Get list of items that need to be reordered with recommendations.
GET /inventory/forecast/reorder-recommendations
Response:
{
"data": [
{
"itemId": 456,
"itemName": "Oil Filter",
"itemCode": "OF-001",
"currentStock": 3,
"reorderLevel": 10,
"maxStock": 50,
"recommendedOrderQuantity": 30,
"estimatedCost": 450.00,
"urgency": "HIGH",
"reason": "Stock below reorder level",
"supplier": {
"id": 5,
"name": "Industrial Supplies Co.",
"leadTimeDays": 7
},
"lastOrderDate": "2023-12-15",
"lastOrderQuantity": 25
},
{
"itemId": 789,
"itemName": "V-Belt",
"itemCode": "VB-042",
"currentStock": 8,
"reorderLevel": 5,
"recommendedOrderQuantity": 15,
"urgency": "MEDIUM",
"reason": "Predicted stockout in 14 days"
}
]
}
Required Role: ADMIN or MANAGER
Dashboard¶
Get Inventory Forecast Dashboard¶
Get comprehensive inventory analytics dashboard.
GET /inventory/forecast/dashboard
Response:
{
"data": {
"summary": {
"totalItems": 450,
"itemsBelowReorderLevel": 12,
"itemsAtRisk": 8,
"itemsOutOfStock": 2,
"totalInventoryValue": 125000.00
},
"riskDistribution": {
"HIGH": 8,
"MEDIUM": 15,
"LOW": 427
},
"topCriticalItems": [
{
"itemId": 456,
"itemName": "Oil Filter",
"daysUntilStockout": 5,
"riskLevel": "HIGH"
}
],
"reorderSummary": {
"itemsNeedingReorder": 12,
"estimatedTotalCost": 5400.00
},
"usageTrends": {
"last7Days": {
"totalUsage": 145,
"trend": "INCREASING"
},
"last30Days": {
"totalUsage": 580,
"trend": "STABLE"
}
},
"turnoverRate": {
"average": 4.2,
"topTurnoverItems": [
{ "itemId": 123, "itemName": "Bearing 6205-2RS", "turnoverRate": 12.5 }
],
"slowMovingItems": [
{ "itemId": 999, "itemName": "Specialty Gasket", "turnoverRate": 0.5 }
]
}
}
}
Required Role: ADMIN or MANAGER
Risk Levels¶
| Level | Description | Criteria |
|---|---|---|
HIGH |
Immediate action required | Stock below reorder level OR < 7 days until stockout |
MEDIUM |
Monitor closely | Stock approaching reorder level OR 7-14 days until stockout |
LOW |
Normal | Adequate stock levels |
Urgency Levels¶
| Level | Description | Action Timeframe |
|---|---|---|
CRITICAL |
Out of stock | Immediate order required |
HIGH |
Below reorder level | Order within 1-2 days |
MEDIUM |
Approaching reorder | Order within 1 week |
LOW |
Monitor | No immediate action |
Forecast Algorithms¶
The system uses multiple algorithms for forecasting:
- Moving Average - Simple average of recent usage
- Exponential Smoothing - Weighted average giving more importance to recent data
- Seasonal Decomposition - Accounts for seasonal patterns
- Safety Stock Calculation - Buffer for demand variability
Usage Examples¶
Check Individual Item Forecast¶
curl -X GET "http://localhost:1337/inventory/forecast/item/123" \
-H "Authorization: Bearer $JWT"
Get Critical Reorder Recommendations¶
curl -X GET "http://localhost:1337/inventory/forecast/reorder-recommendations" \
-H "Authorization: Bearer $JWT"
View Dashboard Analytics¶
curl -X GET "http://localhost:1337/inventory/forecast/dashboard" \
-H "Authorization: Bearer $JWT"
Integration with Maintenance¶
The inventory forecasting system integrates with:
- Work Orders - Tracks parts consumption from work orders
- Maintenance Schedules - Predicts needs based on upcoming maintenance
- Failure History - Identifies patterns in parts usage after failures
Best Practices¶
- Regular Review - Check reorder recommendations daily
- Adjust Reorder Levels - Update based on actual consumption patterns
- Monitor Slow-Moving Items - Consider reducing stock or disposing
- Supplier Lead Times - Keep supplier information current
- Seasonal Planning - Anticipate seasonal demand changes
Configuration¶
Configure forecasting parameters in the application:
inventory:
forecast:
lookback-days: 90 # Historical data period
confidence-threshold: 0.7 # Minimum confidence for recommendations
safety-stock-factor: 1.5 # Multiplier for safety stock
reorder-notification-days: 7 # Days before stockout to alert