This document provides a comprehensive catalog of all aggregates across the PakLog microservices ecosystem, including their relationships, invariants, and domain events.
graph TB
subgraph "Order Domain"
FO[FulfillmentOrder]
OL[OrderLine]
AR[AllocationResult]
end
subgraph "Inventory Domain"
II[InventoryItem]
IM[InventoryMovement]
IA[InventoryAdjustment]
LP[LicensePlate]
end
subgraph "Warehouse Execution"
W[Wave]
WT[WorkTask]
PL[PickList]
PS[PackingStation]
PKG[Package]
end
subgraph "Robotics Domain"
R[Robot]
RM[RobotMission]
FC[FleetCoordination]
end
subgraph "Returns Domain"
RET[Return]
RI[ReturnInspection]
DD[DispositionDecision]
end
subgraph "Analytics Domain"
F[Forecast]
PM[PredictionModel]
AJ[AnalyticsJob]
end
%% Relationships
FO --> OL
FO --> AR
AR --> II
W --> WT
WT --> PL
PL --> PKG
R --> RM
RET --> RI
RI --> DD
F --> PM
classDef aggregate fill:#e3f2fd,stroke:#1976d2,stroke-width:3px
class FO,II,W,WT,R,RET,F aggregate
Purpose: Manages the complete lifecycle of customer orders
Attributes:
orderId: String (unique identifier)customerId: StringorderStatus: Enum (PENDING, ALLOCATED, RELEASED, PICKING, PACKING, SHIPPED, DELIVERED, CANCELLED)orderLines: Listpriority: Enum (LOW, NORMAL, HIGH, URGENT)requestedDeliveryDate: LocalDateTimeshippingAddress: AddressallocationResults: ListInvariants:
Domain Events:
State Transitions:
1
2
3
PENDING -> ALLOCATED -> RELEASED -> PICKING -> PACKING -> SHIPPED -> DELIVERED
| |
+-----------------------> CANCELLED <---------------------+
Purpose: Tracks inventory levels and locations
Attributes:
sku: String (unique identifier)quantity: Integerlocation: Stringstatus: Enum (AVAILABLE, ALLOCATED, DAMAGED, QUARANTINE)licensePlate: StringlotNumber: StringexpirationDate: LocalDateInvariants:
Domain Events:
Purpose: Represents optimal packing arrangement for items
Attributes:
solutionId: StringorderId: Stringpackages: ListtotalWeight: BigDecimaltotalVolume: BigDecimalutilizationRate: BigDecimalalgorithm: String (FIRST_FIT, BEST_FIT, 3D_BIN_PACKING)Invariants:
Domain Events:
Purpose: Groups orders for efficient batch processing
Attributes:
waveId: StringwaveNumber: Stringstatus: Enum (PLANNED, RELEASED, IN_PROGRESS, COMPLETED, CANCELLED)strategy: Enum (ZONE_BASED, CARRIER_CUTOFF, PRIORITY_BASED, MULTI_STRATEGY)orders: ListplannedStartTime: LocalDateTimeactualStartTime: LocalDateTimecompletionTime: LocalDateTimeassignedResources: ListInvariants:
Domain Events:
Purpose: Unified task model for all warehouse work
Attributes:
taskId: StringtaskType: Enum (PICK, PUT_AWAY, REPLENISHMENT, CYCLE_COUNT, MOVE, PACK, SHIP)status: Enum (PENDING, ASSIGNED, IN_PROGRESS, COMPLETED, FAILED, CANCELLED)priority: Integer (0-100)assignedTo: String (workerId or robotId)context: TaskContext (polymorphic)startTime: LocalDateTimecompletionTime: LocalDateTimeattempts: IntegerInvariants:
Domain Events:
Purpose: Manages picking operations with path optimization
Attributes:
pickListId: StringpickerId: Stringstatus: Enum (CREATED, IN_PROGRESS, COMPLETED, CANCELLED)items: Listroute: Listdistance: BigDecimalestimatedTime: DurationactualTime: DurationInvariants:
Domain Events:
Purpose: Represents packed shipment ready for carrier
Attributes:
packageId: StringorderId: StringcartonType: Stringitems: Listweight: BigDecimaldimensions: DimensionstrackingNumber: Stringcarrier: StringshippingLabel: byte[]Invariants:
Domain Events:
Purpose: Individual robot management and coordination
Attributes:
robotId: Stringtype: Enum (AMR, AGV, PICKING_ROBOT, SORTING_ROBOT)status: Enum (IDLE, BUSY, CHARGING, MAINTENANCE, ERROR)position: CoordinatesbatteryLevel: Integer (0-100)currentMission: RobotMissioncapabilities: ListInvariants:
Domain Events:
Purpose: Represents assigned robot task
Attributes:
missionId: StringtaskId: Stringpath: Liststatus: Enum (PLANNED, EXECUTING, COMPLETED, ABORTED)obstacles: ListPurpose: Manages return merchandise authorization
Attributes:
returnId: StringrmaNumber: StringorderId: Stringstatus: Enum (REQUESTED, APPROVED, DENIED, RECEIVED, INSPECTED, REFUNDED, CLOSED)items: Listreason: StringfraudScore: BigDecimalinspectionResult: InspectionResultdisposition: Enum (RESELL, REFURBISH, LIQUIDATE, DONATE, SCRAP)Invariants:
Domain Events:
Purpose: Orchestrates complex multi-service workflows
Attributes:
workflowId: StringworkflowType: Stringstatus: Enum (CREATED, RUNNING, PAUSED, COMPLETED, FAILED, COMPENSATING)steps: ListsagaState: SagaStatecorrelationId: StringcompensationStack: StackInvariants:
Domain Events:
Purpose: ML-based predictions for various metrics
Attributes:
forecastId: Stringtype: Enum (DEMAND, INVENTORY, LABOR, EQUIPMENT_FAILURE)horizon: Enum (DAILY, WEEKLY, MONTHLY, QUARTERLY)predictions: Listconfidence: BigDecimalmodelId: Stringaccuracy: AccuracyMetrics (MAPE, RMSE, MAE)Invariants:
Domain Events:
Purpose: Manages dock doors and yard positions
Attributes:
locationId: Stringtype: Enum (DOCK, STAGING, PARKING, MAINTENANCE)status: Enum (AVAILABLE, OCCUPIED, RESERVED, MAINTENANCE)currentTrailer: Stringappointment: DockAppointmentcapacity: IntegerInvariants:
Domain Events:
Purpose: Coordinates flow-through operations
Attributes:
operationId: Stringtype: Enum (DIRECT, CONSOLIDATED, DECONSOLIDATED)status: Enum (PLANNED, IN_PROGRESS, COMPLETED, CANCELLED)inboundTrailers: ListoutboundTrailers: ListtransferOrders: ListdwellTime: DurationInvariants:
Domain Events:
Purpose: Optimized delivery routes using VRP
Attributes:
routeId: StringvehicleId: StringdriverId: Stringstops: Liststatus: Enum (PLANNED, IN_PROGRESS, COMPLETED)totalDistance: BigDecimalestimatedDuration: DurationactualDuration: DurationInvariants:
Domain Events:
Purpose: Quality control and compliance tracking
Attributes:
inspectionId: Stringtype: Enum (RECEIVING, PICKING, PACKING, SHIPPING)samplingStrategy: Enum (FULL, AQL_2_5, AQL_4_0, RANDOM)result: Enum (PASSED, FAILED, CONDITIONAL)defects: Listphotos: Listinspector: StringInvariants:
Domain Events: