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