feat: add current events section for equipment with dynamic status calculation
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user