latest store services

This commit is contained in:
2026-04-29 12:34:05 +02:00
parent 9f57207a39
commit b1c1866b4b
8 changed files with 271 additions and 244 deletions

View File

@@ -84,6 +84,22 @@ class ServicesRepository {
}
}
Stream<List<ServiceModel>> getLastStoreServicesStream({
required String storeId,
required int limit,
}) {
return _supabase
.from('service')
.stream(primaryKey: ['id'])
.eq('store_id', storeId)
.order('created_at', ascending: false)
.limit(limit)
.map(
(listOfMaps) =>
listOfMaps.map((map) => ServiceModel.fromMap(map)).toList(),
);
}
// --- SALVATAGGIO COMPLETO (PRIMA PADRE, POI FIGLI) ---
Future<ServiceModel> saveFullService(ServiceModel service) async {
try {