From 63471eea85cec7279c15f27fedb2b39dc54d4eac Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:44:07 +0530 Subject: [PATCH] [mob] Add attributes for person email & userID --- mobile/lib/models/ml/face/person.dart | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mobile/lib/models/ml/face/person.dart b/mobile/lib/models/ml/face/person.dart index 2e5191c485..678c3117c1 100644 --- a/mobile/lib/models/ml/face/person.dart +++ b/mobile/lib/models/ml/face/person.dart @@ -53,6 +53,10 @@ class PersonData { List? assigned = List.empty(); List? rejected = List.empty(); final String? birthDate; + // email should be always looked via userID as user might have changed + // their email ids. + final String? email; + final int? userID; bool hasAvatar() => avatarFaceID != null; @@ -66,6 +70,8 @@ class PersonData { this.avatarFaceID, this.isHidden = false, this.birthDate, + this.email, + this.userID, }); // copyWith PersonData copyWith({ @@ -75,6 +81,8 @@ class PersonData { bool? isHidden, int? version, String? birthDate, + String? email, + int? userID, }) { return PersonData( name: name ?? this.name, @@ -82,6 +90,8 @@ class PersonData { avatarFaceID: avatarFaceId ?? this.avatarFaceID, isHidden: isHidden ?? this.isHidden, birthDate: birthDate ?? this.birthDate, + email: email ?? this.email, + userID: userID ?? this.userID, ); } @@ -112,6 +122,8 @@ class PersonData { 'avatarFaceID': avatarFaceID, 'isHidden': isHidden, 'birthDate': birthDate, + 'email': email, + 'userID': userID, }; // fromJson @@ -134,6 +146,8 @@ class PersonData { avatarFaceID: json['avatarFaceID'] as String?, isHidden: json['isHidden'] as bool? ?? false, birthDate: json['birthDate'] as String?, + userID: json['userID'] as int?, + email: json['email'] as String?, ); } }