diff --git a/lib/modules/loan_module/models/assigned_fe_user_model.dart b/lib/modules/loan_module/models/assigned_fe_user_model.dart new file mode 100644 index 00000000..db778092 --- /dev/null +++ b/lib/modules/loan_module/models/assigned_fe_user_model.dart @@ -0,0 +1,52 @@ +class AssignedFEUser { + String? id; + String? name; + String? email; + String? employeeId; + int? languageId; + String? extensionNo; + String? phoneNumber; + String? positionName; + String? position; + bool? isActive; + + AssignedFEUser( + {this.id, + this.name, + this.email, + this.employeeId, + this.languageId, + this.extensionNo, + this.phoneNumber, + this.positionName, + this.position, + this.isActive}); + + AssignedFEUser.fromJson(Map json) { + id = json['id']; + name = json['name']; + email = json['email']; + employeeId = json['employeeId']; + languageId = json['languageId']; + extensionNo = json['extensionNo']; + phoneNumber = json['phoneNumber']; + positionName = json['positionName']; + position = json['position']; + isActive = json['isActive']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['email'] = this.email; + data['employeeId'] = this.employeeId; + data['languageId'] = this.languageId; + data['extensionNo'] = this.extensionNo; + data['phoneNumber'] = this.phoneNumber; + data['positionName'] = this.positionName; + data['position'] = this.position; + data['isActive'] = this.isActive; + return data; + } +} \ No newline at end of file diff --git a/lib/modules/loan_module/models/loan_request_model.dart b/lib/modules/loan_module/models/loan_request_model.dart index 4486639c..2472f201 100644 --- a/lib/modules/loan_module/models/loan_request_model.dart +++ b/lib/modules/loan_module/models/loan_request_model.dart @@ -1,5 +1,6 @@ import 'package:test_sa/models/lookup.dart'; +import 'assigned_fe_user_model.dart'; import 'loan_attachment_model.dart'; class LoanRequestModel { @@ -46,9 +47,9 @@ class LoanRequestModel { String? mesUserID; String? mesUser; String? assignedFEForInstallationUserID; - String? assignedFEForInstallationUser; + AssignedFEUser? assignedFEForInstallationUser; String? assignedFEForPulloutUserID; - String? assignedFEForPulloutUser; + AssignedFEUser? assignedFEForPulloutUser; int? cmwoItemId; int? installationWOItemId; int? pulloutWOItemId; @@ -168,9 +169,9 @@ class LoanRequestModel { mesUserID = json['mesUserID']; mesUser = json['mesUser']; assignedFEForInstallationUserID = json['assignedFEForInstallationUserID']; - assignedFEForInstallationUser = json['assignedFEForInstallationUser']; + assignedFEForInstallationUser = json['assignedFEForInstallationUser'] == null ? null : AssignedFEUser.fromJson(json['assignedFEForInstallationUser']); assignedFEForPulloutUserID = json['assignedFEForPulloutUserID']; - assignedFEForPulloutUser = json['assignedFEForPulloutUser']; + assignedFEForPulloutUser = json['assignedFEForPulloutUser'] == null ? null : AssignedFEUser.fromJson(json['assignedFEForPulloutUser']); cmwoItemId = json['cmwoItemId']; installationWOItemId = json['installationWOItemId']; pulloutWOItemId = json['pulloutWOItemId']; @@ -230,9 +231,9 @@ class LoanRequestModel { data['mesUserID'] = this.mesUserID; data['mesUser'] = this.mesUser; data['assignedFEForInstallationUserID'] = this.assignedFEForInstallationUserID; - data['assignedFEForInstallationUser'] = this.assignedFEForInstallationUser; + data['assignedFEForInstallationUser'] = this.assignedFEForInstallationUser?.toJson(); data['assignedFEForPulloutUserID'] = this.assignedFEForPulloutUserID; - data['assignedFEForPulloutUser'] = this.assignedFEForPulloutUser; + data['assignedFEForPulloutUser'] = this.assignedFEForPulloutUser?.toJson(); data['cmwoItemId'] = this.cmwoItemId; data['installationWOItemId'] = this.installationWOItemId; data['pulloutWOItemId'] = this.pulloutWOItemId;