antes de agregar el id
This commit is contained in:
@@ -38,6 +38,17 @@ class FirebaseServiceRepository {
|
||||
.toList());
|
||||
}
|
||||
|
||||
Stream<List<ServiceEntity>> getServicesForProfessional(
|
||||
String professionalId) {
|
||||
return serviceCollection
|
||||
.where('professional_id', isEqualTo: professionalId)
|
||||
.where('status', whereIn: [0, 1, 2])
|
||||
.snapshots()
|
||||
.map((querySnapshot) => querySnapshot.docs
|
||||
.map((doc) => ServiceEntity.fromDocument(doc.data()))
|
||||
.toList());
|
||||
}
|
||||
|
||||
Stream<List<ServiceEntity>> getServicesHistoryForUser(String userId) {
|
||||
return serviceCollection
|
||||
.where('user_id', isEqualTo: userId)
|
||||
@@ -47,4 +58,15 @@ class FirebaseServiceRepository {
|
||||
.map((doc) => ServiceEntity.fromDocument(doc.data()))
|
||||
.toList());
|
||||
}
|
||||
|
||||
Stream<List<ServiceEntity>> getServicesHistoryForProfessional(
|
||||
String professionalId) {
|
||||
return serviceCollection
|
||||
.where('professional_id', isEqualTo: professionalId)
|
||||
.where('status', whereIn: [3, 4])
|
||||
.snapshots()
|
||||
.map((querySnapshot) => querySnapshot.docs
|
||||
.map((doc) => ServiceEntity.fromDocument(doc.data()))
|
||||
.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,8 +407,7 @@ class FirebaseUserRepository implements UserRepository {
|
||||
@override
|
||||
Future<List<MyUser>> getUsersFromIds(Iterable<String> ids) async {
|
||||
try {
|
||||
final querySnapshot =
|
||||
await usersCollection.where(FieldPath.documentId, whereIn: ids).get();
|
||||
final querySnapshot = await usersCollection.where(FieldPath.documentId, whereIn: ids).get();
|
||||
|
||||
return querySnapshot.docs
|
||||
.map((e) => MyUser.fromEntity(MyUserEntity.fromDocument(e.data())))
|
||||
|
||||
Reference in New Issue
Block a user