budget/BudgetApp/Domain/Models/Configuration.cs
2026-01-03 10:29:03 -06:00

38 lines
956 B
C#

namespace BudgetApp.Domain.Models;
/// <summary>
/// Application configuration settings.
/// </summary>
public class Configuration
{
public Guid Id { get; protected set; }
public string DefaultCurrency { get; protected set; } = string.Empty;
protected Configuration()
{
}
public Configuration(Guid id, string defaultCurrency)
{
if (string.IsNullOrWhiteSpace(defaultCurrency))
throw new ArgumentException("Default currency cannot be null or empty.", nameof(defaultCurrency));
Id = id;
DefaultCurrency = defaultCurrency;
}
public Configuration(string defaultCurrency)
: this(Guid.NewGuid(), defaultCurrency)
{
}
public void UpdateDefaultCurrency(string currency)
{
if (string.IsNullOrWhiteSpace(currency))
throw new ArgumentException("Currency cannot be null or empty.", nameof(currency));
DefaultCurrency = currency;
}
}