mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 12:19:35 +01:00
init
This commit is contained in:
commit
4e448afa57
19 changed files with 4391 additions and 0 deletions
42
docs/mvp/ddd/06-labeling-bc.md
Normal file
42
docs/mvp/ddd/06-labeling-bc.md
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# 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
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue