toJson method
Implementation
Map<String, dynamic> toJson() {
return {
'cellphone': cellphone,
'documentNumber': documentNumber,
'name': name,
'otherDocument': otherDocument,
'gender': gender != null ? EnumHelper.fromStringToInt(Gender.values, gender.toString()) : null,
'maritalStatus': maritalStatus != null ? EnumHelper.fromStringToInt(MaritalStatus.values, maritalStatus.toString()) : null,
'day': day,
'month': month,
'year': year,
'occupation': occupation,
'phones': phones?.map((phone) => phone.toJson()).toList(),
'emails': emails?.map((email) => email.toJson()).toList(),
'addresses': addresses?.map((address) => address.toJson()).toList(),
};
}