diff --git a/recipients_app/lib/data/models/payment/social_income_payment.dart b/recipients_app/lib/data/models/payment/social_income_payment.dart index f55ef10de..e76d29bf9 100644 --- a/recipients_app/lib/data/models/payment/social_income_payment.dart +++ b/recipients_app/lib/data/models/payment/social_income_payment.dart @@ -21,9 +21,6 @@ class SocialIncomePayment extends Equatable { @JsonKey(name: "last_updated_by") final String? updatedBy; - @JsonKey(name: "last_updated_at") - final Timestamp? updatedAt; - const SocialIncomePayment({ required this.id, this.amount, @@ -32,7 +29,6 @@ class SocialIncomePayment extends Equatable { this.status, this.comments, this.updatedBy, - this.updatedAt, }); factory SocialIncomePayment.fromJson(Map json) => @@ -50,7 +46,6 @@ class SocialIncomePayment extends Equatable { status, comments, updatedBy, - updatedAt, ]; } @@ -62,7 +57,6 @@ class SocialIncomePayment extends Equatable { String? currency, PaymentStatus? status, String? updatedBy, - Timestamp? updatedAt, }) { return SocialIncomePayment( id: id ?? this.id, @@ -72,7 +66,6 @@ class SocialIncomePayment extends Equatable { currency: currency ?? this.currency, status: status ?? this.status, updatedBy: updatedBy ?? this.updatedBy, - updatedAt: updatedAt ?? this.updatedAt, ); } } diff --git a/recipients_app/lib/data/models/payment/social_income_payment.g.dart b/recipients_app/lib/data/models/payment/social_income_payment.g.dart index 9543a2465..92864bae7 100644 --- a/recipients_app/lib/data/models/payment/social_income_payment.g.dart +++ b/recipients_app/lib/data/models/payment/social_income_payment.g.dart @@ -16,8 +16,6 @@ SocialIncomePayment _$SocialIncomePaymentFromJson(Map json) => status: $enumDecodeNullable(_$PaymentStatusEnumMap, json['status']), comments: json['comments'] as String?, updatedBy: json['last_updated_by'] as String?, - updatedAt: _$JsonConverterFromJson( - json['last_updated_at'], const TimestampConverter().fromJson), ); Map _$SocialIncomePaymentToJson( @@ -30,8 +28,6 @@ Map _$SocialIncomePaymentToJson( 'status': _$PaymentStatusEnumMap[instance.status], 'comments': instance.comments, 'last_updated_by': instance.updatedBy, - 'last_updated_at': _$JsonConverterToJson( - instance.updatedAt, const TimestampConverter().toJson), }; Value? _$JsonConverterFromJson( diff --git a/recipients_app/lib/data/repositories/payment_repository.dart b/recipients_app/lib/data/repositories/payment_repository.dart index cb9df8509..b080fafba 100644 --- a/recipients_app/lib/data/repositories/payment_repository.dart +++ b/recipients_app/lib/data/repositories/payment_repository.dart @@ -3,7 +3,6 @@ import "package:app/data/repositories/repositories.dart"; import "package:cloud_firestore/cloud_firestore.dart"; const String paymentCollection = "payments"; -const String kUpdatedByAppUser = "app user"; class PaymentRepository { final FirebaseFirestore firestore; @@ -46,7 +45,6 @@ class PaymentRepository { final updatedPayment = payment.copyWith( status: PaymentStatus.confirmed, updatedBy: "${recipient.userId}", - updatedAt: Timestamp.now(), ); await firestore @@ -66,7 +64,6 @@ class PaymentRepository { status: PaymentStatus.contested, comments: contestReason, updatedBy: "${recipient.userId}", - updatedAt: Timestamp.now(), ); await firestore diff --git a/recipients_app/lib/data/repositories/user_repository.dart b/recipients_app/lib/data/repositories/user_repository.dart index 7fe6bfb6f..6b81c7bea 100644 --- a/recipients_app/lib/data/repositories/user_repository.dart +++ b/recipients_app/lib/data/repositories/user_repository.dart @@ -85,7 +85,7 @@ class UserRepository { firebaseAuth.signInWithCredential(credentials); Future updateRecipient(Recipient recipient) async { - final updatedRecipient = recipient.copyWith(updatedBy: kUpdatedByAppUser); + final updatedRecipient = recipient.copyWith(updatedBy: "${recipient.userId}"); return firestore .collection(recipientCollection)