Commit Graph

63 Commits (30a81a2a06abfe3313b656836e06bf26cb0419d1)

Author SHA1 Message Date
SYED MUSTUFA AHMED NAQVI 30a81a2a06 Merge branch 'main' into fixes 2026-05-09 09:44:29 +00:00
SYED MUSTUFA AHMED NAQVI 505d11cfdf fix/ replace UTC with localtime for excell sheet 2026-05-09 14:43:12 +05:00
SYED MUSTUFA AHMED NAQVI 3758738210 Merge pull request 'fixes-department added in sheet' (#11) from fixes into main
Reviewed-on: #11
2026-04-24 06:45:24 +00:00
SYED MUSTUFA AHMED NAQVI 9db32c0d20 Merge branch 'fixes' of https://git.utopiadeals.com/mustafa.ahmed/Utopia-Canteen-System into fixes 2026-04-24 11:44:27 +05:00
SYED MUSTUFA AHMED NAQVI ebc64ac17d department added in excell sheet 2026-04-24 11:44:18 +05:00
SYED MUSTUFA AHMED NAQVI 29f0130ca1 Merge pull request 'fixes' (#10) from fixes into main
Reviewed-on: #10
2026-04-23 12:45:35 +00:00
SYED MUSTUFA AHMED NAQVI 213779c695 Merge branch 'main' into fixes 2026-04-23 12:45:22 +00:00
SYED MUSTUFA AHMED NAQVI 2252112e35 Merge branch 'fixes' of https://git.utopiadeals.com/mustafa.ahmed/Utopia-Canteen-System into fixes 2026-04-23 17:44:18 +05:00
SYED MUSTUFA AHMED NAQVI 3b7b4f7b79 adding name and employee id in excell sheet 2026-04-23 17:43:53 +05:00
SYED MUSTUFA AHMED NAQVI bda42b2a84 Merge pull request 'fixes' (#9) from fixes into main
Reviewed-on: #9
2026-04-20 12:10:41 +00:00
SYED MUSTUFA AHMED NAQVI 78feb65d4f Merge branch 'main' into fixes 2026-04-20 12:10:34 +00:00
SYED MUSTUFA AHMED NAQVI 9abc066cad Merge branch 'fixes' of https://git.utopiadeals.com/mustafa.ahmed/Utopia-Canteen-System into fixes 2026-04-20 16:52:48 +05:00
SYED MUSTUFA AHMED NAQVI a22562cb59 Implement session-based duplicate meal guard with optional auto-sync control
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.
2026-04-20 16:51:58 +05:00
SYED MUSTUFA AHMED NAQVI fe36ba60e0 Merge pull request 'fixes' (#8) from fixes into main
Reviewed-on: #8
2026-04-09 06:46:29 +00:00
SYED MUSTUFA AHMED NAQVI 974ca733d9 Merge branch 'main' into fixes 2026-04-09 06:45:53 +00:00
SYED MUSTUFA AHMED NAQVI 316f463962 Merge branch 'fixes' of https://git.utopiadeals.com/mustafa.ahmed/Utopia-Canteen-System into fixes 2026-04-09 11:42:54 +05:00
SYED MUSTUFA AHMED NAQVI b1a86196e8 add a fallback flow for the menu items. 2026-04-09 11:42:37 +05:00
SYED MUSTUFA AHMED NAQVI 29bbbe480c Merge pull request 'fixes' (#7) from fixes into main
Reviewed-on: #7
2026-04-08 08:40:08 +00:00
SYED MUSTUFA AHMED NAQVI 291b381cda Merge branch 'main' into fixes 2026-04-08 08:39:29 +00:00
SYED MUSTUFA AHMED NAQVI 82c899f9fa Merge branch 'fixes' of https://git.utopiadeals.com/mustafa.ahmed/Utopia-Canteen-System into fixes 2026-04-08 13:26:47 +05:00
SYED MUSTUFA AHMED NAQVI 679b0a053e updated the mysqlconnectionstring with preload string to load when app is deployed 2026-04-08 13:26:26 +05:00
SYED MUSTUFA AHMED NAQVI f17c282369 Merge pull request 'fixes' (#6) from fixes into main
Reviewed-on: #6
2026-04-08 07:42:40 +00:00
SYED MUSTUFA AHMED NAQVI 01ddc0310c Merge branch 'main' into fixes 2026-04-07 12:35:13 +00:00
SYED MUSTUFA AHMED NAQVI 937bcc50d3 Merge branch 'fixes' of https://git.utopiadeals.com/mustafa.ahmed/Utopia-Canteen-System into fixes 2026-04-07 17:33:09 +05:00
SYED MUSTUFA AHMED NAQVI cdc610a635 Enforce employee-specific menu authorization via employee_menu_item_tag
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.
2026-04-07 17:32:51 +05:00
SYED MUSTUFA AHMED NAQVI e2363ed394 Merge pull request 'fixes' (#5) from fixes into main
Reviewed-on: #5
2026-04-02 05:50:32 +00:00
SYED MUSTUFA AHMED NAQVI 17bc973c8d Merge branch 'main' into fixes 2026-04-02 05:50:12 +00:00
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 4cdac8b4be HRMS lunch_order_item rows after lunch_order / production transaction insert
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.
2026-04-02 09:44:16 +05:00
SYED MUSTUFA AHMED NAQVI 0fd22cc1d5 Merge branch 'fixes' of https://git.utopiadeals.com/mustafa.ahmed/Utopia-Canteen-System into fixes 2026-04-01 11:53:47 +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 e467831cfb Merge pull request 'fixes' (#4) from fixes into main
Reviewed-on: #4
2026-03-31 14:30:18 +00:00
SYED MUSTUFA AHMED NAQVI fd6f9ea9ce Merge branch 'main' into fixes 2026-03-31 14:27:17 +00:00
SYED MUSTUFA AHMED NAQVI 3498b7be43 Merge branch 'fixes' of https://git.utopiadeals.com/mustafa.ahmed/Utopia-Canteen-System into fixes 2026-03-31 19:25:15 +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 131676754b Merge pull request 'Change in Method to fetch the lcoation side id right after the login from admin credentials' (#3) from fixes into main
Reviewed-on: #3
2026-03-30 11:28:19 +00:00
SYED MUSTUFA AHMED NAQVI 4e1a6cf8e6 Merge branch 'main' into fixes 2026-03-30 11:28:07 +00:00
SYED MUSTUFA AHMED NAQVI 1c43c3d25a Change in Method to fetch the lcoation side id right after the login from admin credentials 2026-03-30 16:20:41 +05:00
SYED MUSTUFA AHMED NAQVI 390361ce83 Merge pull request 'fixes' (#2) from fixes into main
Reviewed-on: #2
2026-03-18 08:42:20 +00:00
SYED MUSTUFA AHMED NAQVI fc762456a4 Implemented dynamic site filter logic for meal schedules view. Updated the site selection filter to ensure proper normalization of site IDs from the config and database, allowing accurate display of meal schedules based on the selected site. 2026-03-18 13:38:09 +05:00
Muhammad Faisal Malik d3472f37a3 "Stop tracking PublishProfiles" 2026-03-17 14:18:55 +05:00
SYED MUSTUFA AHMED NAQVI 0d6732ad2e Added site mismatch check to block employees from scanning on different sites
- Implemented a check to validate the employee's LocationSiteId against the current site.

- If the employee is from a different site, the scan is blocked and an error message is shown.

- Site mismatch message displays the correct site IDs and prevents scanning for employees registered on a different site.

- Ensured the scan only proceeds for employees registered on the current site.
2026-03-17 14:07:02 +05:00
SYED MUSTUFA AHMED NAQVI db28c3488c Merge pull request 'fixes' (#1) from fixes into main
Reviewed-on: #1
2026-03-17 05:17:12 +00: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 dcf536f0c7 make the meal schedule page view only 2026-03-10 13:56:31 +05:00
SYED MUSTUFA AHMED NAQVI 4d2433fa28 Fix config overwrite on login/navigation; use production DB for meal schedule CRUD, remove default SiteId normalization, add config load/save logging, and support legacy SiteId format. 2026-03-10 10:40:51 +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 18a6b7a668 Add solution file to repo root 2026-03-05 14:13:17 +05:00
SYED MUSTUFA AHMED NAQVI a1ff310afb Show HRMS employee photo in dashboard and order history
Add EmployeePhotoService to load and decode hrms.employee_photo blobs (data URI or raw bytes) using parent_document_id

Wire ScannerDashboardViewModel to load photos after RFID scan and on app restart, binding to EmployeeProfileImage

Display employee photos in left panel and order-history rows with graceful placeholder fallback

Store ParentDocumentId in scan records and expose it through HrmsEmployeeInfo / ScanRecord / OrderHistoryItem for photo lookups

Use employee.concatenated_name from HRMS for full employee name in lookups

Add CRUD support for meal schedules backed by hrms.meal_schedule (Add New + Save creates/updates schedules for a site and session)
2026-03-03 13:47:43 +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