Update readmes and imporve UI

This commit is contained in:
Urtzi Alfaro
2025-12-19 09:28:36 +01:00
parent a6ae730ef0
commit 71ee2976a2
10 changed files with 1035 additions and 155 deletions

View File

@@ -224,8 +224,10 @@ CREATE TABLE production_capacity (
### Published Events (RabbitMQ)
**Exchange**: `production`
**Routing Keys**: `production.batch.completed`, `production.quality.issue`, `production.equipment.maintenance`
**Exchange**: `events.exchange`
**Domain**: `production`
### Business Events
**Batch Completed Event**
```json
@@ -247,22 +249,177 @@ CREATE TABLE production_capacity (
}
```
**Quality Issue Alert**
### Alert Events
All alerts are published to the alert processor for enrichment and notification.
#### 1. Production Delay Alert
**Event Type**: `production.production_delay`
**Severity**: urgent (>120 min), high (>60 min), medium (otherwise)
**Trigger**: Batch delayed past scheduled start time
```json
{
"event_type": "quality_issue",
"tenant_id": "uuid",
"batch_id": "uuid",
"product_name": "Croissant",
"quality_score": 65,
"passing_score": 80,
"issues_found": "Color too dark, texture inconsistent",
"severity": "high",
"corrective_actions": "Adjust oven temperature, check proofing time",
"timestamp": "2025-11-06T10:30:00Z"
"event_type": "production.production_delay",
"severity": "urgent",
"metadata": {
"batch_id": "uuid",
"product_name": "Baguette",
"batch_number": "BATCH-001",
"delay_minutes": 135,
"affected_orders": 5,
"customer_names": ["Café A", "Café B"]
}
}
```
#### 2. Equipment Failure Alert
**Event Type**: `production.equipment_failure`
**Severity**: urgent
**Trigger**: Equipment malfunction detected
```json
{
"event_type": "production.equipment_failure",
"severity": "urgent",
"metadata": {
"equipment_id": "uuid",
"equipment_name": "Oven #1",
"equipment_type": "oven",
"affected_batches": 3
}
}
```
#### 3. Capacity Overload Alert
**Event Type**: `production.capacity_overload`
**Severity**: urgent (>120%), high (>100%), medium (otherwise)
**Trigger**: Production capacity exceeded
```json
{
"event_type": "production.capacity_overload",
"severity": "urgent",
"metadata": {
"current_load_percent": 125,
"planned_batches": 15,
"available_capacity": 12,
"affected_date": "2025-12-20"
}
}
```
#### 4. Quality Issue Alert
**Event Type**: `production.quality_issue`
**Severity**: high
**Trigger**: Batch quality below threshold
```json
{
"event_type": "production.quality_issue",
"severity": "high",
"metadata": {
"batch_id": "uuid",
"product_name": "Croissant",
"issue_type": "quality_below_threshold",
"issue_description": "Color too dark, texture inconsistent",
"affected_quantity": 50
}
}
```
#### 5. Production Start Alert
**Event Type**: `production.start_production`
**Severity**: medium
**Trigger**: Production batch created
```json
{
"event_type": "production.start_production",
"severity": "medium",
"metadata": {
"batch_id": "uuid",
"product_name": "Baguette",
"batch_number": "BATCH-001",
"planned_start_time": "2025-12-20T06:00:00Z",
"reasoning_data": {...}
}
}
```
#### 6. Batch Start Delayed Alert
**Event Type**: `production.batch_start_delayed`
**Severity**: high
**Trigger**: Batch start delayed for specific reason
```json
{
"event_type": "production.batch_start_delayed",
"severity": "high",
"metadata": {
"batch_id": "uuid",
"product_name": "Pain au Chocolat",
"batch_number": "BATCH-002",
"scheduled_start": "2025-12-20T07:00:00Z",
"delay_reason": "Missing ingredients"
}
}
```
#### 7. Missing Ingredients Alert
**Event Type**: `production.missing_ingredients`
**Severity**: urgent
**Trigger**: Required ingredients unavailable
```json
{
"event_type": "production.missing_ingredients",
"severity": "urgent",
"metadata": {
"batch_id": "uuid",
"product_name": "Baguette",
"batch_number": "BATCH-001",
"missing_ingredients": [
{"name": "Flour", "required": 50, "available": 10},
{"name": "Yeast", "required": 2, "available": 0}
],
"missing_count": 2
}
}
```
#### 8. Equipment Maintenance Due Alert
**Event Type**: `production.equipment_maintenance_due`
**Severity**: high (>30 days overdue), medium (otherwise)
**Trigger**: Equipment maintenance overdue
```json
{
"event_type": "production.equipment_maintenance_due",
"severity": "high",
"metadata": {
"equipment_id": "uuid",
"equipment_name": "Mixer #2",
"last_maintenance_date": "2024-10-15",
"days_overdue": 45
}
}
```
### AI Recommendations
#### Efficiency Recommendation
**Event Type**: `production.efficiency_recommendation`
**Severity**: medium
#### Energy Optimization
**Event Type**: `production.energy_optimization`
**Severity**: medium
#### Batch Sequence Optimization
**Event Type**: `production.batch_sequence_optimization`
**Severity**: medium
### Consumed Events
- **From Forecasting**: Daily forecasts for production planning
- **From Orchestrator**: Scheduled production triggers