passo_mobile_app/lib/model/profile/assigned_area.dart

33 lines
1.0 KiB
Dart
Raw Normal View History

import 'package:unit2/model/rbac/assigned_role.dart';
2023-09-11 03:34:42 +00:00
import 'package:unit2/model/rbac/rbac.dart';
import '../roles/pass_check/assign_role_area_type.dart';
class UserAssignedArea {
final AssignedRole? assignedRole;
final AssignRoleAreaType? assignedRoleAreaType;
final dynamic assignedArea;
UserAssignedArea({
required this.assignedRole,
required this.assignedRoleAreaType,
required this.assignedArea,
});
factory UserAssignedArea.fromJson(Map<String, dynamic> json) => UserAssignedArea(
assignedRole: json['assigned_role'] == null? null: AssignedRole.fromJson(json["assigned_role"]),
assignedRoleAreaType: json['assigned_role_area_type'] == null? null : AssignRoleAreaType.fromJson(json["assigned_role_area_type"]),
assignedArea: json["assigned_area"],
);
Map<String, dynamic> toJson() => {
"assigned_role": assignedRole?.toJson(),
"assigned_role_area_type": assignedRoleAreaType?.toJson(),
"assigned_area": assignedArea,
};
}