Updates settings to work through the backend API for cache sync, order posting, backend health checks, backend URL display, and server/client mode configuration.
Updates application startup to compose server-mode backend services or client-mode API services, and adds empty/no-op services for frontend-only client behavior.
Replaces the RFID-only local API host with a broader canteen backend host and adds DTO mapping for scan, stats, cache, sync, employee, and schedule API responses.
Adds Server and Client application modes, central server URL settings, and local API listen URL settings.
Wires startup so server mode hosts the RFID API and cache sync timers, while client mode sends scans to the central server. Updates settings UI to save mode and manually sync cache data.
Adds a local HTTP API for the central canteen server to accept RFID scans and expose scan dashboard data.
Adds a client RFID service so scanner PCs can forward scans to the central server with device, site, and IP context.
Switches RFID employee lookup, meal session resolution, and menu lookup from live HRMS queries to the local SQLite cache.
Adds cache availability checks and shared site ID normalization for scan validation.
Adds local SQLite cache tables for employee RFID tags, meal schedules, lunch menu weeks, lunch menu items, and menu items.
Adds sync services that pull HRMS RFID/menu data into the local cache and track the last cache sync time.
Added a configurable SyncServiceEnabled flag in app config and wired startup to run the background sync timer only when enabled. Updated scan processing to enforce production duplicate checks by employee_serial_number + order_date + meal_name + location_site_id, blocking same-session repeat scans with “Meal already taken” while still allowing different meals on the same day. Improved offline/online behavior by saving locally first and attempting immediate sync when production is reachable, and enhanced manual sync to treat production duplicates as success by marking local IsSynced=1 instead of retrying forever.
Add IsMenuItemAuthorizedForRfidAsync to IEmployeeLookupService / EmployeeLookupService to validate menu access by joining employee_rfid_tag and employee_menu_item_tag. Update RfidService.ProcessScanDetailed to filter HRMS menu items against this authorization, block scans when no authorized item remains, and return a clear "No menu item selected." message while logging failures. This ensures only menu items explicitly tagged for a given RFID can be ordered, and prevents unauthorized or unmapped items from creating transactions.
The FromGradeType method in HrmsMenuItemForMapping was modified to handle the new mapping rules, ensuring that menu items and lunch order items align with the updated grade-to-menu mapping:
Contractual and MTO/TE/Intern are now mapped to MANAGEMENT menu.
Unassigned and empty values are mapped to NON_MANAGEMENT.
Extend SyncService so each unsynced SQLite scan still posts to production lunch_order_transactions and upserts HRMS lunch_order, then creates matching lunch_order_item rows. Item lines are derived from SQLite MealItems (split on +); each name is resolved via lunch_menu_week → lunch_menu_item → menu_item using site, menu date, meal name, and optional item_for from grade_type, with a fallback lookup if the meal filter misses. Inserts use lunch_order_id, lunch_menu_item_id, quantity (1), price_at_order_time, item_name, and item_type from HRMS, and skips duplicates for the same order and menu item.
- Added mealName parameter to IMenuLookupService.GetMenuItemsForSiteAndDateAsync
- Updated SQL query to filter by li.meal_name in MenuLookupService
- Added meal_name to SELECT and result mapping
- Updated RfidService to pass mealLabel from resolved session
- Maintained backward compatibility with existing method
- Updated `item_for` column in `menu_item` table to reflect correct values based on employee grade type (Management/NonManagement).
- Added 'MANAGEMENT' to items with id 51 and 53.
- Added 'NON_MANAGEMENT' to item with id 54.
- Modified the employee photo fetching logic to use the external link instead of the database for fetching employee photos.
- Added missing fields in the `lunch_order_transactions` table to ensure no fields are left blank or null during the scan process.