Files
silver-octo-spoon/wolverine/a-frame-architecture/FinancialApi.Application/Class1.cs
T
brianj bf16b7b807 Added all projects
We are almost working.
2026-07-13 17:29:43 +02:00

16 lines
478 B
C#

namespace FinancialApi.Application;
public record Account(int Id, decimal Balance)
{
public Account ApplyFee(decimal amount)
{
if (amount <= 0)
throw new ArgumentException("Fee must be positive.");
if (Balance - amount < 0)
throw new InvalidOperationException("Insufficient funds.");
// Returns a brand new record with the updated balance
return this with { Balance = Balance - amount };
}
}