Domain Layer
Entity
Notes
Example
class SavingsAccount(BankAccount):
account_number: str
type: SavingAccountType
customer: Customer
status: LoanStatus
balance: Balance
def __init__(...):
... # constructor here
def deposit_money(self, amount: float, currency: Currency):
if self.balance.currency != currency:
amount = convert_currency(amount, currency)
self.balance += amount
def withdraw_money(self, amount: float):
if amount < 5:
raise Exception("minimum transfer to other bank is $5")
self.balance -= amountValue Object
Note
Example
Aggregate
Note
Domain Service
Note
Example
Factory
Note
Repository
Note
Last updated