providers-in-store (#4)

Reviewed-on: http://catelliub.zapto.org:3000/brontomark/flux/pulls/4
Co-authored-by: mark-cachy <marco@catelli.it>
Co-committed-by: mark-cachy <marco@catelli.it>
This commit is contained in:
2026-04-17 15:37:14 +02:00
committed by brontomark
parent c1b6c9e7ac
commit 667bbf6404
14 changed files with 688 additions and 335 deletions

View File

@@ -16,17 +16,17 @@ class StaffRepository {
.eq('company_id', companyId)
.order('name', ascending: true);
return (response as List).map((s) => StaffMemberModel.fromJson(s)).toList();
return (response as List).map((s) => StaffMemberModel.fromMap(s)).toList();
}
Future<StaffMemberModel> saveStaffMember(StaffMemberModel member) async {
final response = await _supabase
.from('staff_member')
.upsert(member.toJson())
.upsert(member.toMap())
.select()
.single();
return StaffMemberModel.fromJson(response);
return StaffMemberModel.fromMap(response);
}
// --- LOGICA DI GIUNZIONE (Staff <-> Store) ---
@@ -42,7 +42,7 @@ class StaffRepository {
.eq('store_id', storeId);
return (response as List)
.map((item) => StaffMemberModel.fromJson(item['staff_member']))
.map((item) => StaffMemberModel.fromMap(item['staff_member']))
.toList();
}
@@ -57,7 +57,7 @@ class StaffRepository {
.eq('staff_member_id', staffId);
return (response as List)
.map((item) => StoreModel.fromJson(item['store']))
.map((item) => StoreModel.fromMap(item['store']))
.toList();
}