feedback response model changes

This commit is contained in:
amirrezaghabeli
2025-09-25 09:01:10 +03:30
parent 9a0a74af97
commit eee1d9cdd8
4 changed files with 77 additions and 38 deletions
@@ -2,6 +2,8 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import '../tender_data/tender_data.dart';
part 'feedback_data.freezed.dart';
part 'feedback_data.g.dart';
@@ -13,7 +15,8 @@ abstract class FeedbackData with _$FeedbackData {
@JsonKey(name: 'customer_id') required String? customerId,
@JsonKey(name: 'feedback_type') required String? feedbackType,
@JsonKey(name: 'id') required String? id,
@JsonKey(name: 'tender') required String? tender,
@JsonKey(name: 'tender_id') required String? tenderId,
@JsonKey(name: 'tender') required TenderData? tender,
@JsonKey(name: 'updated_at') required int? updatedAt,
}) = _FeedbackData;
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$FeedbackData {
@JsonKey(name: 'company_id') String? get companyId;@JsonKey(name: 'created_at') int? get createdAt;@JsonKey(name: 'customer_id') String? get customerId;@JsonKey(name: 'feedback_type') String? get feedbackType;@JsonKey(name: 'id') String? get id;@JsonKey(name: 'tender') String? get tender;@JsonKey(name: 'updated_at') int? get updatedAt;
@JsonKey(name: 'company_id') String? get companyId;@JsonKey(name: 'created_at') int? get createdAt;@JsonKey(name: 'customer_id') String? get customerId;@JsonKey(name: 'feedback_type') String? get feedbackType;@JsonKey(name: 'id') String? get id;@JsonKey(name: 'tender_id') String? get tenderId;@JsonKey(name: 'tender') TenderData? get tender;@JsonKey(name: 'updated_at') int? get updatedAt;
/// Create a copy of FeedbackData
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -28,16 +28,16 @@ $FeedbackDataCopyWith<FeedbackData> get copyWith => _$FeedbackDataCopyWithImpl<F
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is FeedbackData&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.customerId, customerId) || other.customerId == customerId)&&(identical(other.feedbackType, feedbackType) || other.feedbackType == feedbackType)&&(identical(other.id, id) || other.id == id)&&(identical(other.tender, tender) || other.tender == tender)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
return identical(this, other) || (other.runtimeType == runtimeType&&other is FeedbackData&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.customerId, customerId) || other.customerId == customerId)&&(identical(other.feedbackType, feedbackType) || other.feedbackType == feedbackType)&&(identical(other.id, id) || other.id == id)&&(identical(other.tenderId, tenderId) || other.tenderId == tenderId)&&(identical(other.tender, tender) || other.tender == tender)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,companyId,createdAt,customerId,feedbackType,id,tender,updatedAt);
int get hashCode => Object.hash(runtimeType,companyId,createdAt,customerId,feedbackType,id,tenderId,tender,updatedAt);
@override
String toString() {
return 'FeedbackData(companyId: $companyId, createdAt: $createdAt, customerId: $customerId, feedbackType: $feedbackType, id: $id, tender: $tender, updatedAt: $updatedAt)';
return 'FeedbackData(companyId: $companyId, createdAt: $createdAt, customerId: $customerId, feedbackType: $feedbackType, id: $id, tenderId: $tenderId, tender: $tender, updatedAt: $updatedAt)';
}
@@ -48,11 +48,11 @@ abstract mixin class $FeedbackDataCopyWith<$Res> {
factory $FeedbackDataCopyWith(FeedbackData value, $Res Function(FeedbackData) _then) = _$FeedbackDataCopyWithImpl;
@useResult
$Res call({
@JsonKey(name: 'company_id') String? companyId,@JsonKey(name: 'created_at') int? createdAt,@JsonKey(name: 'customer_id') String? customerId,@JsonKey(name: 'feedback_type') String? feedbackType,@JsonKey(name: 'id') String? id,@JsonKey(name: 'tender') String? tender,@JsonKey(name: 'updated_at') int? updatedAt
@JsonKey(name: 'company_id') String? companyId,@JsonKey(name: 'created_at') int? createdAt,@JsonKey(name: 'customer_id') String? customerId,@JsonKey(name: 'feedback_type') String? feedbackType,@JsonKey(name: 'id') String? id,@JsonKey(name: 'tender_id') String? tenderId,@JsonKey(name: 'tender') TenderData? tender,@JsonKey(name: 'updated_at') int? updatedAt
});
$TenderDataCopyWith<$Res>? get tender;
}
/// @nodoc
@@ -65,19 +65,32 @@ class _$FeedbackDataCopyWithImpl<$Res>
/// Create a copy of FeedbackData
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? companyId = freezed,Object? createdAt = freezed,Object? customerId = freezed,Object? feedbackType = freezed,Object? id = freezed,Object? tender = freezed,Object? updatedAt = freezed,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? companyId = freezed,Object? createdAt = freezed,Object? customerId = freezed,Object? feedbackType = freezed,Object? id = freezed,Object? tenderId = freezed,Object? tender = freezed,Object? updatedAt = freezed,}) {
return _then(_self.copyWith(
companyId: freezed == companyId ? _self.companyId : companyId // ignore: cast_nullable_to_non_nullable
as String?,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as int?,customerId: freezed == customerId ? _self.customerId : customerId // ignore: cast_nullable_to_non_nullable
as String?,feedbackType: freezed == feedbackType ? _self.feedbackType : feedbackType // ignore: cast_nullable_to_non_nullable
as String?,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String?,tenderId: freezed == tenderId ? _self.tenderId : tenderId // ignore: cast_nullable_to_non_nullable
as String?,tender: freezed == tender ? _self.tender : tender // ignore: cast_nullable_to_non_nullable
as String?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
as TenderData?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
as int?,
));
}
/// Create a copy of FeedbackData
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$TenderDataCopyWith<$Res>? get tender {
if (_self.tender == null) {
return null;
}
return $TenderDataCopyWith<$Res>(_self.tender!, (value) {
return _then(_self.copyWith(tender: value));
});
}
}
@@ -159,10 +172,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function(@JsonKey(name: 'company_id') String? companyId, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'customer_id') String? customerId, @JsonKey(name: 'feedback_type') String? feedbackType, @JsonKey(name: 'id') String? id, @JsonKey(name: 'tender') String? tender, @JsonKey(name: 'updated_at') int? updatedAt)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function(@JsonKey(name: 'company_id') String? companyId, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'customer_id') String? customerId, @JsonKey(name: 'feedback_type') String? feedbackType, @JsonKey(name: 'id') String? id, @JsonKey(name: 'tender_id') String? tenderId, @JsonKey(name: 'tender') TenderData? tender, @JsonKey(name: 'updated_at') int? updatedAt)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _FeedbackData() when $default != null:
return $default(_that.companyId,_that.createdAt,_that.customerId,_that.feedbackType,_that.id,_that.tender,_that.updatedAt);case _:
return $default(_that.companyId,_that.createdAt,_that.customerId,_that.feedbackType,_that.id,_that.tenderId,_that.tender,_that.updatedAt);case _:
return orElse();
}
@@ -180,10 +193,10 @@ return $default(_that.companyId,_that.createdAt,_that.customerId,_that.feedbackT
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function(@JsonKey(name: 'company_id') String? companyId, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'customer_id') String? customerId, @JsonKey(name: 'feedback_type') String? feedbackType, @JsonKey(name: 'id') String? id, @JsonKey(name: 'tender') String? tender, @JsonKey(name: 'updated_at') int? updatedAt) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function(@JsonKey(name: 'company_id') String? companyId, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'customer_id') String? customerId, @JsonKey(name: 'feedback_type') String? feedbackType, @JsonKey(name: 'id') String? id, @JsonKey(name: 'tender_id') String? tenderId, @JsonKey(name: 'tender') TenderData? tender, @JsonKey(name: 'updated_at') int? updatedAt) $default,) {final _that = this;
switch (_that) {
case _FeedbackData():
return $default(_that.companyId,_that.createdAt,_that.customerId,_that.feedbackType,_that.id,_that.tender,_that.updatedAt);case _:
return $default(_that.companyId,_that.createdAt,_that.customerId,_that.feedbackType,_that.id,_that.tenderId,_that.tender,_that.updatedAt);case _:
throw StateError('Unexpected subclass');
}
@@ -200,10 +213,10 @@ return $default(_that.companyId,_that.createdAt,_that.customerId,_that.feedbackT
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function(@JsonKey(name: 'company_id') String? companyId, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'customer_id') String? customerId, @JsonKey(name: 'feedback_type') String? feedbackType, @JsonKey(name: 'id') String? id, @JsonKey(name: 'tender') String? tender, @JsonKey(name: 'updated_at') int? updatedAt)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function(@JsonKey(name: 'company_id') String? companyId, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'customer_id') String? customerId, @JsonKey(name: 'feedback_type') String? feedbackType, @JsonKey(name: 'id') String? id, @JsonKey(name: 'tender_id') String? tenderId, @JsonKey(name: 'tender') TenderData? tender, @JsonKey(name: 'updated_at') int? updatedAt)? $default,) {final _that = this;
switch (_that) {
case _FeedbackData() when $default != null:
return $default(_that.companyId,_that.createdAt,_that.customerId,_that.feedbackType,_that.id,_that.tender,_that.updatedAt);case _:
return $default(_that.companyId,_that.createdAt,_that.customerId,_that.feedbackType,_that.id,_that.tenderId,_that.tender,_that.updatedAt);case _:
return null;
}
@@ -215,7 +228,7 @@ return $default(_that.companyId,_that.createdAt,_that.customerId,_that.feedbackT
@JsonSerializable()
class _FeedbackData implements FeedbackData {
const _FeedbackData({@JsonKey(name: 'company_id') required this.companyId, @JsonKey(name: 'created_at') required this.createdAt, @JsonKey(name: 'customer_id') required this.customerId, @JsonKey(name: 'feedback_type') required this.feedbackType, @JsonKey(name: 'id') required this.id, @JsonKey(name: 'tender') required this.tender, @JsonKey(name: 'updated_at') required this.updatedAt});
const _FeedbackData({@JsonKey(name: 'company_id') required this.companyId, @JsonKey(name: 'created_at') required this.createdAt, @JsonKey(name: 'customer_id') required this.customerId, @JsonKey(name: 'feedback_type') required this.feedbackType, @JsonKey(name: 'id') required this.id, @JsonKey(name: 'tender_id') required this.tenderId, @JsonKey(name: 'tender') required this.tender, @JsonKey(name: 'updated_at') required this.updatedAt});
factory _FeedbackData.fromJson(Map<String, dynamic> json) => _$FeedbackDataFromJson(json);
@override@JsonKey(name: 'company_id') final String? companyId;
@@ -223,7 +236,8 @@ class _FeedbackData implements FeedbackData {
@override@JsonKey(name: 'customer_id') final String? customerId;
@override@JsonKey(name: 'feedback_type') final String? feedbackType;
@override@JsonKey(name: 'id') final String? id;
@override@JsonKey(name: 'tender') final String? tender;
@override@JsonKey(name: 'tender_id') final String? tenderId;
@override@JsonKey(name: 'tender') final TenderData? tender;
@override@JsonKey(name: 'updated_at') final int? updatedAt;
/// Create a copy of FeedbackData
@@ -239,16 +253,16 @@ Map<String, dynamic> toJson() {
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _FeedbackData&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.customerId, customerId) || other.customerId == customerId)&&(identical(other.feedbackType, feedbackType) || other.feedbackType == feedbackType)&&(identical(other.id, id) || other.id == id)&&(identical(other.tender, tender) || other.tender == tender)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _FeedbackData&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.customerId, customerId) || other.customerId == customerId)&&(identical(other.feedbackType, feedbackType) || other.feedbackType == feedbackType)&&(identical(other.id, id) || other.id == id)&&(identical(other.tenderId, tenderId) || other.tenderId == tenderId)&&(identical(other.tender, tender) || other.tender == tender)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,companyId,createdAt,customerId,feedbackType,id,tender,updatedAt);
int get hashCode => Object.hash(runtimeType,companyId,createdAt,customerId,feedbackType,id,tenderId,tender,updatedAt);
@override
String toString() {
return 'FeedbackData(companyId: $companyId, createdAt: $createdAt, customerId: $customerId, feedbackType: $feedbackType, id: $id, tender: $tender, updatedAt: $updatedAt)';
return 'FeedbackData(companyId: $companyId, createdAt: $createdAt, customerId: $customerId, feedbackType: $feedbackType, id: $id, tenderId: $tenderId, tender: $tender, updatedAt: $updatedAt)';
}
@@ -259,11 +273,11 @@ abstract mixin class _$FeedbackDataCopyWith<$Res> implements $FeedbackDataCopyWi
factory _$FeedbackDataCopyWith(_FeedbackData value, $Res Function(_FeedbackData) _then) = __$FeedbackDataCopyWithImpl;
@override @useResult
$Res call({
@JsonKey(name: 'company_id') String? companyId,@JsonKey(name: 'created_at') int? createdAt,@JsonKey(name: 'customer_id') String? customerId,@JsonKey(name: 'feedback_type') String? feedbackType,@JsonKey(name: 'id') String? id,@JsonKey(name: 'tender') String? tender,@JsonKey(name: 'updated_at') int? updatedAt
@JsonKey(name: 'company_id') String? companyId,@JsonKey(name: 'created_at') int? createdAt,@JsonKey(name: 'customer_id') String? customerId,@JsonKey(name: 'feedback_type') String? feedbackType,@JsonKey(name: 'id') String? id,@JsonKey(name: 'tender_id') String? tenderId,@JsonKey(name: 'tender') TenderData? tender,@JsonKey(name: 'updated_at') int? updatedAt
});
@override $TenderDataCopyWith<$Res>? get tender;
}
/// @nodoc
@@ -276,20 +290,33 @@ class __$FeedbackDataCopyWithImpl<$Res>
/// Create a copy of FeedbackData
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? companyId = freezed,Object? createdAt = freezed,Object? customerId = freezed,Object? feedbackType = freezed,Object? id = freezed,Object? tender = freezed,Object? updatedAt = freezed,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? companyId = freezed,Object? createdAt = freezed,Object? customerId = freezed,Object? feedbackType = freezed,Object? id = freezed,Object? tenderId = freezed,Object? tender = freezed,Object? updatedAt = freezed,}) {
return _then(_FeedbackData(
companyId: freezed == companyId ? _self.companyId : companyId // ignore: cast_nullable_to_non_nullable
as String?,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as int?,customerId: freezed == customerId ? _self.customerId : customerId // ignore: cast_nullable_to_non_nullable
as String?,feedbackType: freezed == feedbackType ? _self.feedbackType : feedbackType // ignore: cast_nullable_to_non_nullable
as String?,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String?,tenderId: freezed == tenderId ? _self.tenderId : tenderId // ignore: cast_nullable_to_non_nullable
as String?,tender: freezed == tender ? _self.tender : tender // ignore: cast_nullable_to_non_nullable
as String?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
as TenderData?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
as int?,
));
}
/// Create a copy of FeedbackData
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$TenderDataCopyWith<$Res>? get tender {
if (_self.tender == null) {
return null;
}
return $TenderDataCopyWith<$Res>(_self.tender!, (value) {
return _then(_self.copyWith(tender: value));
});
}
}
// dart format on
@@ -13,7 +13,11 @@ _FeedbackData _$FeedbackDataFromJson(Map<String, dynamic> json) =>
customerId: json['customer_id'] as String?,
feedbackType: json['feedback_type'] as String?,
id: json['id'] as String?,
tender: json['tender'] as String?,
tenderId: json['tender_id'] as String?,
tender:
json['tender'] == null
? null
: TenderData.fromJson(json['tender'] as Map<String, dynamic>),
updatedAt: (json['updated_at'] as num?)?.toInt(),
);
@@ -24,6 +28,7 @@ Map<String, dynamic> _$FeedbackDataToJson(_FeedbackData instance) =>
'customer_id': instance.customerId,
'feedback_type': instance.feedbackType,
'id': instance.id,
'tender_id': instance.tenderId,
'tender': instance.tender,
'updated_at': instance.updatedAt,
};