commit
fe36ba60e0
|
|
@ -333,7 +333,7 @@ public class RfidService : IRfidService
|
||||||
.GetAwaiter()
|
.GetAwaiter()
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
var matching = menuItems
|
var authorized = menuItems
|
||||||
.Where(i => i.MenuItemId > 0)
|
.Where(i => i.MenuItemId > 0)
|
||||||
.Where(i =>
|
.Where(i =>
|
||||||
{
|
{
|
||||||
|
|
@ -352,12 +352,17 @@ public class RfidService : IRfidService
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
if (matching.Count == 0)
|
// Fallback: if employee_menu_item_tag has no matches for this employee/session,
|
||||||
|
// still allow showing the menu items fetched from HRMS menu_item.
|
||||||
|
var matching = authorized.Count > 0
|
||||||
|
? authorized
|
||||||
|
: menuItems.ToList();
|
||||||
|
|
||||||
|
if (authorized.Count == 0)
|
||||||
{
|
{
|
||||||
Logger.Log(
|
Logger.Log(
|
||||||
new Exception($"No authorized menu item found for card={cardId}, site={siteNumeric}, date={nowLocal:yyyy-MM-dd}, meal={mealLabel}, grade={employee.GradeType}"),
|
new Exception($"No employee_menu_item_tag match; using fallback menu. card={cardId}, site={siteNumeric}, date={nowLocal:yyyy-MM-dd}, meal={mealLabel}, grade={employee.GradeType}"),
|
||||||
"RfidService.ProcessScanDetailed authorization");
|
"RfidService.ProcessScanDetailed authorization");
|
||||||
return new ScanResult(false, "No menu item selected.", 0, employee, session);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var names = matching
|
var names = matching
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue