fix(notifications): rename geofenceAlert.id to geofenceId to match backend payload

This commit is contained in:
2026-05-13 22:35:05 -05:00
parent cbf40411a3
commit f0ff6deffa
5 changed files with 50 additions and 47 deletions

View File

@@ -38,7 +38,7 @@ abstract class NotificationItemDto with _$NotificationItemDto {
@freezed
abstract class NotificationGeofenceDto with _$NotificationGeofenceDto {
const factory NotificationGeofenceDto({
required String id,
required String geofenceId,
required String name,
}) = _AlertGeofenceDto;
@@ -57,7 +57,7 @@ extension NotificationsResponseDtoMapper on NotificationsResponseDto {
type: item.type,
geofenceAlert: item.geofenceAlert != null
? GeofenceAlertEntity(
id: item.geofenceAlert!.id,
geofenceId: item.geofenceAlert!.geofenceId,
name: item.geofenceAlert!.name,
)
: null,

View File

@@ -622,7 +622,7 @@ NotificationGeofenceDto _$NotificationGeofenceDtoFromJson(
/// @nodoc
mixin _$NotificationGeofenceDto {
String get id; String get name;
String get geofenceId; String get name;
/// Create a copy of NotificationGeofenceDto
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -635,16 +635,16 @@ $NotificationGeofenceDtoCopyWith<NotificationGeofenceDto> get copyWith => _$Noti
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is NotificationGeofenceDto&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name));
return identical(this, other) || (other.runtimeType == runtimeType&&other is NotificationGeofenceDto&&(identical(other.geofenceId, geofenceId) || other.geofenceId == geofenceId)&&(identical(other.name, name) || other.name == name));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,name);
int get hashCode => Object.hash(runtimeType,geofenceId,name);
@override
String toString() {
return 'NotificationGeofenceDto(id: $id, name: $name)';
return 'NotificationGeofenceDto(geofenceId: $geofenceId, name: $name)';
}
@@ -655,7 +655,7 @@ abstract mixin class $NotificationGeofenceDtoCopyWith<$Res> {
factory $NotificationGeofenceDtoCopyWith(NotificationGeofenceDto value, $Res Function(NotificationGeofenceDto) _then) = _$NotificationGeofenceDtoCopyWithImpl;
@useResult
$Res call({
String id, String name
String geofenceId, String name
});
@@ -672,9 +672,9 @@ class _$NotificationGeofenceDtoCopyWithImpl<$Res>
/// Create a copy of NotificationGeofenceDto
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? geofenceId = null,Object? name = null,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
geofenceId: null == geofenceId ? _self.geofenceId : geofenceId // ignore: cast_nullable_to_non_nullable
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,
));
@@ -761,10 +761,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String name)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String geofenceId, String name)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _AlertGeofenceDto() when $default != null:
return $default(_that.id,_that.name);case _:
return $default(_that.geofenceId,_that.name);case _:
return orElse();
}
@@ -782,10 +782,10 @@ return $default(_that.id,_that.name);case _:
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String name) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String geofenceId, String name) $default,) {final _that = this;
switch (_that) {
case _AlertGeofenceDto():
return $default(_that.id,_that.name);case _:
return $default(_that.geofenceId,_that.name);case _:
throw StateError('Unexpected subclass');
}
@@ -802,10 +802,10 @@ return $default(_that.id,_that.name);case _:
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String name)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String geofenceId, String name)? $default,) {final _that = this;
switch (_that) {
case _AlertGeofenceDto() when $default != null:
return $default(_that.id,_that.name);case _:
return $default(_that.geofenceId,_that.name);case _:
return null;
}
@@ -817,10 +817,10 @@ return $default(_that.id,_that.name);case _:
@JsonSerializable()
class _AlertGeofenceDto implements NotificationGeofenceDto {
const _AlertGeofenceDto({required this.id, required this.name});
const _AlertGeofenceDto({required this.geofenceId, required this.name});
factory _AlertGeofenceDto.fromJson(Map<String, dynamic> json) => _$AlertGeofenceDtoFromJson(json);
@override final String id;
@override final String geofenceId;
@override final String name;
/// Create a copy of NotificationGeofenceDto
@@ -836,16 +836,16 @@ Map<String, dynamic> toJson() {
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _AlertGeofenceDto&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _AlertGeofenceDto&&(identical(other.geofenceId, geofenceId) || other.geofenceId == geofenceId)&&(identical(other.name, name) || other.name == name));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,name);
int get hashCode => Object.hash(runtimeType,geofenceId,name);
@override
String toString() {
return 'NotificationGeofenceDto(id: $id, name: $name)';
return 'NotificationGeofenceDto(geofenceId: $geofenceId, name: $name)';
}
@@ -856,7 +856,7 @@ abstract mixin class _$AlertGeofenceDtoCopyWith<$Res> implements $NotificationGe
factory _$AlertGeofenceDtoCopyWith(_AlertGeofenceDto value, $Res Function(_AlertGeofenceDto) _then) = __$AlertGeofenceDtoCopyWithImpl;
@override @useResult
$Res call({
String id, String name
String geofenceId, String name
});
@@ -873,9 +873,9 @@ class __$AlertGeofenceDtoCopyWithImpl<$Res>
/// Create a copy of NotificationGeofenceDto
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? geofenceId = null,Object? name = null,}) {
return _then(_AlertGeofenceDto(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
geofenceId: null == geofenceId ? _self.geofenceId : geofenceId // ignore: cast_nullable_to_non_nullable
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,
));

View File

@@ -57,7 +57,10 @@ Map<String, dynamic> _$AlertItemDtoToJson(_AlertItemDto instance) =>
};
_AlertGeofenceDto _$AlertGeofenceDtoFromJson(Map<String, dynamic> json) =>
_AlertGeofenceDto(id: json['id'] as String, name: json['name'] as String);
_AlertGeofenceDto(
geofenceId: json['geofenceId'] as String,
name: json['name'] as String,
);
Map<String, dynamic> _$AlertGeofenceDtoToJson(_AlertGeofenceDto instance) =>
<String, dynamic>{'id': instance.id, 'name': instance.name};
<String, dynamic>{'geofenceId': instance.geofenceId, 'name': instance.name};

