1
0
Fork 0
mirror of https://github.com/s-frick/effigenix.git synced 2026-03-28 10:09:35 +01:00
effigenix/backend/docs/mvp/ddd/06-labeling-bc.md
Sebastian Frick c2c48a03e8 refactor: restructure repository with separate backend and frontend directories
- 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/
2026-02-17 22:08:51 +01:00

1.5 KiB

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

GenerateLabelFromRecipe - Calculates nutrition & allergens from recipe
PrintLabelAtScale - Sends label to scale for printing with current weight
UpdateAllergenMatrix - Regenerates allergen matrix for all products