Phase 2 scaffold: mitra online status & pairing logic

Add mitra online/offline status with heartbeat-based auto-offline,
customer-mitra pairing via Valkey pub/sub blast, session management,
and control center dashboard with real-time stats.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 23:17:49 +08:00
parent a7a2a32d27
commit d668112edd
44 changed files with 2800 additions and 80 deletions

View File

@@ -7,6 +7,10 @@ import 'features/auth/screens/register_screen.dart';
import 'features/auth/screens/otp_screen.dart';
import 'features/auth/screens/force_register_screen.dart';
import 'features/home/home_screen.dart';
import 'features/chat/screens/searching_screen.dart';
import 'features/chat/screens/bestie_found_screen.dart';
import 'features/chat/screens/no_bestie_screen.dart';
import 'features/chat/screens/session_active_screen.dart';
GoRouter buildRouter(AuthBloc authBloc) {
return GoRouter(
@@ -30,6 +34,21 @@ GoRouter buildRouter(AuthBloc authBloc) {
GoRoute(path: '/auth/otp', builder: (context, state) => OtpScreen(phone: state.extra as String)),
GoRoute(path: '/auth/force-register', builder: (_, __) => const ForceRegisterScreen()),
GoRoute(path: '/home', builder: (_, __) => const HomeScreen()),
GoRoute(path: '/chat/searching', builder: (_, __) => const SearchingScreen()),
GoRoute(path: '/chat/found', builder: (context, state) {
final extra = state.extra as Map<String, dynamic>;
return BestieFoundScreen(
sessionId: extra['sessionId'] as String,
mitraName: extra['mitraName'] as String,
);
}),
GoRoute(path: '/chat/no-bestie', builder: (_, __) => const NoBestieScreen()),
GoRoute(path: '/chat/session/:sessionId', builder: (context, state) {
return SessionActiveScreen(
sessionId: state.pathParameters['sessionId']!,
mitraName: state.extra as String? ?? 'Bestie',
);
}),
],
);
}