Skip to content

Commit a2e6e28

Browse files
committed
allocations now decoupled from order
1 parent 9aa0e63 commit a2e6e28

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

domain_model.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def allocate_to_shipments(order, shipments, allocations):
3535
if sku in allocations:
3636
continue
3737
for shipment in shipments:
38-
allocate_line(sku, quantity, shipment, order.allocations)
39-
if sku in order.allocations:
38+
allocate_line(sku, quantity, shipment, allocations)
39+
if sku in allocations:
4040
break
4141

4242

@@ -51,6 +51,6 @@ def allocate(order, stock, shipments):
5151
if skus(order) <= skus(shipment):
5252
return allocate_to(order, shipment)
5353

54-
order.allocations = allocate_to(order, stock)
55-
allocate_to_shipments(order, shipments, order.allocations)
56-
return order.allocations
54+
allocations = allocate_to(order, stock)
55+
allocate_to_shipments(order, shipments, allocations)
56+
return allocations

0 commit comments

Comments
 (0)