refactor dashboard operation list e task list with applifecycle
This commit is contained in:
@@ -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,
|
||||
}) {
|
||||
|
||||
Reference in New Issue
Block a user