Problem
The frontend has a useWebSocket hook and socket.io-client installed, but the backend has no WebSocket gateway. Real-time notifications for asset status changes, transfers, and maintenance alerts are not possible.
Proposed Solution
Create backend/src/opsce/notifications/notifications.gateway.ts using @WebSocketGateway from @nestjs/websockets. Emit events from AssetsService and MaintenanceService via @nestjs/event-emitter.
Acceptance Criteria
Problem
The frontend has a
useWebSockethook andsocket.io-clientinstalled, but the backend has no WebSocket gateway. Real-time notifications for asset status changes, transfers, and maintenance alerts are not possible.Proposed Solution
Create
backend/src/opsce/notifications/notifications.gateway.tsusing@WebSocketGatewayfrom@nestjs/websockets. Emit events fromAssetsServiceandMaintenanceServicevia@nestjs/event-emitter.Acceptance Criteria
auth.tokenasset.updatedevent with asset ID and changed fields when an asset is updatedasset.transferredevent when an asset is transferredmaintenance.dueevent when a scheduled maintenance date is within 7 daysuserIdon connectOpsceModule