Fix activity dates

This commit is contained in:
Hillel Coren 2023-09-07 21:47:09 +03:00
parent dc0687f72c
commit c8094584c2
3 changed files with 33 additions and 2 deletions

View File

@ -730,6 +730,9 @@ abstract class ActivityEntity
@BuiltValueField(wireName: 'updated_at') @BuiltValueField(wireName: 'updated_at')
int get updatedAt; int get updatedAt;
@BuiltValueField(wireName: 'created_at')
int get createdAt;
@nullable @nullable
@BuiltValueField(wireName: 'expense_id') @BuiltValueField(wireName: 'expense_id')
String get expenseId; String get expenseId;
@ -970,6 +973,10 @@ abstract class ActivityEntity
return activity; return activity;
} }
// ignore: unused_element
static void _initializeBuilder(ActivityEntityBuilder builder) =>
builder..createdAt = 0;
static Serializer<ActivityEntity> get serializer => static Serializer<ActivityEntity> get serializer =>
_$activityEntitySerializer; _$activityEntitySerializer;
} }

View File

@ -529,6 +529,9 @@ class _$ActivityEntitySerializer
'updated_at', 'updated_at',
serializers.serialize(object.updatedAt, serializers.serialize(object.updatedAt,
specifiedType: const FullType(int)), specifiedType: const FullType(int)),
'created_at',
serializers.serialize(object.createdAt,
specifiedType: const FullType(int)),
]; ];
Object value; Object value;
value = object.clientId; value = object.clientId;
@ -724,6 +727,10 @@ class _$ActivityEntitySerializer
result.updatedAt = serializers.deserialize(value, result.updatedAt = serializers.deserialize(value,
specifiedType: const FullType(int)) as int; specifiedType: const FullType(int)) as int;
break; break;
case 'created_at':
result.createdAt = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case 'expense_id': case 'expense_id':
result.expenseId = serializers.deserialize(value, result.expenseId = serializers.deserialize(value,
specifiedType: const FullType(String)) as String; specifiedType: const FullType(String)) as String;
@ -1094,6 +1101,8 @@ class _$ActivityEntity extends ActivityEntity {
@override @override
final int updatedAt; final int updatedAt;
@override @override
final int createdAt;
@override
final String expenseId; final String expenseId;
@override @override
final bool isSystem; final bool isSystem;
@ -1131,6 +1140,7 @@ class _$ActivityEntity extends ActivityEntity {
this.paymentId, this.paymentId,
this.creditId, this.creditId,
this.updatedAt, this.updatedAt,
this.createdAt,
this.expenseId, this.expenseId,
this.isSystem, this.isSystem,
this.ip, this.ip,
@ -1149,6 +1159,8 @@ class _$ActivityEntity extends ActivityEntity {
BuiltValueNullFieldError.checkNotNull(userId, r'ActivityEntity', 'userId'); BuiltValueNullFieldError.checkNotNull(userId, r'ActivityEntity', 'userId');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
updatedAt, r'ActivityEntity', 'updatedAt'); updatedAt, r'ActivityEntity', 'updatedAt');
BuiltValueNullFieldError.checkNotNull(
createdAt, r'ActivityEntity', 'createdAt');
} }
@override @override
@ -1176,6 +1188,7 @@ class _$ActivityEntity extends ActivityEntity {
paymentId == other.paymentId && paymentId == other.paymentId &&
creditId == other.creditId && creditId == other.creditId &&
updatedAt == other.updatedAt && updatedAt == other.updatedAt &&
createdAt == other.createdAt &&
expenseId == other.expenseId && expenseId == other.expenseId &&
isSystem == other.isSystem && isSystem == other.isSystem &&
ip == other.ip && ip == other.ip &&
@ -1206,6 +1219,7 @@ class _$ActivityEntity extends ActivityEntity {
_$hash = $jc(_$hash, paymentId.hashCode); _$hash = $jc(_$hash, paymentId.hashCode);
_$hash = $jc(_$hash, creditId.hashCode); _$hash = $jc(_$hash, creditId.hashCode);
_$hash = $jc(_$hash, updatedAt.hashCode); _$hash = $jc(_$hash, updatedAt.hashCode);
_$hash = $jc(_$hash, createdAt.hashCode);
_$hash = $jc(_$hash, expenseId.hashCode); _$hash = $jc(_$hash, expenseId.hashCode);
_$hash = $jc(_$hash, isSystem.hashCode); _$hash = $jc(_$hash, isSystem.hashCode);
_$hash = $jc(_$hash, ip.hashCode); _$hash = $jc(_$hash, ip.hashCode);
@ -1236,6 +1250,7 @@ class _$ActivityEntity extends ActivityEntity {
..add('paymentId', paymentId) ..add('paymentId', paymentId)
..add('creditId', creditId) ..add('creditId', creditId)
..add('updatedAt', updatedAt) ..add('updatedAt', updatedAt)
..add('createdAt', createdAt)
..add('expenseId', expenseId) ..add('expenseId', expenseId)
..add('isSystem', isSystem) ..add('isSystem', isSystem)
..add('ip', ip) ..add('ip', ip)
@ -1310,6 +1325,10 @@ class ActivityEntityBuilder
int get updatedAt => _$this._updatedAt; int get updatedAt => _$this._updatedAt;
set updatedAt(int updatedAt) => _$this._updatedAt = updatedAt; set updatedAt(int updatedAt) => _$this._updatedAt = updatedAt;
int _createdAt;
int get createdAt => _$this._createdAt;
set createdAt(int createdAt) => _$this._createdAt = createdAt;
String _expenseId; String _expenseId;
String get expenseId => _$this._expenseId; String get expenseId => _$this._expenseId;
set expenseId(String expenseId) => _$this._expenseId = expenseId; set expenseId(String expenseId) => _$this._expenseId = expenseId;
@ -1352,7 +1371,9 @@ class ActivityEntityBuilder
_$this._history ??= new InvoiceHistoryEntityBuilder(); _$this._history ??= new InvoiceHistoryEntityBuilder();
set history(InvoiceHistoryEntityBuilder history) => _$this._history = history; set history(InvoiceHistoryEntityBuilder history) => _$this._history = history;
ActivityEntityBuilder(); ActivityEntityBuilder() {
ActivityEntity._initializeBuilder(this);
}
ActivityEntityBuilder get _$this { ActivityEntityBuilder get _$this {
final $v = _$v; final $v = _$v;
@ -1370,6 +1391,7 @@ class ActivityEntityBuilder
_paymentId = $v.paymentId; _paymentId = $v.paymentId;
_creditId = $v.creditId; _creditId = $v.creditId;
_updatedAt = $v.updatedAt; _updatedAt = $v.updatedAt;
_createdAt = $v.createdAt;
_expenseId = $v.expenseId; _expenseId = $v.expenseId;
_isSystem = $v.isSystem; _isSystem = $v.isSystem;
_ip = $v.ip; _ip = $v.ip;
@ -1422,6 +1444,8 @@ class ActivityEntityBuilder
creditId: creditId, creditId: creditId,
updatedAt: BuiltValueNullFieldError.checkNotNull( updatedAt: BuiltValueNullFieldError.checkNotNull(
updatedAt, r'ActivityEntity', 'updatedAt'), updatedAt, r'ActivityEntity', 'updatedAt'),
createdAt: BuiltValueNullFieldError.checkNotNull(
createdAt, r'ActivityEntity', 'createdAt'),
expenseId: expenseId, expenseId: expenseId,
isSystem: isSystem, isSystem: isSystem,
ip: ip, ip: ip,

View File

@ -142,7 +142,7 @@ class ActivityListTile extends StatelessWidget {
? localization.lookup(activity.notes).trim() + '\n' ? localization.lookup(activity.notes).trim() + '\n'
: '') + : '') +
formatDate( formatDate(
convertTimestampToDateString(activity.updatedAt), context, convertTimestampToDateString(activity.createdAt), context,
showTime: true, showSeconds: false) + showTime: true, showSeconds: false) +
((activity.ip ?? '').isNotEmpty ? '' + activity.ip : '')), ((activity.ip ?? '').isNotEmpty ? '' + activity.ip : '')),
), ),