Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-28 15:33:38 +02:00
parent f86b52e236
commit 32c97accd7
8 changed files with 74 additions and 6 deletions

View File

@@ -25,6 +25,7 @@ class StaffMemberModel extends Equatable {
final String? jobTitle;
final SystemRole systemRole;
final bool isActive;
final bool hasJoined;
const StaffMemberModel({
this.id,
@@ -36,6 +37,7 @@ class StaffMemberModel extends Equatable {
this.jobTitle,
this.systemRole = SystemRole.user,
this.isActive = true,
this.hasJoined = false,
});
StaffMemberModel copyWith({
@@ -49,6 +51,7 @@ class StaffMemberModel extends Equatable {
String? jobTitle,
SystemRole? systemRole,
bool? isActive,
bool? hasJoined,
}) {
return StaffMemberModel(
id: id ?? this.id,
@@ -60,6 +63,7 @@ class StaffMemberModel extends Equatable {
jobTitle: jobTitle ?? this.jobTitle,
systemRole: systemRole ?? this.systemRole,
isActive: isActive ?? this.isActive,
hasJoined: hasJoined ?? this.hasJoined,
);
}
@@ -71,8 +75,6 @@ class StaffMemberModel extends Equatable {
email: '',
phoneNumber: '',
jobTitle: '',
systemRole: SystemRole.user,
isActive: true,
);
}
@@ -87,6 +89,7 @@ class StaffMemberModel extends Equatable {
jobTitle: map['job_title'] as String?,
systemRole: SystemRole.fromString(map['system_role']),
isActive: map['is_active'] ?? true,
hasJoined: map['has_joined'] ?? false,
);
}
@@ -101,6 +104,7 @@ class StaffMemberModel extends Equatable {
if (jobTitle != null) 'job_title': jobTitle,
'system_role': systemRole.name, // Trasforma SystemRole.admin in 'admin'
'is_active': isActive,
'has_joined': hasJoined,
};
}
@@ -115,5 +119,6 @@ class StaffMemberModel extends Equatable {
jobTitle,
systemRole,
isActive,
hasJoined,
];
}