Skip to content

Commit 62aff87

Browse files
committed
email in model [email_in_model]
1 parent 5d5f194 commit 62aff87

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎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)