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.
cloudsolutions-atoms/lib/models/service_request/call_site_contact_person.dart

68 lines
2.0 KiB
Dart

class CallSiteContactPerson {
CallSiteContactPerson({
this.id,
this.employeeCode = "", // Provide default value
this.name = "", // Provide default value
this.telephone = "", // Provide default value
this.job = "", // Provide default value
this.email = "", // Provide default value
this.land = "", // Provide default value
this.contactUserId = "", // Provide default value
});
CallSiteContactPerson.fromJson(Map<String, dynamic> json) {
// Specify Map type
id = json['id'];
employeeCode = json['employeeCode'] ?? ""; // Provide default value if null
name = json['name'] ?? ""; // Provide default value if null
telephone = json['telephone'] ?? ""; // Provide default value if null
job = json['job'] ?? ""; // Provide default value if null
email = json['email'] ?? ""; // Provide default value if null
land = json['land'] ?? ""; // Provide default value if null
contactUserId = json['contactUserId'] ?? ""; // Provide default value if null
}
num? id;
String? employeeCode;
String? name;
String? telephone;
String? job;
String? email;
String? land;
String? contactUserId;
CallSiteContactPerson copyWith({
num? id,
String? employeeCode,
String? name,
String? telephone,
String? job,
String? email,
String? land,
String? contactUserId,
}) =>
CallSiteContactPerson(
id: id ?? this.id,
employeeCode: employeeCode ?? this.employeeCode,
name: name ?? this.name,
telephone: telephone ?? this.telephone,
job: job ?? this.job,
email: email ?? this.email,
land: land ?? this.land,
contactUserId: contactUserId ?? this.contactUserId,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['employeeCode'] = employeeCode;
map['name'] = name;
map['telephone'] = telephone;
map['job'] = job;
map['email'] = email;
map['land'] = land;
map['contactUserId'] = contactUserId;
return map;
}
}