feat: add current events section for equipment with dynamic status calculation

This commit is contained in:
ElPoyo
2026-01-06 12:13:09 +01:00
parent 25d395b41a
commit fb6a271f66
12 changed files with 773 additions and 124 deletions

View File

@@ -1,6 +1,7 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:em2rp/models/event_model.dart';
import 'package:em2rp/models/equipment_model.dart';
import 'package:em2rp/services/equipment_status_calculator.dart';
/// Service étendu pour gérer les 4 étapes : Préparation, Chargement, Déchargement, Retour
class EventPreparationServiceExtended {
@@ -59,6 +60,9 @@ class EventPreparationServiceExtended {
'assignedEquipment': updatedEquipment.map((e) => e.toMap()).toList(),
'loadingStatus': loadingStatusToString(LoadingStatus.completed),
});
// Invalider le cache des statuts d'équipement
EquipmentStatusCalculator.invalidateGlobalCache();
} catch (e) {
print('Error validating all loading: $e');
rethrow;
@@ -115,6 +119,9 @@ class EventPreparationServiceExtended {
'assignedEquipment': updatedEquipment.map((e) => e.toMap()).toList(),
'unloadingStatus': unloadingStatusToString(UnloadingStatus.completed),
});
// Invalider le cache des statuts d'équipement
EquipmentStatusCalculator.invalidateGlobalCache();
} catch (e) {
print('Error validating all unloading: $e');
rethrow;