1
0
Fork 0
mirror of https://github.com/s-frick/effigenix.git synced 2026-03-28 21:19:58 +01:00
effigenix/backend/docs/mvp/ddd/08-procurement-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

83 lines
2.4 KiB
Markdown

# Procurement BC - Detailliertes Domain Model
**Bounded Context:** Procurement
**Domain Type:** CORE
**Verantwortung:** Bedarfsplanung, Bestellwesen, Wareneingangskontrolle, Lieferanten-QM
## Aggregates
### PurchaseOrder (Aggregate Root)
```
PurchaseOrder
├── PurchaseOrderId
├── SupplierId
├── OrderDate
├── RequestedDeliveryDate
├── Status (DRAFT | ORDERED | CONFIRMED | PARTIALLY_RECEIVED | FULLY_RECEIVED | CANCELLED)
├── OrderedBy (UserId)
├── BranchId
├── Items[] (Entity)
│ ├── ArticleId
│ ├── OrderedQuantity
│ ├── ReceivedQuantity - Updated on goods receipt
│ └── UnitPrice
├── TotalAmount - Calculated
└── PaymentTerms
Invariants:
- Status cannot skip states
- TotalAmount = SUM(Items.Quantity * Items.UnitPrice)
- ReceivedQuantity <= OrderedQuantity per item
- FULLY_RECEIVED when all items received
```
### GoodsReceipt (Aggregate Root)
```
GoodsReceipt
├── GoodsReceiptId
├── PurchaseOrderId
├── SupplierId
├── SupplierDeliveryNote
├── ReceivedAt
├── ReceivedBy (UserId)
├── Items[] (Entity)
│ ├── ArticleId
│ ├── OrderedQuantity
│ ├── ReceivedQuantity
│ ├── SupplierBatchNumber - CRITICAL for traceability!
│ ├── ExpiryDate (MHD)
│ └── QualityStatus (ACCEPTED | REJECTED | PENDING_INSPECTION)
├── QualityInspectionId - Reference to Quality BC
├── Documents[] (Entity) - Photos/PDFs
└── Status (PENDING_INSPECTION | ACCEPTED | REJECTED)
Invariants:
- Cannot accept without completed quality inspection
- All items must have SupplierBatchNumber
- Veterinary certificate required for meat
- Triggers StockMovement when accepted
```
### DemandPlan (Aggregate Root)
```
DemandPlan
├── DemandPlanId
├── PlanningPeriod (Week or Month)
├── BranchId
├── GeneratedAt
├── Items[] (Entity)
│ ├── ArticleId
│ ├── CurrentStock - Snapshot from Inventory
│ ├── PlannedConsumption - From ProductionOrders
│ ├── AverageConsumption - Historical
│ ├── SuggestedOrderQuantity - Calculated
│ └── MinimumOrderQuantity - Supplier constraint
└── Status (DRAFT | APPROVED | ORDERED)
Invariants:
- SuggestedOrderQuantity = PlannedConsumption - CurrentStock + SafetyStock
- If < MinimumOrderQuantity, use MinimumOrderQuantity
```