mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 13:49:36 +01:00
init
This commit is contained in:
commit
4e448afa57
19 changed files with 4391 additions and 0 deletions
203
docs/mvp/ddd/02-bounded-contexts.md
Normal file
203
docs/mvp/ddd/02-bounded-contexts.md
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
# Bounded Contexts (Kontextgrenzen) & Context Map
|
||||
|
||||
**Datum:** 2026-02-17
|
||||
|
||||
## Context Map (Kontextkarte)
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph CORE["⚡ KERN-DOMÄNE"]
|
||||
Produktion["<b>Produktion</b><br/>Rezept, Charge,<br/>Ausbeute, Produktionsauftrag"]
|
||||
Qualitaet["<b>Qualität</b><br/>(HACCP/QM)<br/>Temperaturprotokolle,<br/>Reinigung, Schulung,<br/>Wartung"]
|
||||
Deklaration["<b>Deklaration</b><br/>Allergene, Nährwerte,<br/>Etiketten, Qualitätssiegel"]
|
||||
Bestand["<b>Bestandsführung</b><br/>Lagerbestände, Chargen-Tracking,<br/>Rückverfolgbarkeit, MHD, FEFO,<br/>Lagerorte"]
|
||||
Beschaffung["<b>Beschaffung</b><br/>Bedarfsplanung,<br/>Bestellungen,<br/>Wareneingang,<br/>Qualitätsprüfung"]
|
||||
Filialen["<b>Filialen</b><br/>Standorte, Interfilial-Transfer,<br/>Zentrale Produktion,<br/>Verteilung"]
|
||||
|
||||
Produktion -->|Rezeptdaten| Deklaration
|
||||
Produktion -->|Verbraucht/Produziert| Bestand
|
||||
Qualitaet -->|Prüft| Bestand
|
||||
Bestand -->|Beliefert| Beschaffung
|
||||
Bestand -->|Transfers| Filialen
|
||||
end
|
||||
|
||||
subgraph SUPPORTING["🔧 UNTERSTÜTZENDE DOMÄNE"]
|
||||
Stammdaten["<b>Stammdaten</b><br/>Artikel, Kunden,<br/>Lieferanten"]
|
||||
Verkauf["<b>Verkauf</b><br/>Aufträge, Rechnungen,<br/>Lieferscheine"]
|
||||
Waagen["<b>Waagen-Integration</b><br/>Synchronisation,<br/>Bondaten, Etikettendruck"]
|
||||
|
||||
Stammdaten -->|Stellt Artikel bereit| Verkauf
|
||||
Waagen -->|Bondaten| Verkauf
|
||||
end
|
||||
|
||||
subgraph GENERIC["📊 GENERISCHE SUBDOMÄNEN"]
|
||||
Reporting["<b>Reporting</b><br/>Analysen, Statistiken,<br/>Dashboards"]
|
||||
Dokumentenarchiv["<b>Dokumentenarchiv</b><br/>(GoBD)<br/>Audit Trail,<br/>Revisionssicher"]
|
||||
Benutzerverwaltung["<b>Benutzerverwaltung</b><br/>Rollen, Berechtigungen"]
|
||||
end
|
||||
|
||||
Stammdaten -.->|Stellt Artikel bereit| CORE
|
||||
Filialen -.->|Koordiniert Mehrfilialen| SUPPORTING
|
||||
CORE -.->|Konsumiert Daten| GENERIC
|
||||
SUPPORTING -.->|Konsumiert Daten| GENERIC
|
||||
|
||||
style CORE fill:#e1f5ff,stroke:#0066cc,stroke-width:3px
|
||||
style SUPPORTING fill:#fff4e6,stroke:#ff9800,stroke-width:2px
|
||||
style GENERIC fill:#f5f5f5,stroke:#666,stroke-width:1px
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Bounded Context Details (Kontextdetails)
|
||||
|
||||
### Kern-Domäne (7 BCs)
|
||||
|
||||
#### 1. Produktions-Kontext
|
||||
- **Verantwortung:** Rezepturverwaltung, Produktionsplanung, Chargen-Erzeugung
|
||||
- **Aggregate:** Rezept, Charge, Produktionsauftrag
|
||||
- **Upstream:** Stammdaten (Artikelkatalog)
|
||||
- **Downstream:** Deklaration (Rezeptdaten), Bestandsführung (Bestandsbewegungen)
|
||||
|
||||
#### 2. Qualitäts-Kontext (HACCP/QM)
|
||||
- **Verantwortung:** HACCP-Compliance, Qualitätsmanagement, Audit-Vorbereitung
|
||||
- **Aggregate:** Temperaturprotokoll, Reinigungsnachweis, Wareneingangsprüfung, Schulungsnachweis, Wartungsprotokoll
|
||||
- **Upstream:** Beschaffung (Wareneingangsprüfung), Stammdaten (Lieferanten, Mitarbeiter)
|
||||
- **Downstream:** Reporting (HACCP-Berichte), Dokumentenarchiv (Audit-Nachweise)
|
||||
|
||||
#### 3. Deklarations-Kontext
|
||||
- **Verantwortung:** Automatische Berechnung von Nährwerten und Allergenen, Etikettengenerierung
|
||||
- **Aggregate:** Produktetikett, Allergene-Matrix
|
||||
- **Upstream:** Produktion (Rezeptdaten für Berechnungen)
|
||||
- **Downstream:** Waagen-Integration (Etikettendruck)
|
||||
|
||||
#### 4. Bestandsführungs-Kontext
|
||||
- **Verantwortung:** Chargen-basierte Bestandsführung, Rückverfolgbarkeit, MHD-Tracking
|
||||
- **Aggregate:** Bestand, Bestandsbewegung
|
||||
- **Upstream:** Produktion (Produktionsausstoß), Beschaffung (Wareneingang), Verkauf (verkaufte Artikel)
|
||||
- **Downstream:** Beschaffung (Lagerbestände für Bedarfsplanung), Reporting (Bestandsberichte)
|
||||
|
||||
#### 5. Beschaffungs-Kontext
|
||||
- **Verantwortung:** Bedarfsplanung, Bestellwesen, Wareneingangskontrolle, Lieferanten-QM
|
||||
- **Aggregate:** Bestellung, Wareneingang, Bedarfsplan
|
||||
- **Upstream:** Bestandsführung (aktueller Bestand), Produktion (Produktionsaufträge), Stammdaten (Lieferanten, Artikel)
|
||||
- **Downstream:** Qualität (Wareneingangsprüfung), Bestandsführung (Bestandszugang)
|
||||
|
||||
#### 6. Filialen-Kontext
|
||||
- **Verantwortung:** Mehrfilialen-Management, Interfilial-Transfers, zentrale Produktion
|
||||
- **Aggregate:** Filiale, Interfilial-Transfer, Verteilungsplan
|
||||
- **Upstream:** Alle Kern-BCs (koordiniert Mehrfilialen-Operationen)
|
||||
- **Downstream:** Bestandsführung (Interfilial-Bestandsbewegungen), Produktion (filialspezifische Produktion)
|
||||
|
||||
---
|
||||
|
||||
### Supporting Domain (3 BCs)
|
||||
|
||||
#### 8. Master Data BC
|
||||
- **Verantwortung:** Stammdatenverwaltung für Artikel, Lieferanten, Kunden
|
||||
- **Aggregates:** Article, Supplier, Customer
|
||||
- **Downstream:** Alle BCs nutzen Master Data als Referenz
|
||||
|
||||
#### 9. Sales BC
|
||||
- **Verantwortung:** Auftragserfassung, Rechnungsstellung, Lieferscheine
|
||||
- **Aggregates:** Order, Invoice, DeliveryNote
|
||||
- **Upstream:** Master Data (customers, articles), Inventory (stock availability)
|
||||
- **Downstream:** Inventory (sales deduct stock), Reporting (sales statistics)
|
||||
|
||||
#### 10. Scale Integration BC
|
||||
- **Verantwortung:** Waagen/Kassen-Anbindung, Bondaten-Import, Etikettendruck
|
||||
- **Aggregates:** ScaleSyncJob, BondDataImport
|
||||
- **Upstream:** Master Data (article sync), Labeling (label templates)
|
||||
- **Downstream:** Inventory (bond data → stock movements), Sales (sales data)
|
||||
|
||||
---
|
||||
|
||||
### Generic Subdomains (3 BCs)
|
||||
|
||||
#### 11. Reporting BC
|
||||
- **Verantwortung:** Auswertungen, Statistiken, Dashboards
|
||||
- **Upstream:** Alle BCs liefern Daten für Reports
|
||||
- **Keine Aggregates** (Read-only, CQRS Query Side)
|
||||
|
||||
#### 12. Document Archive BC (GoBD)
|
||||
- **Verantwortung:** Revisionssichere Dokumentenarchivierung
|
||||
- **Aggregates:** Document, AuditLog
|
||||
- **Upstream:** Quality (HACCP documents), Sales (invoices), Procurement (delivery notes)
|
||||
|
||||
#### 13. User Management BC
|
||||
- **Verantwortung:** Benutzer, Rollen, Permissions
|
||||
- **Aggregates:** User, Role
|
||||
- **Downstream:** Alle BCs nutzen User Management für Autorisierung
|
||||
|
||||
---
|
||||
|
||||
## Context Relationships
|
||||
|
||||
### Partnership
|
||||
- **Production ↔ Inventory:** Enge Zusammenarbeit bei Chargen-Tracking
|
||||
- **Procurement ↔ Quality:** Wareneingangskontrolle gemeinsam
|
||||
|
||||
### Customer-Supplier
|
||||
- **Production → Labeling:** Production liefert Rezeptdaten
|
||||
- **Master Data → alle BCs:** Master Data liefert Stammdaten
|
||||
|
||||
### Conformist
|
||||
- **Labeling → Production:** Labeling übernimmt Recipe-Struktur 1:1
|
||||
- **Reporting → alle BCs:** Reporting passt sich an alle Datenmodelle an
|
||||
|
||||
### Anti-Corruption Layer
|
||||
- **Scale Integration → Inventory:** ACL übersetzt Bondaten in StockMovements
|
||||
- **FIBU Integration → Sales:** ACL übersetzt zu DATEV-Format
|
||||
|
||||
---
|
||||
|
||||
## Integration Patterns
|
||||
|
||||
### Event-Driven
|
||||
- **Production.BatchCompleted** → Inventory (stock in)
|
||||
- **Procurement.GoodsReceived** → Inventory (stock in)
|
||||
- **Sales.ItemSold** → Inventory (stock out)
|
||||
|
||||
### Request-Response
|
||||
- **Labeling → Production:** GET /recipes/{id} für Nährwertberechnung
|
||||
- **Procurement → Inventory:** GET /stock/{articleId} für Bedarfsplanung
|
||||
|
||||
### Shared Database (Anti-Pattern, vermeiden!)
|
||||
- ❌ Nicht verwenden - jeder BC hat eigene Datenbank
|
||||
|
||||
---
|
||||
|
||||
## Deployment Strategy
|
||||
|
||||
### Monolith First (MVP)
|
||||
Alle BCs in einer Anwendung:
|
||||
```
|
||||
effigenix-erp/
|
||||
├── domain/
|
||||
│ ├── production/
|
||||
│ ├── quality/
|
||||
│ ├── labeling/
|
||||
│ ├── inventory/
|
||||
│ ├── procurement/
|
||||
│ └── filiales/
|
||||
├── application/
|
||||
└── infrastructure/
|
||||
```
|
||||
|
||||
### Microservices Later (nach MVP)
|
||||
Extraktion von BCs in Services:
|
||||
```
|
||||
production-service
|
||||
quality-service
|
||||
inventory-service
|
||||
procurement-service
|
||||
filiales-service
|
||||
master-data-service
|
||||
sales-service
|
||||
scale-integration-service
|
||||
```
|
||||
|
||||
**Empfohlene Reihenfolge:**
|
||||
1. Scale Integration (eigener Prozess wegen Hardware-Anbindung)
|
||||
2. Reporting (Read-only, CQRS)
|
||||
3. Inventory (hohe Last)
|
||||
4. Production (geschäftskritisch, isolieren)
|
||||
Loading…
Add table
Add a link
Reference in a new issue