Commit Graph

19 Commits (3b7b4f7b792b73b1d04402fb3496882802611643)

Author SHA1 Message Date
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 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 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 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
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 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 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
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
SYED MUSTUFA AHMED NAQVI f19316b04f Database cleanup and production sync improvements
- Remove legacy SQLite tables/columns (Employees, MealRates, TemporaryMealPlanOverrides, etc.)
- Replace scan timeout with granular interval (Days/Hours/Minutes/Seconds)
- Add CSV export for today's records in Order History modal
- Consolidate cooldown alerts with dynamic unit formatting
- Change order items to "Sehri/Iftari"
- Update MySQL sync: remove device_local_row_id, rename columns (scan_date, received_date)
- Add production migration script for schema changes
- Remove MySQL connection string from Settings UI (use appsettings.json)
2026-02-18 16:50:04 +05:00
SYED MUSTUFA AHMED NAQVI 25a808907d feat(settings): add manual sync + secure config template
Add Settings PostDataNow action via ISyncService

Remove hardcoded MySQL fallback; skip sync when not configured

Use production snake_case columns + always run cleanup

Add appsettings.example.json; ignore appsettings.json to avoid secrets

Rename Settings Cancel button to Back
2026-02-11 12:47:53 +05:00
SYED MUSTUFA AHMED NAQVI cb35b6581a Add order history card + view-all modal; improve device id; prep settings post button
- ScannerDashboard: added Order History card under employee panel (shows last 4 orders)
- Added Today’s Order History modal (View All) with overlay close + close button
- Wired modal state + bindings; added TodayOrderHistory collection and loaders
- Fixed modal element naming for code-behind references
- Updated device id storage to use readable machine/device identifier instead of GUID
- Settings: placed Post Data button next to Sync Endpoint and added IsPosting/PostButtonText/CanPostNow state.
2026-02-06 18:06:28 +05:00
SYED MUSTUFA AHMED NAQVI 90380bf4fb feat: admin login audit in SQLite; Settings Admin Card ID from DB; Scanner dashboard UI
Backend / data
- Add AdminLoginRecords table (Username, EmployeeId, LoginTimeUtc); record on each admin login
- Add IAdminAuditService (RecordLoginAsync, GetLastLogin); AdminAuditService implementation
- Settings: Admin Card ID always prefilled from last admin login in DB (AdminLoginRecords.EmployeeId), fallback "ADMIN"
- Wire AdminAuditService in App.xaml.cs; inject into AdminLoginViewModel and SettingsViewModel

UI
- Scanner Dashboard: two-panel layout (left: employee card with photo, name, department, employee ID, order; right: order placement + stats)
- Employee section: larger fonts and spacing, circular profile image, sample data and asset (emppic.jpeg)
- Menu bar: Site / Settings / Logout in WrapPanel for responsive layout; consistent button sizing
- Dashboard and card responsive (ScrollViewer, MinWidth 0, card MinWidth 360 / MaxWidth 1150)
- Scanner status: activity-based only (connected when input received; no hardware detection)
2026-02-04 18:18:17 +05:00
SYED MUSTUFA AHMED NAQVI 7bc5ffc77e Scanner dashboard & sync updates
- Add SiteId/DeviceId to scan pipeline (config, SQLite, sync payload, schema upgrade)
- Canteen wording: orders/place order, Today’s Orders, Total Orders (today only), scanner connectivity status
- Menu: site left, Settings/Logout right; fix focus for site input and when closing menu
- Cooldown: prominent on-screen alert to ask customer to rescan after countdown
- Sync: post to production every 15 minutes (was 3 hours)
- UI: remove “Utopia Canteen System” heading, larger logo, single menu row layout
2026-02-03 18:26:39 +05:00
SYED MUSTUFA AHMED NAQVI 3f08666c15 feat: scanner+dashboard unified UI with cooldown and local sqlite sync 2026-02-02 16:45:55 +05:00
SYED MUSTUFA AHMED NAQVI 113b22f344 Initial commit: admin login + scanner flow + sqlite persistence + sync service 2026-01-31 16:53:32 +05:00