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

@@ -18,20 +18,20 @@ class StaffMemberModel extends Equatable {
required this.companyId,
});
factory StaffMemberModel.fromJson(Map<String, dynamic> json) {
factory StaffMemberModel.fromMap(Map<String, dynamic> map) {
return StaffMemberModel(
id: json['id'],
id: map['id'],
// Applichiamo il tuo myFormat per visualizzare i nomi correttamente
name: (json['name'] as String).myFormat(),
name: (map['name'] as String).myFormat(),
// L'email la teniamo lowercase per standard tecnico
email: (json['email'] as String? ?? '').toLowerCase().trim(),
phone: (json['phone'] as String? ?? '').trim(),
isActive: json['is_active'] ?? true,
companyId: json['company_id'],
email: (map['email'] as String? ?? '').toLowerCase().trim(),
phone: (map['phone'] as String? ?? '').trim(),
isActive: map['is_active'] ?? true,
companyId: map['company_id'],
);
}
Map<String, dynamic> toJson() {
Map<String, dynamic> toMap() {
return {
if (id != null) 'id': id,
'name': name.toLowerCase().trim(), // Salviamo pulito per le query