barsa e1c8b6c15e Integrate Realtime module and enhance event handling across various services
- Added `RealtimeModule` and `RealtimeApiModule` to the BFF application for improved real-time capabilities.
- Updated `CatalogCdcSubscriber` and `OrderCdcSubscriber` to utilize `RealtimeService` for publishing catalog and order updates, ensuring instant notifications across connected clients.
- Enhanced `OrderEventsService` to leverage `RealtimeService` for order event subscriptions, improving reliability across multiple BFF instances.
- Introduced `AccountEventsListener` in the portal layout to handle real-time account updates.
- Removed stale time and garbage collection settings from several hooks to streamline data fetching processes.
2025-12-15 11:10:50 +09:00

22 lines
654 B
TypeScript

/**
* Realtime Events - Shared Contracts
*
* Shared SSE payload shapes for portal + BFF.
*/
export interface RealtimeEventEnvelope<TEvent extends string = string, TData = unknown> {
event: TEvent;
data: TData;
}
export interface CatalogEligibilityChangedPayload {
accountId: string;
eligibility: string | null;
timestamp: string;
}
export type AccountStreamEvent =
| RealtimeEventEnvelope<"account.stream.ready", { topic: string; timestamp: string }>
| RealtimeEventEnvelope<"account.stream.heartbeat", { topic: string; timestamp: string }>
| RealtimeEventEnvelope<"catalog.eligibility.changed", CatalogEligibilityChangedPayload>;