View File

@@ -19,7 +19,7 @@ abstract class NotificationEntity with _$NotificationEntity {
@freezed
abstract class GeofenceAlertEntity with _$GeofenceAlertEntity {
const factory GeofenceAlertEntity({
required String id,
required String geofenceId,
required String name,
}) = _GeofenceAlertEntity;
}

View File

@@ -316,7 +316,7 @@ $GeofenceAlertEntityCopyWith<$Res>? get geofenceAlert {
/// @nodoc
mixin _$GeofenceAlertEntity {
String get id; String get name;
String get geofenceId; String get name;
/// Create a copy of GeofenceAlertEntity
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -327,16 +327,16 @@ $GeofenceAlertEntityCopyWith<GeofenceAlertEntity> get copyWith => _$GeofenceAler
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is GeofenceAlertEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name));
return identical(this, other) || (other.runtimeType == runtimeType&&other is GeofenceAlertEntity&&(identical(other.geofenceId, geofenceId) || other.geofenceId == geofenceId)&&(identical(other.name, name) || other.name == name));
}
@override
int get hashCode => Object.hash(runtimeType,id,name);
int get hashCode => Object.hash(runtimeType,geofenceId,name);
@override
String toString() {
return 'GeofenceAlertEntity(id: $id, name: $name)';
return 'GeofenceAlertEntity(geofenceId: $geofenceId, name: $name)';
}
@@ -347,7 +347,7 @@ abstract mixin class $GeofenceAlertEntityCopyWith<$Res> {
factory $GeofenceAlertEntityCopyWith(GeofenceAlertEntity value, $Res Function(GeofenceAlertEntity) _then) = _$GeofenceAlertEntityCopyWithImpl;
@useResult
$Res call({
String id, String name
String geofenceId, String name
});
@@ -364,9 +364,9 @@ class _$GeofenceAlertEntityCopyWithImpl<$Res>
/// Create a copy of GeofenceAlertEntity
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? geofenceId = null,Object? name = null,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
geofenceId: null == geofenceId ? _self.geofenceId : geofenceId // ignore: cast_nullable_to_non_nullable
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,
));
@@ -453,10 +453,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String name)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String geofenceId, String name)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _GeofenceAlertEntity() when $default != null:
return $default(_that.id,_that.name);case _:
return $default(_that.geofenceId,_that.name);case _:
return orElse();
}
@@ -474,10 +474,10 @@ return $default(_that.id,_that.name);case _:
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String name) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String geofenceId, String name) $default,) {final _that = this;
switch (_that) {
case _GeofenceAlertEntity():
return $default(_that.id,_that.name);case _:
return $default(_that.geofenceId,_that.name);case _:
throw StateError('Unexpected subclass');
}
@@ -494,10 +494,10 @@ return $default(_that.id,_that.name);case _:
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String name)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String geofenceId, String name)? $default,) {final _that = this;
switch (_that) {
case _GeofenceAlertEntity() when $default != null:
return $default(_that.id,_that.name);case _:
return $default(_that.geofenceId,_that.name);case _:
return null;
}
@@ -509,10 +509,10 @@ return $default(_that.id,_that.name);case _:
class _GeofenceAlertEntity implements GeofenceAlertEntity {
const _GeofenceAlertEntity({required this.id, required this.name});
const _GeofenceAlertEntity({required this.geofenceId, required this.name});
@override final String id;
@override final String geofenceId;
@override final String name;
/// Create a copy of GeofenceAlertEntity
@@ -525,16 +525,16 @@ _$GeofenceAlertEntityCopyWith<_GeofenceAlertEntity> get copyWith => __$GeofenceA
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _GeofenceAlertEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _GeofenceAlertEntity&&(identical(other.geofenceId, geofenceId) || other.geofenceId == geofenceId)&&(identical(other.name, name) || other.name == name));
}
@override
int get hashCode => Object.hash(runtimeType,id,name);
int get hashCode => Object.hash(runtimeType,geofenceId,name);
@override
String toString() {
return 'GeofenceAlertEntity(id: $id, name: $name)';
return 'GeofenceAlertEntity(geofenceId: $geofenceId, name: $name)';
}
@@ -545,7 +545,7 @@ abstract mixin class _$GeofenceAlertEntityCopyWith<$Res> implements $GeofenceAle
factory _$GeofenceAlertEntityCopyWith(_GeofenceAlertEntity value, $Res Function(_GeofenceAlertEntity) _then) = __$GeofenceAlertEntityCopyWithImpl;
@override @useResult
$Res call({
String id, String name
String geofenceId, String name
});
@@ -562,9 +562,9 @@ class __$GeofenceAlertEntityCopyWithImpl<$Res>
/// Create a copy of GeofenceAlertEntity
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? geofenceId = null,Object? name = null,}) {
return _then(_GeofenceAlertEntity(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
geofenceId: null == geofenceId ? _self.geofenceId : geofenceId // ignore: cast_nullable_to_non_nullable
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,
));