Commit Graph

7 Commits (main)

Author SHA1 Message Date
SYED MUSTUFA AHMED NAQVI 0e171af1fa Updated the grade mapping logic in HrmsMenuItemForMapping.cs to map Contractual and MTO/TE/Intern to MANAGEMENT and Unassigned (and empty values) to NON_MANAGEMENT.
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.
2026-04-02 10:34:52 +05:00
SYED MUSTUFA AHMED NAQVI 92cdbc004b Implement meal session filtering in menu lookup
- 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
2026-04-01 11:53:18 +05:00
SYED MUSTUFA AHMED NAQVI cb5f91a5da Fix:
- 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.
2026-03-31 19:24:49 +05:00
SYED MUSTUFA AHMED NAQVI d82b2d3bd7 Align meal schedules and menus with current site and HRMS data
Seed per-user config from deployed appsettings.json when missing, so production SiteId and connection strings are preserved

Add centralized Logger writing to %LocalAppData%\UtopiaCanteenSystem\Logs\error.log with global unhandled exception handling

Extend scan flow to resolve HRMS menu (lunch_menu_week → lunch_menu_item → menu_item) per site/date and persist MealLabel, MealItems, and TotalPrice in SQLite

Fix menu lookups to use scanner local date instead of MySQL CURDATE(), avoiding time-zone mismatches

Restrict Meal Schedules view to only show schedules for the current configured site and remove multi-site filter options
2026-03-17 10:14:05 +05:00
SYED MUSTUFA AHMED NAQVI a42f43b2cc Sync scans to lunch_order and enforce per-session daily scans
Extend HRMS RFID lookup to include uind_serial, function_id, department_id, created_by, and tag created timestamp
Persist new tag fields + meal session code in SQLite scan records; auto-migrate schema and drop deprecated EmployeeDbId column
Enforce “once per meal session per local day” scan rule (keep short per-card debounce; remove global cooldown)
Enhance sync: insert scans into production lunch_order_transactions (MySqlConnectionString) and into HRMS/local lunch_order (HrmsLookupConnectionString) with duplicate guard; include location_site_id from SQLite SiteId
2026-03-09 13:01:08 +05:00
SYED MUSTUFA AHMED NAQVI e496445b35 Persist per-scan meal details and fix order history state across restarts
Store meal/session label, menu items, total price, department, and department type on each ScanRecord in SQLite so every scan keeps its own metadata.
Add lightweight schema upgrades for lunch_order_transactions to include MealLabel, MealItems, TotalPrice, Department, and DepartmentType.
Update RfidService to populate these new fields and expose UpdateLastScanMealInfo for post-scan enrichment.
Fix dashboard startup logic to restore last scanned employee (ID, name, department, department type, meal) from the last ScanRecord.
Refactor order history and “View All” modal to read Meal/Items and Price from each row’s stored values instead of a global in-memory label.
Include Meal and Price columns in the CSV export, using per-record data.
Remove unused local MealSchedules/OrderItems SQLite tables and ensure they are dropped as legacy schema.
2026-03-02 15:04:33 +05:00
SYED MUSTUFA AHMED NAQVI 888c692764 Use employee RFID site id for menu lookup
Add LocationSiteId to HrmsEmployeeInfo populated from employee_rfid_tag.location_site_id.

Update EmployeeLookupService query to select and map the site id.

Change ScannerDashboardViewModel to load lunch_menu_week using the site id from the scanned employee’s RFID tag instead of only config.
2026-02-24 13:27:50 +05:00