diff --git a/UtopiaCanteen.Backend/UtopiaCanteen.Backend.csproj b/UtopiaCanteen.Backend/UtopiaCanteen.Backend.csproj
index 28601a6..1eee47d 100644
--- a/UtopiaCanteen.Backend/UtopiaCanteen.Backend.csproj
+++ b/UtopiaCanteen.Backend/UtopiaCanteen.Backend.csproj
@@ -12,6 +12,7 @@
+
diff --git a/UtopiaCanteen.Client/UtopiaCanteen.Client.csproj b/UtopiaCanteen.Client/UtopiaCanteen.Client.csproj
index 7b7b848..a387958 100644
--- a/UtopiaCanteen.Client/UtopiaCanteen.Client.csproj
+++ b/UtopiaCanteen.Client/UtopiaCanteen.Client.csproj
@@ -59,6 +59,8 @@
+
+
diff --git a/ViewModels/AdminLoginViewModel.cs b/ViewModels/AdminLoginViewModel.cs
index a97bb24..cd78c69 100644
--- a/ViewModels/AdminLoginViewModel.cs
+++ b/ViewModels/AdminLoginViewModel.cs
@@ -1,6 +1,7 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using UtopiaCanteenSystem.Services;
+using UtopiaCanteenSystem.Services.Logging;
namespace UtopiaCanteenSystem.ViewModels;
@@ -84,6 +85,7 @@ public partial class AdminLoginViewModel : ObservableObject
if (!result.Success)
{
ErrorMessage = "Invalid username or password.";
+ FileLogger.Warn("ClientLogin", $"Admin login failed for user '{user}'.");
return;
}
@@ -95,6 +97,10 @@ public partial class AdminLoginViewModel : ObservableObject
_employeeLookup,
_backendApi).ConfigureAwait(true);
+ FileLogger.Info(
+ "ClientLogin",
+ $"Admin login succeeded. EmployeeId={result.EmployeeId}, AdminCardId saved, SiteId={_config.GetSiteId()}");
+
// Persist who logged in (for audit / reporting).
await _adminAudit.RecordLoginAsync(user, result.EmployeeId).ConfigureAwait(false);
diff --git a/ViewModels/ScannerDashboardViewModel.cs b/ViewModels/ScannerDashboardViewModel.cs
index 464bbc1..014aa63 100644
--- a/ViewModels/ScannerDashboardViewModel.cs
+++ b/ViewModels/ScannerDashboardViewModel.cs
@@ -12,6 +12,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using UtopiaCanteenSystem.Models;
using UtopiaCanteenSystem.Services;
+using UtopiaCanteenSystem.Services.Logging;
namespace UtopiaCanteenSystem.ViewModels;
@@ -570,9 +571,11 @@ public partial class ScannerDashboardViewModel : ObservableObject
if (string.IsNullOrWhiteSpace(cardId))
return;
+ FileLogger.Info("ClientScan", $"Scan started. CardId={LogMasking.MaskCardId(cardId)}");
var result = _rfidService.ProcessScanDetailed(cardId);
IsSuccess = result.Success;
Message = result.Message;
+ FileLogger.Info("ClientScan", $"Scan UI message. Success={result.Success}, Message={result.Message}");
// Check if this is a site mismatch error
if (!result.Success && result.Message.Contains("not allowed to scan here"))