mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 19:00:23 +01:00
- Move Java backend to backend/ directory - Create frontend/ directory for TypeScript TUI and future WebUI - Update .gitignore for Node.js and worktrees - Update README.md with new repository structure - Copy documentation to backend/
42 lines
1.5 KiB
Markdown
42 lines
1.5 KiB
Markdown
# Labeling BC - Detailliertes Domain Model
|
|
|
|
**Bounded Context:** Labeling
|
|
**Domain Type:** CORE
|
|
**Verantwortung:** Automatische Berechnung von Nährwerten/Allergenen, Etikettengenerierung
|
|
|
|
## Aggregates
|
|
|
|
### ProductLabel (Aggregate Root)
|
|
|
|
```
|
|
ProductLabel
|
|
├── ProductLabelId
|
|
├── ArticleId - Reference to Master Data
|
|
├── RecipeId - Reference to Production BC (for auto-calculation)
|
|
├── ProductName
|
|
├── Manufacturer
|
|
├── Ingredients[] (Entity) - From Recipe, sorted descending by weight
|
|
├── Allergens[] (VO) - Auto-calculated from ingredients
|
|
├── TraceDeclarations[] (VO) - "May contain traces of..."
|
|
├── NutritionFacts (Entity) - Auto-calculated from recipe
|
|
│ ├── EnergyKJ, EnergyKcal, Fat, SaturatedFat, Carbs, Sugars, Protein, Salt
|
|
│ └── CalculationBase (PER_100G | PER_PORTION)
|
|
├── QualityLabels[] (VO) - Bio, Regional, Animal Welfare
|
|
├── OriginLabeling (VO)
|
|
└── LabelVersion
|
|
|
|
Invariants:
|
|
- All EU allergens must be declared
|
|
- Ingredients sorted by quantity (highest first) - EU regulation
|
|
- Nutrition facts must sum correctly from recipe
|
|
- If BIO label, all ingredients must be BIO-certified
|
|
- Allergens automatically inherited from ingredients (no manual override!)
|
|
```
|
|
|
|
## Use Cases
|
|
|
|
```java
|
|
GenerateLabelFromRecipe - Calculates nutrition & allergens from recipe
|
|
PrintLabelAtScale - Sends label to scale for printing with current weight
|
|
UpdateAllergenMatrix - Regenerates allergen matrix for all products
|
|
```
|