Skip to content

Commit eb37763

Browse files
committed
another bit of domain terminology
1 parent 792d6e5 commit eb37763

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎domain_model.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ def supplement_with(self, allocation):
1212
continue
1313
self[sku] = quantity
1414

15+
def fully_allocates(self, order):
16+
return self.skus == order.skus
17+
1518

1619
@dataclass
1720
class Order:
@@ -24,8 +27,7 @@ def skus(self):
2427

2528
@property
2629
def fully_allocated(self):
27-
return self.allocation.skus == self.skus
28-
30+
return self.allocation.fully_allocates(self)
2931

3032
def allocate(self, stock, shipments):
3133
self.allocation = Allocation()
@@ -35,7 +37,7 @@ def allocate(self, stock, shipments):
3537
for sku, quantity in self.lines.items()
3638
if source.can_allocate(sku, quantity)
3739
})
38-
if source_allocation.skus == self.skus:
40+
if source_allocation.fully_allocates(self):
3941
self.allocation = source_allocation
4042
return
4143
self.allocation.supplement_with(source_allocation)

0 commit comments

Comments
 (0)