2023-02-08 08:06:27 +00:00
|
|
|
// To parse this JSON data, do
|
|
|
|
//
|
|
|
|
// final familyBackground = familyBackgroundFromJson(jsonString);
|
|
|
|
|
|
|
|
import 'dart:convert';
|
|
|
|
import 'dart:ffi';
|
|
|
|
|
2023-02-20 07:48:24 +00:00
|
|
|
import '../utils/category.dart';
|
|
|
|
import '../utils/position.dart';
|
|
|
|
|
2023-05-11 00:04:53 +00:00
|
|
|
FamilyBackground familyBackgroundFromJson(String str) =>
|
|
|
|
FamilyBackground.fromJson(json.decode(str));
|
2023-02-08 08:06:27 +00:00
|
|
|
|
2023-05-11 00:04:53 +00:00
|
|
|
String familyBackgroundToJson(FamilyBackground data) =>
|
|
|
|
json.encode(data.toJson());
|
2023-02-08 08:06:27 +00:00
|
|
|
|
|
|
|
class FamilyBackground {
|
2023-05-11 00:04:53 +00:00
|
|
|
FamilyBackground({
|
|
|
|
this.company,
|
|
|
|
this.position,
|
|
|
|
this.relationship,
|
|
|
|
this.relatedPerson,
|
|
|
|
this.companyAddress,
|
|
|
|
this.emergencyContact,
|
|
|
|
this.incaseOfEmergency,
|
|
|
|
this.companyContactNumber,
|
|
|
|
});
|
|
|
|
|
|
|
|
final Company? company;
|
2023-08-15 06:32:21 +00:00
|
|
|
final PositionTitle? position;
|
2023-05-11 00:04:53 +00:00
|
|
|
final Relationship? relationship;
|
|
|
|
final RelatedPerson? relatedPerson;
|
|
|
|
final String? companyAddress;
|
|
|
|
final List<EmergencyContact>? emergencyContact;
|
|
|
|
final bool? incaseOfEmergency;
|
|
|
|
final String? companyContactNumber;
|
|
|
|
|
|
|
|
factory FamilyBackground.fromJson(Map<String, dynamic> json) =>
|
|
|
|
FamilyBackground(
|
|
|
|
company:
|
|
|
|
json["company"] == null ? null : Company.fromJson(json["company"]),
|
|
|
|
position: json["position"] == null
|
|
|
|
? null
|
2023-08-15 06:32:21 +00:00
|
|
|
: PositionTitle.fromJson(json["position"]),
|
2023-05-11 00:04:53 +00:00
|
|
|
relationship: json["relationship"] == null
|
|
|
|
? null
|
|
|
|
: Relationship.fromJson(json["relationship"]),
|
|
|
|
relatedPerson: json["related_person"] == null
|
|
|
|
? null
|
|
|
|
: RelatedPerson.fromJson(json["related_person"]),
|
2023-02-08 08:06:27 +00:00
|
|
|
companyAddress: json["company_address"],
|
2023-05-11 00:04:53 +00:00
|
|
|
emergencyContact: json["emergency_contact"] == null
|
|
|
|
? []
|
|
|
|
: List<EmergencyContact>.from(json["emergency_contact"]!
|
|
|
|
.map((x) => EmergencyContact.fromJson(x))),
|
2023-02-08 08:06:27 +00:00
|
|
|
incaseOfEmergency: json["incase_of_emergency"],
|
|
|
|
companyContactNumber: json["company_contact_number"],
|
2023-05-11 00:04:53 +00:00
|
|
|
);
|
2023-02-08 08:06:27 +00:00
|
|
|
|
2023-05-11 00:04:53 +00:00
|
|
|
Map<String, dynamic> toJson() => {
|
2023-02-08 08:06:27 +00:00
|
|
|
"company": company?.toJson(),
|
|
|
|
"position": position?.toJson(),
|
|
|
|
"relationship": relationship?.toJson(),
|
|
|
|
"related_person": relatedPerson?.toJson(),
|
|
|
|
"company_address": companyAddress,
|
2023-05-11 00:04:53 +00:00
|
|
|
"emergency_contact": emergencyContact == null
|
|
|
|
? []
|
|
|
|
: List<dynamic>.from(emergencyContact!.map((x) => x.toJson())),
|
2023-02-08 08:06:27 +00:00
|
|
|
"incase_of_emergency": incaseOfEmergency,
|
|
|
|
"company_contact_number": companyContactNumber,
|
2023-05-11 00:04:53 +00:00
|
|
|
};
|
2023-02-08 08:06:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class Company {
|
2023-05-11 00:04:53 +00:00
|
|
|
Company({
|
|
|
|
this.id,
|
|
|
|
this.name,
|
|
|
|
this.category,
|
|
|
|
this.privateEntity,
|
|
|
|
});
|
|
|
|
|
|
|
|
final int? id;
|
|
|
|
final String? name;
|
|
|
|
final Category? category;
|
|
|
|
final bool? privateEntity;
|
|
|
|
|
|
|
|
factory Company.fromJson(Map<String, dynamic> json) => Company(
|
2023-02-08 08:06:27 +00:00
|
|
|
id: json["id"],
|
|
|
|
name: json["name"],
|
2023-05-11 00:04:53 +00:00
|
|
|
category: json["category"] == null
|
|
|
|
? null
|
|
|
|
: Category.fromJson(json["category"]),
|
2023-02-08 08:06:27 +00:00
|
|
|
privateEntity: json["private_entity"],
|
2023-05-11 00:04:53 +00:00
|
|
|
);
|
2023-02-08 08:06:27 +00:00
|
|
|
|
2023-05-11 00:04:53 +00:00
|
|
|
Map<String, dynamic> toJson() => {
|
2023-02-08 08:06:27 +00:00
|
|
|
"id": id,
|
|
|
|
"name": name,
|
|
|
|
"category": category?.toJson(),
|
|
|
|
"private_entity": privateEntity,
|
2023-05-11 00:04:53 +00:00
|
|
|
};
|
2023-02-08 08:06:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class EmergencyContact {
|
2023-05-11 00:04:53 +00:00
|
|
|
EmergencyContact({
|
|
|
|
this.telco,
|
|
|
|
this.isactive,
|
|
|
|
this.provider,
|
|
|
|
this.isprimary,
|
|
|
|
this.numbermail,
|
|
|
|
this.serviceType,
|
|
|
|
this.contactinfoid,
|
|
|
|
this.commServiceId,
|
|
|
|
});
|
|
|
|
|
|
|
|
final String? telco;
|
|
|
|
final bool? isactive;
|
|
|
|
final int? provider;
|
|
|
|
final bool? isprimary;
|
|
|
|
final String? numbermail;
|
|
|
|
final int? serviceType;
|
|
|
|
final int? contactinfoid;
|
|
|
|
final int? commServiceId;
|
|
|
|
|
|
|
|
factory EmergencyContact.fromJson(Map<String, dynamic> json) =>
|
|
|
|
EmergencyContact(
|
2023-02-08 08:06:27 +00:00
|
|
|
telco: json["telco"],
|
|
|
|
isactive: json["isactive"],
|
|
|
|
provider: json["provider"],
|
|
|
|
isprimary: json["isprimary"],
|
|
|
|
numbermail: json["numbermail"],
|
|
|
|
serviceType: json["service_type"],
|
|
|
|
contactinfoid: json["contactinfoid"],
|
|
|
|
commServiceId: json["comm_service_id"],
|
2023-05-11 00:04:53 +00:00
|
|
|
);
|
2023-02-08 08:06:27 +00:00
|
|
|
|
2023-05-11 00:04:53 +00:00
|
|
|
Map<String, dynamic> toJson() => {
|
2023-02-08 08:06:27 +00:00
|
|
|
"telco": telco,
|
|
|
|
"isactive": isactive,
|
|
|
|
"provider": provider,
|
|
|
|
"isprimary": isprimary,
|
|
|
|
"numbermail": numbermail,
|
|
|
|
"service_type": serviceType,
|
|
|
|
"contactinfoid": contactinfoid,
|
|
|
|
"comm_service_id": commServiceId,
|
2023-05-11 00:04:53 +00:00
|
|
|
};
|
2023-02-08 08:06:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class RelatedPerson {
|
2023-05-11 00:04:53 +00:00
|
|
|
RelatedPerson({
|
|
|
|
required this.id,
|
|
|
|
required this.gender,
|
|
|
|
required this.sex,
|
|
|
|
required this.deceased,
|
|
|
|
required this.heightM,
|
|
|
|
required this.birthdate,
|
|
|
|
required this.esigPath,
|
|
|
|
required this.lastName,
|
|
|
|
required this.weightKg,
|
|
|
|
required this.bloodType,
|
|
|
|
required this.firstName,
|
|
|
|
required this.photoPath,
|
|
|
|
required this.maidenName,
|
|
|
|
required this.middleName,
|
|
|
|
required this.uuidQrcode,
|
|
|
|
required this.civilStatus,
|
|
|
|
required this.titlePrefix,
|
|
|
|
required this.titleSuffix,
|
|
|
|
required this.showTitleId,
|
|
|
|
required this.nameExtension,
|
|
|
|
});
|
|
|
|
|
|
|
|
final int? id;
|
|
|
|
final String? sex;
|
|
|
|
final bool? deceased;
|
|
|
|
final String? gender;
|
|
|
|
final double? heightM;
|
|
|
|
final DateTime? birthdate;
|
|
|
|
final String? esigPath;
|
|
|
|
final String? lastName;
|
|
|
|
final double? weightKg;
|
|
|
|
final String? bloodType;
|
|
|
|
final String? firstName;
|
|
|
|
final String? photoPath;
|
|
|
|
final MaidenName? maidenName;
|
|
|
|
final String? middleName;
|
|
|
|
final String? uuidQrcode;
|
|
|
|
final String? civilStatus;
|
|
|
|
final String? titlePrefix;
|
|
|
|
final String? titleSuffix;
|
|
|
|
final bool? showTitleId;
|
|
|
|
final String? nameExtension;
|
|
|
|
|
|
|
|
factory RelatedPerson.fromJson(Map<String, dynamic> json) => RelatedPerson(
|
2023-02-08 08:06:27 +00:00
|
|
|
id: json["id"],
|
|
|
|
sex: json["sex"],
|
|
|
|
gender: json["gender"],
|
|
|
|
deceased: json["deceased"],
|
2023-05-11 00:04:53 +00:00
|
|
|
heightM: json["height_m"] == null
|
|
|
|
? null
|
|
|
|
: double.parse(json["height_m"].toString()),
|
|
|
|
birthdate: json["birthdate"] == null
|
|
|
|
? null
|
|
|
|
: DateTime.parse(json["birthdate"]),
|
2023-02-08 08:06:27 +00:00
|
|
|
esigPath: json["esig_path"],
|
|
|
|
lastName: json["last_name"],
|
2023-05-11 00:04:53 +00:00
|
|
|
weightKg: json["weight_kg"] == null
|
|
|
|
? null
|
|
|
|
: double.parse(json["weight_kg"].toString()),
|
2023-02-08 08:06:27 +00:00
|
|
|
bloodType: json["blood_type"],
|
|
|
|
firstName: json["first_name"],
|
|
|
|
photoPath: json["photo_path"],
|
2023-05-11 00:04:53 +00:00
|
|
|
maidenName: json["maiden_name"] == null
|
|
|
|
? null
|
|
|
|
: MaidenName.fromJson(json['maiden_name']),
|
2023-02-08 08:06:27 +00:00
|
|
|
middleName: json["middle_name"],
|
|
|
|
uuidQrcode: json["uuid_qrcode"],
|
|
|
|
civilStatus: json["civil_status"],
|
|
|
|
titlePrefix: json["title_prefix"],
|
|
|
|
titleSuffix: json["title_suffix"],
|
|
|
|
showTitleId: json["show_title_id"],
|
|
|
|
nameExtension: json["name_extension"],
|
2023-05-11 00:04:53 +00:00
|
|
|
);
|
2023-02-08 08:06:27 +00:00
|
|
|
|
2023-05-11 00:04:53 +00:00
|
|
|
Map<String, dynamic> toJson() => {
|
2023-02-08 08:06:27 +00:00
|
|
|
"id": id,
|
|
|
|
"sex": sex,
|
|
|
|
"gender": gender,
|
|
|
|
"deceased": deceased,
|
|
|
|
"height_m": heightM,
|
2023-05-11 00:04:53 +00:00
|
|
|
"birthdate":
|
|
|
|
"${birthdate!.year.toString().padLeft(4, '0')}-${birthdate!.month.toString().padLeft(2, '0')}-${birthdate!.day.toString().padLeft(2, '0')}",
|
2023-02-08 08:06:27 +00:00
|
|
|
"esig_path": esigPath,
|
|
|
|
"last_name": lastName,
|
|
|
|
"weight_kg": weightKg,
|
|
|
|
"blood_type": bloodType,
|
|
|
|
"first_name": firstName,
|
|
|
|
"photo_path": photoPath,
|
|
|
|
"maiden_name": maidenName,
|
|
|
|
"middle_name": middleName,
|
|
|
|
"uuid_qrcode": uuidQrcode,
|
|
|
|
"civil_status": civilStatus,
|
|
|
|
"title_prefix": titlePrefix,
|
|
|
|
"title_suffix": titleSuffix,
|
|
|
|
"show_title_id": showTitleId,
|
|
|
|
"name_extension": nameExtension,
|
2023-05-11 00:04:53 +00:00
|
|
|
};
|
2023-02-08 08:06:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class Relationship {
|
2023-05-11 00:04:53 +00:00
|
|
|
Relationship({
|
|
|
|
this.id,
|
|
|
|
this.type,
|
|
|
|
this.category,
|
|
|
|
});
|
2023-02-08 08:06:27 +00:00
|
|
|
|
2023-05-11 00:04:53 +00:00
|
|
|
final int? id;
|
|
|
|
final String? type;
|
|
|
|
final String? category;
|
2023-02-08 08:06:27 +00:00
|
|
|
|
2023-05-11 00:04:53 +00:00
|
|
|
factory Relationship.fromJson(Map<String, dynamic> json) => Relationship(
|
2023-02-08 08:06:27 +00:00
|
|
|
id: json["id"],
|
|
|
|
type: json["type"],
|
|
|
|
category: json["category"],
|
2023-05-11 00:04:53 +00:00
|
|
|
);
|
2023-02-08 08:06:27 +00:00
|
|
|
|
2023-05-11 00:04:53 +00:00
|
|
|
Map<String, dynamic> toJson() => {
|
2023-02-08 08:06:27 +00:00
|
|
|
"id": id,
|
|
|
|
"type": type,
|
|
|
|
"category": category,
|
2023-05-11 00:04:53 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
class MaidenName {
|
2023-06-06 06:54:51 +00:00
|
|
|
final String? lastName;
|
|
|
|
final String? middleName;
|
2023-05-11 00:04:53 +00:00
|
|
|
|
|
|
|
MaidenName({
|
|
|
|
required this.lastName,
|
|
|
|
required this.middleName,
|
|
|
|
});
|
|
|
|
|
|
|
|
factory MaidenName.fromJson(Map<String, dynamic> json) => MaidenName(
|
|
|
|
lastName: json["last_name"],
|
|
|
|
middleName: json["middle_name"],
|
|
|
|
);
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
|
|
"last_name": lastName,
|
|
|
|
"middle_name": middleName,
|
|
|
|
};
|
2023-02-08 08:06:27 +00:00
|
|
|
}
|