Fixed Leave rejection and approvals

This commit is contained in:
2026-03-11 18:59:28 +08:00
parent 21e6d68910
commit f8c79acbbc
4 changed files with 41 additions and 9 deletions
+6
View File
@@ -8,6 +8,12 @@ import 'stream_recovery.dart';
import 'realtime_controller.dart';
/// All visible leaves (own for standard, all for admin/dispatcher/it_staff).
///
/// Consumers should **not** treat every record as an active absence; the UI
/// layers (dashboard, logbook) explicitly filter to `status == 'approved'` and
/// verify the leave overlaps the current time. This prevents rejected or
/// pending applications from inadvertently influencing schedules or status
/// computations.
final leavesProvider = StreamProvider<List<LeaveOfAbsence>>((ref) {
final client = ref.watch(supabaseClientProvider);
final profileAsync = ref.watch(currentProfileProvider);