You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mohemm-flutter-app/lib/models/dependent/get_mobile_login_info_depen...

93 lines
2.9 KiB
Dart

class GetMobileLoginInfoDependentModel {
int? iD;
String? dependentID;
String? depedentName;
String? dob;
int? channelID;
int? companyID;
String? deviceType;
String? deviceToken;
int? language;
int? gender;
int? loginType;
String? createdOn;
String? editedOn;
bool? businessCardPrivilege;
GetMobileLoginInfoDependentModel({
this.iD,
this.dependentID,
this.depedentName,
this.dob,
this.channelID,
this.companyID,
this.deviceType,
this.deviceToken,
this.language,
this.gender,
this.loginType,
this.createdOn,
this.editedOn,
this.businessCardPrivilege,
});
// Convenience aliases for existing logic
String? get nationalId => dependentID;
String? get birthDate => dob;
String? get employeeName => depedentName;
String? get dependentName => depedentName;
GetMobileLoginInfoDependentModel.fromJson(Map<String, dynamic> json) {
iD = json['ID'];
dependentID = (json['DependentID'] ??
json['DEPENDENT_ID'] ??
json['P_DEP_NATIONAL_ID'] ??
json['NationalID'] ??
json['NationalId'] ??
json['EmployeeID'] ??
json['UserName'])
?.toString();
depedentName = (json['DepedentName'] ??
json['DependentName'] ??
json['P_DEPENDENT_NAME'] ??
json['EmployeeName'])
?.toString();
dob = (json['DOB'] ??
json['BirthDate'] ??
json['DateOfBirth'] ??
json['P_DEP_BIRTH_DATE'] ??
json['P_BIRTH_DATE'] ??
json['Birth_Date'])
?.toString();
channelID = json['ChannelID'] != null ? int.tryParse(json['ChannelID'].toString()) : null;
companyID = json['CompanyID'] != null ? int.tryParse(json['CompanyID'].toString()) : null;
deviceType = json['DeviceType']?.toString();
deviceToken = json['DeviceToken']?.toString();
language = json['Language'] != null ? int.tryParse(json['Language'].toString()) : null;
gender = json['Gender'] != null ? int.tryParse(json['Gender'].toString()) : null;
loginType = json['LoginType'] != null ? int.tryParse(json['LoginType'].toString()) : null;
createdOn = json['CreatedOn']?.toString();
editedOn = json['EditedOn']?.toString();
businessCardPrivilege = json['BusinessCardPrivilege'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = <String, dynamic>{};
data['ID'] = iD;
data['DependentID'] = dependentID;
data['DepedentName'] = depedentName;
data['DOB'] = dob;
data['ChannelID'] = channelID;
data['CompanyID'] = companyID;
data['DeviceType'] = deviceType;
data['DeviceToken'] = deviceToken;
data['Language'] = language;
data['Gender'] = gender;
data['LoginType'] = loginType;
data['CreatedOn'] = createdOn;
data['EditedOn'] = editedOn;
data['BusinessCardPrivilege'] = businessCardPrivilege;
return data;
}
}