Fix some naming

This commit is contained in:
2026-07-31 09:35:44 +02:00
parent 2abe392890
commit 5e5fc0a034
11 changed files with 200 additions and 42 deletions
@@ -4,9 +4,8 @@ namespace FinancialApi.Domain.Entities;
public enum AccountType
{
Liability,
Debit,
Credit,
Spend,
Borrow,
Revenue
}
@@ -17,8 +16,8 @@ public record Account
this.Id = Id;
this.Balance = Balance;
this.Type = Type;
if (Balance < 0 && Type is AccountType.Liability or AccountType.Debit or AccountType.Revenue)
if (Balance < 0 && Type is AccountType.Spend or AccountType.Revenue)
{
throw new InvalidStartingBalanceException("Insufficient funds.");
}
@@ -33,7 +32,7 @@ public record Account
var newBalance = entryType == EntryType.Credit ? Balance + amount : Balance - amount;
if (newBalance < 0 && Type is AccountType.Liability or AccountType.Debit or AccountType.Revenue)
if (newBalance < 0 && Type is AccountType.Spend or AccountType.Revenue)
{
throw new InsufficientFundsException("Insufficient funds.");
}