Actions
Feasibility Study #7301
closedFeature #7213: Training Mode (M17)
Feasibility study on training mode POC
Added by Chong Yit Ren 3 months ago. Updated 3 months ago.
Status:
Closed
Assignee:
Start date:
18/08/2026
Due date:
24/08/2026
% Done:
100%
Estimated time:
Complete Date:
24/08/2026
Files
| Screenshot 2026-08-21 175252.png (42.4 KB) Screenshot 2026-08-21 175252.png | Training mode setting - business date selection | Chong Yit Ren, 21/08/2026 10:03 AM | |
| Screenshot 2026-08-21 175343.png (177 KB) Screenshot 2026-08-21 175343.png | Training mode session | Chong Yit Ren, 21/08/2026 10:03 AM | |
| Screenshot 2026-08-21 175515.png (34.1 KB) Screenshot 2026-08-21 175515.png | Training mode DB with remark showing business date | Chong Yit Ren, 21/08/2026 10:03 AM |
Updated by Chong Yit Ren 3 months ago
- Due date set to 24/08/2026
- Start date changed from 24/08/2026 to 18/08/2026
Updated by Chong Yit Ren 3 months ago
- Status changed from New to Dev In Progress
Updated by Chong Yit Ren 3 months ago · Edited
- File Screenshot 2026-08-21 163259.png added
- File Screenshot 2026-08-21 175252.png added
- File Screenshot 2026-08-21 175515.png added
Built and tested (working, verified end-to-end)
- DB isolation : clones Master.db + Transactions.db into a training pair; atomic copy → validate → promote, so a failed copy never touches production
- Crash-safe recovery : persisted session marker; the app only trusts training mode if the marker and the env var both agree
- Sync isolation : all three sync mechanisms (Outbox worker, Kafka consumer, LAN sync) confirmed disabled via live test — a product added in Admin during a training session was correctly absent from both databases, then correctly appeared in the live database after exit
- Business clock : IBusinessClock abstraction built and wired into DI; trainer selects a business date/time on entry, the app reflects that date for the session, advancing normally in real time from there
- Clock confirmed working for display : Main Menu's business date/time correctly reflects the simulated training date
- Visual proof of correctness : training transactions carry a stamped remark showing the simulated business time at point of sale — confirmed in the database
- UI indicator : yellow banner and border shown app-wide while training mode is active
- Enter/exit flow : date picker on entry, single-button toggle to enter or exit, tested working in both directions
- Row level tagging : columns 'Operatingmode' and 'TrainingSessionId' added to Transactions.db. Training mode generates a GUID and adds into TrainingSessionId. OperatingMode correctly indicates training/live mode
Files added
- Qube.Cashier.App/Services/TrainingModeToggle.cs — clone/validate/promote, marker, enter/exit, relaunch logic
- Qube.Cashier.App/Pages/TrainingModeEntry.razor — business date/time picker, entry trigger
- Qube.Cashier.App/Shared/TrainingBanner.razor — yellow training-mode indicator banner
- Qube.Shared.Contracts/Time/IBusinessClock.cs — clock abstraction interface
- Qube.Shared.Contracts/Time/ProductionBusinessClock.cs — real-clock implementation
- Qube.Shared.Contracts/Time/TrainingBusinessClock.cs — simulated-clock implementation
Files changed
- Qube.Cashier.App/App.xaml.cs — reads training-mode env var and validated session; branches Master.db/Transactions.db paths to the training pair when active; registers IBusinessClock (production or training) in DI; gates OutboxWorker, Kafka consumer, and LAN sync behind !isTrainingMode; exposes StopBackgroundHostAsync, real DB file paths, and SQLite password statically for the toggle to use
- Qube.Cashier.App/MainWindow.xaml.cs — temporary debug hooks (Ctrl+Shift+T / Ctrl+Shift+E) for entering/exiting training mode during testing
- Qube.Cashier.App/Shared/MainLayout.razor — renders TrainingBanner; applies yellow border class when training mode is active
- Qube.Cashier.App/Pages/MainMenu.razor — "Training Mode" tile now enters or exits depending on current state; TickClock() reads from IBusinessClock instead of DateTime.Now
- Qube.Cashier.App/Pages/Payment.razor — injects IBusinessClock; stamps a training-mode marker with the simulated time into the transaction Remark field
Based on the findings, the requirements of this module are highly feasible
Updated by Chong Yit Ren 3 months ago
- File deleted (
Screenshot 2026-08-21 163259.png)
Updated by Chong Yit Ren 3 months ago
- File deleted (
Screenshot 2026-08-21 175252.png)
Updated by Chong Yit Ren 3 months ago
- File deleted (
Screenshot 2026-08-21 175515.png)
Actions
#7
Updated by Chong Yit Ren 3 months ago
Updated by Chong Yit Ren 3 months ago
- Status changed from Dev In Progress to Closed
- % Done changed from 0 to 100
- Complete Date set to 24/08/2026
Actions