Skip to content

Commit 3a18a9d

Browse files
committed
handlers dicts split in two [two_hander_dicts]
1 parent de1a7b4 commit 3a18a9d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/allocation/service_layer/messagebus.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,12 @@ def handle_command(
6262
raise
6363

6464

65-
HANDLERS = {
66-
events.BatchCreated: [handlers.add_batch],
67-
events.BatchQuantityChanged: [handlers.change_batch_quantity],
68-
events.AllocationRequired: [handlers.allocate],
65+
EVENT_HANDLERS = {
6966
events.OutOfStock: [handlers.send_out_of_stock_notification],
7067
} # type: Dict[Type[events.Event], List[Callable]]
68+
69+
COMMAND_HANDLERS = {
70+
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

Comments
 (0)