Skip to content

Commit 3be2bbc

Browse files
committed
email in model [email_in_model]
1 parent cb64973 commit 3be2bbc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/allocation/domain/model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from dataclasses import dataclass
33
from datetime import date
44
from typing import Optional, List, Set
5+
from allocation.adapters import email
56

67

78
class OutOfStock(Exception):
@@ -21,6 +22,7 @@ def allocate(self, line: OrderLine) -> str:
2122
self.version_number += 1
2223
return batch.reference
2324
except StopIteration:
25+
email.send_mail("stock@made.com", f"Out of stock for {line.sku}")
2426
raise OutOfStock(f"Out of stock for sku {line.sku}")
2527

2628

0 commit comments

Comments
 (0)