Compare commits

..

2 Commits

Author SHA1 Message Date
joelthomastrenser ae37b83cbc Implement review fixes 2026-06-16 11:29:00 +05:30
joelthomastrenser 8aaa4eeec0 Implement interprocess event handling for notifications and account disable
Changes:
- Implements #2061
- Introduce EventManager for user-specific Windows event publishing/listening
- Add real-time notification and account-disabled event propagation
- Register authentication events through Controller and AuthenticationManagementService
- Trigger notification events from Inventory, Payment, and Service Management modules
- Trigger account-disabled events when users are deactivated
- Extract common menu event listener logic into Menu base class
- Add notification popup handling for Admin, Customer, and Technician menus
- Refactor shared memory components into core/sharedmemory
- Update project structure and include paths for events and shared memory modules
2026-06-16 11:10:13 +05:30
2 changed files with 9 additions and 4 deletions
@@ -153,9 +153,12 @@
<ClCompile Include="core\sharedmemory\SharedMemory.cpp"> <ClCompile Include="core\sharedmemory\SharedMemory.cpp">
<Filter>Source Files\Core\SharedMemory</Filter> <Filter>Source Files\Core\SharedMemory</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="EventManager.cpp"> <ClCompile Include="core\events\EventManager.cpp">
<Filter>Source Files\Core\Events</Filter> <Filter>Source Files\Core\Events</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="views\Menu.cpp">
<Filter>Source Files\Views</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="utilities\InputHelper.h"> <ClInclude Include="utilities\InputHelper.h">
@@ -287,5 +290,8 @@
<ClInclude Include="core\events\EventManager.h"> <ClInclude Include="core\events\EventManager.h">
<Filter>Header Files\Core\Events</Filter> <Filter>Header Files\Core\Events</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="views\Menu.h">
<Filter>Header Files\Views</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>
@@ -51,7 +51,6 @@ bool AuthenticationManagementService::login(const std::string& username, const s
}, },
[]() []()
{ {
HANDLE eventHandle = OpenEventA(EVENT_MODIFY_STATE, FALSE, "VehicleServiceSystem_NotificationAvailable");
if (m_notificationsAvailableEvent) if (m_notificationsAvailableEvent)
{ {
SetEvent(m_notificationsAvailableEvent); SetEvent(m_notificationsAvailableEvent);
@@ -124,8 +123,8 @@ Parameter: HANDLE accountDisabledEvent - account disabled event handle
HANDLE notificationAvailableEvent - notification event handle HANDLE notificationAvailableEvent - notification event handle
Return type: void Return type: void
*/ */
void AuthenticationManagementService::registerEvents(HANDLE accountDisabledEvent, HANDLE notifictionAvailableEvent) void AuthenticationManagementService::registerEvents(HANDLE accountDisabledEvent, HANDLE notificationAvailableEvent)
{ {
m_accountDisabledEvent = accountDisabledEvent; m_accountDisabledEvent = accountDisabledEvent;
m_notificationsAvailableEvent = notifictionAvailableEvent; m_notificationsAvailableEvent = notificationAvailableEvent;
} }