Commit Graph

13 Commits (e3effcb4164fb9f3d27540aff7186c11ad1ed840)

Author SHA1 Message Date
SYED MUSTUFA AHMED NAQVI e3effcb416 Harden sync, cache, dashboard, and schedule flows
Updates cache sync, production order sync, meal schedule view logic, and scanner dashboard behavior to support the new backend/client architecture.
2026-05-25 16:29:42 +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 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 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 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 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 35161336d0 feat: MySQL direct sync, IP tracking, and SiteId normalization
- Replace API sync with direct MySQL database insert
- Add IP address capture and storage (SQLite + MySQL)
- Normalize SiteId to 2-digit format (e.g., "02" instead of "SITE : 2")
- Mark records as synced instead of deleting after sync
- Add day-end cleanup for old synced rows
- Rename table to lunch_order_transactions
- Add MySqlConnector package and connection string config
2026-02-09 18:08:13 +05:00
SYED MUSTUFA AHMED NAQVI 306e03e71a chnage in layout of view all 'order' modal and chnage the local table name from ScanRecords to lunch_order_transactions 2026-02-09 12:17:08 +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