38 lines
956 B
C#
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;
|
|
}
|
|
}
|
|
|