Skip to content

Commit 83e3a7a

Browse files
committed
model method for change batch qty now raise commands hmmm
1 parent a347b24 commit 83e3a7a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/allocation/domain/model.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from dataclasses import dataclass
33
from datetime import date
44
from typing import Optional, List, Set
5-
from . import events
5+
from . import commands, events
66

77

88
class Product:
@@ -27,9 +27,7 @@ def change_batch_quantity(self, ref: str, qty: int):
2727
batch._purchased_quantity = qty
2828
while batch.available_quantity < 0:
2929
line = batch.deallocate_one()
30-
self.events.append(
31-
events.AllocationRequired(line.orderid, line.sku, line.qty)
32-
)
30+
self.events.append(commands.Allocate(line.orderid, line.sku, line.qty))
3331

3432

3533
@dataclass(unsafe_hash=True)

0 commit comments

Comments
 (0)