We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d1dda70 commit 8a6ec0eCopy full SHA for 8a6ec0e
model.py
@@ -1,7 +1,13 @@
1
from __future__ import annotations
2
from dataclasses import dataclass
3
from datetime import date
4
-from typing import Optional, Set
+from typing import Optional, List, Set
5
+
6
7
+def allocate(line: OrderLine, batches: List[Batch]) -> str:
8
+ batch = next(b for b in sorted(batches) if b.can_allocate(line))
9
+ batch.allocate(line)
10
+ return batch.reference
11
12
13
@dataclass(frozen=True)
0 commit comments