We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd0e75e commit 8ad3236Copy full SHA for 8ad3236
model.py
@@ -21,5 +21,8 @@ def __init__(self, ref: str, sku: str, qty: int, eta: Optional[date]):
21
def allocate(self, line: OrderLine):
22
self.available_quantity -= line.qty
23
24
+ def deallocate(self, line: OrderLine):
25
+ self.available_quantity += line.qty
26
+
27
def can_allocate(self, line: OrderLine) -> bool:
28
return self.sku == line.sku and self.available_quantity >= line.qty
0 commit comments