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:
@@ -0,0 +1,65 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class CompteAdherentEntity extends Equatable {
|
||||
final String numeroMembre;
|
||||
final String nomComplet;
|
||||
final String? organisationNom;
|
||||
final DateTime? dateAdhesion;
|
||||
final String statutCompte;
|
||||
|
||||
final double soldeCotisations;
|
||||
final double soldeEpargne;
|
||||
final double soldeBloque;
|
||||
final double soldeTotalDisponible;
|
||||
final double encoursCreditTotal;
|
||||
final double capaciteEmprunt;
|
||||
|
||||
final int nombreCotisationsPayees;
|
||||
final int nombreCotisationsTotal;
|
||||
final int nombreCotisationsEnRetard;
|
||||
final double engagementRate;
|
||||
|
||||
final int nombreComptesEpargne;
|
||||
final DateTime dateCalcul;
|
||||
|
||||
const CompteAdherentEntity({
|
||||
required this.numeroMembre,
|
||||
required this.nomComplet,
|
||||
this.organisationNom,
|
||||
this.dateAdhesion,
|
||||
required this.statutCompte,
|
||||
required this.soldeCotisations,
|
||||
required this.soldeEpargne,
|
||||
required this.soldeBloque,
|
||||
required this.soldeTotalDisponible,
|
||||
required this.encoursCreditTotal,
|
||||
required this.capaciteEmprunt,
|
||||
required this.nombreCotisationsPayees,
|
||||
required this.nombreCotisationsTotal,
|
||||
required this.nombreCotisationsEnRetard,
|
||||
required this.engagementRate,
|
||||
required this.nombreComptesEpargne,
|
||||
required this.dateCalcul,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
numeroMembre,
|
||||
nomComplet,
|
||||
organisationNom,
|
||||
dateAdhesion,
|
||||
statutCompte,
|
||||
soldeCotisations,
|
||||
soldeEpargne,
|
||||
soldeBloque,
|
||||
soldeTotalDisponible,
|
||||
encoursCreditTotal,
|
||||
capaciteEmprunt,
|
||||
nombreCotisationsPayees,
|
||||
nombreCotisationsTotal,
|
||||
nombreCotisationsEnRetard,
|
||||
engagementRate,
|
||||
nombreComptesEpargne,
|
||||
dateCalcul,
|
||||
];
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'compte_adherent_entity.dart';
|
||||
|
||||
/// Entité pour les statistiques du dashboard
|
||||
|
||||
class DashboardStatsEntity extends Equatable {
|
||||
final int totalMembers;
|
||||
final int activeMembers;
|
||||
@@ -225,6 +227,8 @@ class DashboardEntity extends Equatable {
|
||||
final Map<String, dynamic> userPreferences;
|
||||
final String organizationId;
|
||||
final String userId;
|
||||
/// Compte adhérent unifié (si disponible)
|
||||
final CompteAdherentEntity? monCompte;
|
||||
|
||||
const DashboardEntity({
|
||||
required this.stats,
|
||||
@@ -233,6 +237,7 @@ class DashboardEntity extends Equatable {
|
||||
required this.userPreferences,
|
||||
required this.organizationId,
|
||||
required this.userId,
|
||||
this.monCompte,
|
||||
});
|
||||
|
||||
// Méthodes utilitaires
|
||||
@@ -250,5 +255,7 @@ class DashboardEntity extends Equatable {
|
||||
userPreferences,
|
||||
organizationId,
|
||||
userId,
|
||||
monCompte,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
import 'package:dartz/dartz.dart';
|
||||
import '../entities/dashboard_entity.dart';
|
||||
import '../entities/compte_adherent_entity.dart';
|
||||
import '../../../../core/error/failures.dart';
|
||||
|
||||
abstract class DashboardRepository {
|
||||
/// Récupère le compte adhérent unifié (soldes, crédits, capacité d'emprunt).
|
||||
Future<Either<Failure, CompteAdherentEntity>> getCompteAdherent();
|
||||
|
||||
Future<Either<Failure, DashboardEntity>> getDashboardData(
|
||||
String organizationId,
|
||||
String userId,
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:injectable/injectable.dart';
|
||||
import '../../../../core/error/failures.dart';
|
||||
import '../../../../core/usecases/usecase.dart';
|
||||
import '../entities/compte_adherent_entity.dart';
|
||||
import '../repositories/dashboard_repository.dart';
|
||||
|
||||
@injectable
|
||||
class GetCompteAdherent implements UseCase<CompteAdherentEntity, NoParams> {
|
||||
final DashboardRepository repository;
|
||||
|
||||
GetCompteAdherent(this.repository);
|
||||
|
||||
@override
|
||||
Future<Either<Failure, CompteAdherentEntity>> call(NoParams params) async {
|
||||
return await repository.getCompteAdherent();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:injectable/injectable.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import '../entities/dashboard_entity.dart';
|
||||
@@ -5,6 +6,7 @@ import '../repositories/dashboard_repository.dart';
|
||||
import '../../../../core/error/failures.dart';
|
||||
import '../../../../core/usecases/usecase.dart';
|
||||
|
||||
@injectable
|
||||
class GetDashboardData implements UseCase<DashboardEntity, GetDashboardDataParams> {
|
||||
final DashboardRepository repository;
|
||||
|
||||
@@ -32,6 +34,7 @@ class GetDashboardDataParams extends Equatable {
|
||||
List<Object> get props => [organizationId, userId];
|
||||
}
|
||||
|
||||
@injectable
|
||||
class GetDashboardStats implements UseCase<DashboardStatsEntity, GetDashboardStatsParams> {
|
||||
final DashboardRepository repository;
|
||||
|
||||
@@ -59,6 +62,7 @@ class GetDashboardStatsParams extends Equatable {
|
||||
List<Object> get props => [organizationId, userId];
|
||||
}
|
||||
|
||||
@injectable
|
||||
class GetRecentActivities implements UseCase<List<RecentActivityEntity>, GetRecentActivitiesParams> {
|
||||
final DashboardRepository repository;
|
||||
|
||||
@@ -89,6 +93,7 @@ class GetRecentActivitiesParams extends Equatable {
|
||||
List<Object> get props => [organizationId, userId, limit];
|
||||
}
|
||||
|
||||
@injectable
|
||||
class GetUpcomingEvents implements UseCase<List<UpcomingEventEntity>, GetUpcomingEventsParams> {
|
||||
final DashboardRepository repository;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user