using Jugenddienst_Stunden.Interfaces;
using Jugenddienst_Stunden.Types;
namespace Jugenddienst_Stunden.Infrastructure;
///
/// Represents the application settings and provides access to user preferences
/// such as API URL, API key, employee ID, and personal details.
///
///
/// The AppSettings class implements the IAppSettings interface and manages
/// persistent configuration settings needed for the application.
/// These settings include preferences like API configuration and user identification details.
///
internal sealed class AppSettings : IAppSettings {
public string ApiUrl {
get => Preferences.Default.Get("apiUrl", "");
set => Preferences.Default.Set("apiUrl", value);
}
public string ApiKey {
get => Preferences.Default.Get("apiKey", "");
set => Preferences.Default.Set("apiKey", value);
}
public int EmployeeId {
get => Preferences.Default.Get("EmployeeId", 0);
set => Preferences.Default.Set("EmployeeId", value);
}
public string Name {
get => Preferences.Default.Get("name", "Nicht");
set => Preferences.Default.Set("name", value);
}
public string Surname {
get => Preferences.Default.Get("surname", "Eingeloggt");
set => Preferences.Default.Set("surname", value);
}
public Settings? Settings { get; set; }
}