Skip to content

Commit bff67bf

Browse files
committed
apply was a crap method name
1 parent 162e120 commit bff67bf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎domain_model.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ def for_order(order, stock, shipments):
2121
allocation.supplement_with(source_allocation)
2222
return allocation
2323

24+
2425
def supplement_with(self, allocation):
2526
for sku, quantity in allocation.items():
2627
if sku in self:
2728
continue
2829
self[sku] = quantity
2930

30-
def apply(self):
31+
32+
def decrement_source_quantities(self):
3133
for sku, source in self.items():
3234
source[sku] -= self.order[sku]
3335

@@ -36,7 +38,7 @@ class Order(dict):
3638

3739
def allocate(self, stock, shipments):
3840
self.allocation = Allocation.for_order(self, stock, shipments)
39-
self.allocation.apply()
41+
self.allocation.decrement_source_quantities()
4042

4143

4244
class Stock(dict):

0 commit comments

Comments
 (0)