feat: WebSocket temps réel + Finance Workflow + corrections

- Task #6: WebSocket /ws/dashboard + Kafka events (5 topics)
  * Backend: KafkaEventProducer, KafkaEventConsumer
  * Mobile: WebSocketService (reconnection, heartbeat, typed events)
  * DashboardBloc: Auto-refresh depuis WebSocket events

- Finance Workflow: approbations + budgets (backend + mobile)
  * Backend: entities, services, resources, migrations Flyway V6
  * Mobile: features finance_workflow complète avec BLoC

- Corrections DI: interfaces IRepository partout
  * IProfileRepository, IOrganizationRepository, IMembreRepository
  * GetIt configuré avec @injectable

- Spec-Kit: constitution + templates mis à jour
  * .specify/memory/constitution.md enrichie
  * Templates agent, plan, spec, tasks, checklist

- Nettoyage: fichiers temporaires supprimés

Signed-off-by: lions dev Team
This commit is contained in:
dahoud
2026-03-15 02:12:17 +00:00
parent bbc409de9d
commit e8ad874015
635 changed files with 58160 additions and 20674 deletions

View File

@@ -0,0 +1,107 @@
import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
import '../design_system/tokens/app_colors.dart';
import '../design_system/tokens/app_typography.dart';
/// UnionFlow Mobile - Composant DRY : MiniAvatar
/// Évite toute répétition de configuration d'image de profil.
/// Formats contraints (24px, 32px max).
class MiniAvatar extends StatelessWidget {
final String? imageUrl;
final String fallbackText; // Ex: "JD" pour John Doe
final double size;
final bool isOnline; // Ajoute une petite pastille verte
final Color? backgroundColor;
final Color? iconColor;
final bool isIcon;
const MiniAvatar({
Key? key,
this.imageUrl,
required this.fallbackText,
this.size = 32.0,
this.isOnline = false,
this.backgroundColor,
this.iconColor,
this.isIcon = false,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Stack(
children: [
Container(
width: size,
height: size,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: backgroundColor ?? AppColors.primaryGreen.withOpacity(0.1),
border: Border.all(
color: AppColors.lightBorder,
width: 0.5,
),
),
child: ClipOval(
child: isIcon
? _buildIcon()
: (imageUrl != null && imageUrl!.isNotEmpty
? CachedNetworkImage(
imageUrl: imageUrl!,
fit: BoxFit.cover,
placeholder: (context, url) => _buildFallback(),
errorWidget: (context, url, error) => _buildFallback(),
)
: _buildFallback()),
),
),
if (isOnline)
Positioned(
bottom: 0,
right: 0,
child: Container(
width: size * 0.3,
height: size * 0.3,
decoration: BoxDecoration(
color: AppColors.success,
shape: BoxShape.circle,
border: Border.all(
color: Theme.of(context).scaffoldBackgroundColor,
width: 1.5,
),
),
),
),
],
);
}
Widget _buildFallback() {
return Center(
child: Text(
fallbackText.toUpperCase(),
style: AppTypography.actionText.copyWith(
color: iconColor ?? AppColors.primaryGreen,
fontSize: size * 0.4,
),
),
);
}
Widget _buildIcon() {
IconData iconData;
switch (fallbackText) {
case 'people': iconData = Icons.people; break;
case 'event': iconData = Icons.event; break;
case 'business': iconData = Icons.business; break;
case 'settings': iconData = Icons.settings; break;
default: iconData = Icons.notifications;
}
return Center(
child: Icon(
iconData,
color: iconColor ?? AppColors.primaryGreen,
size: size * 0.6,
),
);
}
}