namespace UtopiaCanteenSystem.Services; /// /// Holds the current admin session state for the app. /// public class AppSession { public bool IsAdminAuthenticated { get; private set; } public string AdminUsername { get; private set; } = string.Empty; public string AdminEmployeeId { get; private set; } = string.Empty; public DateTime? LoginTimeUtc { get; private set; } public void SetAdminAuthenticated(string username, string employeeId) { IsAdminAuthenticated = true; AdminUsername = username ?? string.Empty; AdminEmployeeId = employeeId ?? string.Empty; LoginTimeUtc = DateTime.UtcNow; } public void Logout() { IsAdminAuthenticated = false; AdminUsername = string.Empty; AdminEmployeeId = string.Empty; LoginTimeUtc = null; } }