We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de1a7b4 commit 3a18a9dCopy full SHA for 3a18a9d
src/allocation/service_layer/messagebus.py
@@ -62,9 +62,12 @@ def handle_command(
62
raise
63
64
65
-HANDLERS = {
66
- events.BatchCreated: [handlers.add_batch],
67
- events.BatchQuantityChanged: [handlers.change_batch_quantity],
68
- events.AllocationRequired: [handlers.allocate],
+EVENT_HANDLERS = {
69
events.OutOfStock: [handlers.send_out_of_stock_notification],
70
} # type: Dict[Type[events.Event], List[Callable]]
+
+COMMAND_HANDLERS = {
+ commands.Allocate: handlers.allocate,
71
+ commands.CreateBatch: handlers.add_batch,
72
+ commands.ChangeBatchQuantity: handlers.change_batch_quantity,
73
+} # type: Dict[Type[commands.Command], Callable]
0 commit comments