1 parent 2554a1a commit 0197603Copy full SHA for 0197603
1 file changed
domain_model.py
@@ -1,5 +1,3 @@
1
-from dataclasses import dataclass
2
-
3
class Allocation(dict):
4
5
@property
@@ -10,7 +8,7 @@ def skus(self):
10
8
def for_(order, source):
11
9
return Allocation({
12
sku: source
13
- for sku, quantity in order.lines.items()
+ for sku, quantity in order.items()
14
if source.can_allocate(sku, quantity)
15
})
16
@@ -27,14 +25,11 @@ def fully_allocates(self, order):
27
25
28
26
29
30
-@dataclass
31
-class Order:
32
- lines: dict
33
- allocation: Allocation = None
+class Order(dict):
34
35
36
def skus(self):
37
- return self.lines.keys()
+ return self.keys()
38
39
40
def fully_allocated(self):
0 commit comments