refactor dashboard operation list e task list with applifecycle

This commit is contained in:
2026-05-30 15:19:22 +02:00
parent 064179a753
commit f31ff19a74
9 changed files with 282 additions and 228 deletions

View File

@@ -38,6 +38,9 @@ class OperationsRepository {
// --- RECUPERO PAGINATO CON FILTRI E JOIN ---
Future<List<OperationModel>> fetchOperations({
required String companyId,
String? storeId,
String? staffId,
String? providerId,
required int offset,
int limit = 50,
String? searchTerm,
@@ -64,6 +67,18 @@ class OperationsRepository {
.lte('created_at', dateRange.end.toIso8601String());
}
if (storeId != null) {
query = query.or('store_id.eq.$storeId,store_id.is.null');
}
if (staffId != null) {
query = query.or('staff_id.eq.$staffId,staff_id.is.null');
}
if (providerId != null) {
query = query.or('provider_id.eq.$providerId,provider_id.is.null');
}
if (searchTerm != null && searchTerm.isNotEmpty) {
// Filtra sui campi della tabella principale O su quelli della tabella joinata
query = query.or(
@@ -83,7 +98,7 @@ class OperationsRepository {
}
}
Stream<List<OperationModel>> getLatestStoreOperationsStream({
Stream<List<OperationModel>> watchStoreOperations({
required String storeId,
required int limit,
}) {