
class RoleModel {
  final String id;
  final String name;
  final List<String> permissions;

  RoleModel({
    required this.id,
    required this.name,
    required this.permissions,
  });

  factory RoleModel.fromMap(Map<String, dynamic> map, String id) {
    return RoleModel(
      id: id,
      name: map['name'] ?? '',
      permissions: List<String>.from(map['permissions'] ?? []),
    );
  }

  Map<String, dynamic> toMap() {
    return {
      'name': name,
      'permissions': permissions,
    };
  }
}
