6c3f1f83e6f61d8a4e76b12c6e1835ac089451c9
**Issues:** 1. ❌ 422 Error: unit_of_measure "L" (uppercase) invalid Backend requires: 'kg', 'g', 'l', 'ml', 'units', 'pcs', 'pkg', 'bags', 'boxes' 2. ❌ 422 Error: max_stock_level must be > 0 Input: 0 when stock_quantity = 0 **Root Causes:** 1. AI suggestions return unit_of_measure with mixed case (e.g., "L" vs "l") 2. When stock_quantity = 0, max_stock_level = 0 * 2 = 0 (fails validation) **Solutions:** **1. Unit Normalization (Line 459)** ```typescript // Before: unit_of_measure: item.unit_of_measure // Could be "L", "Ml", etc. // After: const normalizedUnit = item.unit_of_measure.toLowerCase(); unit_of_measure: normalizedUnit // Always "l", "ml", etc. ``` **2. Max Stock Level Validation (Line 462)** ```typescript // Before: max_stock_level: item.stock_quantity * 2 // Could be 0 // After: const maxStockLevel = Math.max(1, item.stock_quantity * 2); max_stock_level: maxStockLevel // Always >= 1 ``` **Changes:** - frontend/src/components/domain/onboarding/steps/UploadSalesDataStep.tsx:458-470 **Examples:** ```typescript // Stock = 50, Unit = "L" normalizedUnit = "l" maxStockLevel = max(1, 50 * 2) = 100 ✅ // Stock = 0, Unit = "kg" normalizedUnit = "kg" maxStockLevel = max(1, 0 * 2) = 1 ✅ // Stock = 10, Unit = "ML" normalizedUnit = "ml" maxStockLevel = max(1, 10 * 2) = 20 ✅ ``` **Impact:** ✅ All units normalized to lowercase before API call ✅ max_stock_level always >= 1 ✅ No more 422 validation errors ✅ Works with AI suggestions of any case **Build Status:** ✓ Successful in 21.70s
🍞 Bakery IA - Multi-Service Architecture
Welcome to Bakery IA, an advanced AI-powered platform for bakery management and optimization. This project implements a microservices architecture with multiple interconnected services to provide comprehensive bakery management solutions.
🚀 Quick Start
Prerequisites
- Docker Desktop with Kubernetes enabled
- Docker Compose
- Node.js (for frontend development)
Running the Application
-
Clone the repository:
git clone <repository-url> cd bakery-ia -
Set up environment variables:
cp .env.example .env # Edit .env with your specific configuration -
Run with Docker Compose:
docker-compose up --build -
Or run with Kubernetes (Docker Desktop):
# Enable Kubernetes in Docker Desktop # Run the setup script ./scripts/setup-kubernetes-dev.sh
🏗️ Architecture Overview
The project follows a microservices architecture with the following main components:
- Frontend: React-based dashboard for user interaction
- Gateway: API gateway handling authentication and routing
- Services: Multiple microservices handling different business domains
- Infrastructure: Redis, RabbitMQ, PostgreSQL databases
🐳 Kubernetes Infrastructure
🛠️ Services
The project includes multiple services:
- Auth Service: Authentication and authorization
- Tenant Service: Multi-tenancy management
- Sales Service: Sales processing
- External Service: Integration with external systems
- Training Service: AI model training
- Forecasting Service: Demand forecasting
- Notification Service: Notifications and alerts
- Inventory Service: Inventory management
- Recipes Service: Recipe management
- Suppliers Service: Supplier management
- POS Service: Point of sale
- Orders Service: Order management
- Production Service: Production planning
- Alert Processor: Background alert processing
📊 Monitoring
The system includes comprehensive monitoring with:
- Prometheus for metrics collection
- Grafana for visualization
- ELK stack for logging (planned)
🚀 Production Deployment
For production deployment on clouding.io with Kubernetes:
- Set up your clouding.io Kubernetes cluster
- Update image references to your container registry
- Configure production-specific values
- Deploy using the production kustomization:
kubectl apply -k infrastructure/kubernetes/environments/production/
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
📄 License
This project is licensed under the MIT License.
Description
Languages
Python
56.3%
TypeScript
39.6%
Shell
2.9%
CSS
0.4%
Starlark
0.3%
Other
0.3%