diff --git a/lib/data/services/model/organization/organization.dart b/lib/data/services/model/organization/organization.dart new file mode 100644 index 0000000..4bda620 --- /dev/null +++ b/lib/data/services/model/organization/organization.dart @@ -0,0 +1,17 @@ +// ignore_for_file: invalid_annotation_target + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'organization.freezed.dart'; +part 'organization.g.dart'; + +@freezed +abstract class Organization with _$Organization { + const factory Organization({ + required String? name, + + }) = _Organization; + + factory Organization.fromJson(Map json) => + _$OrganizationFromJson(json); +} \ No newline at end of file diff --git a/lib/data/services/model/organization/organization.freezed.dart b/lib/data/services/model/organization/organization.freezed.dart new file mode 100644 index 0000000..d10198f --- /dev/null +++ b/lib/data/services/model/organization/organization.freezed.dart @@ -0,0 +1,277 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'organization.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$Organization { + + String? get name; +/// Create a copy of Organization +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$OrganizationCopyWith get copyWith => _$OrganizationCopyWithImpl(this as Organization, _$identity); + + /// Serializes this Organization to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Organization&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name); + +@override +String toString() { + return 'Organization(name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $OrganizationCopyWith<$Res> { + factory $OrganizationCopyWith(Organization value, $Res Function(Organization) _then) = _$OrganizationCopyWithImpl; +@useResult +$Res call({ + String? name +}); + + + + +} +/// @nodoc +class _$OrganizationCopyWithImpl<$Res> + implements $OrganizationCopyWith<$Res> { + _$OrganizationCopyWithImpl(this._self, this._then); + + final Organization _self; + final $Res Function(Organization) _then; + +/// Create a copy of Organization +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,}) { + return _then(_self.copyWith( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Organization]. +extension OrganizationPatterns on Organization { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Organization value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Organization() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Organization value) $default,){ +final _that = this; +switch (_that) { +case _Organization(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Organization value)? $default,){ +final _that = this; +switch (_that) { +case _Organization() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Organization() when $default != null: +return $default(_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? name) $default,) {final _that = this; +switch (_that) { +case _Organization(): +return $default(_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? name)? $default,) {final _that = this; +switch (_that) { +case _Organization() when $default != null: +return $default(_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _Organization implements Organization { + const _Organization({required this.name}); + factory _Organization.fromJson(Map json) => _$OrganizationFromJson(json); + +@override final String? name; + +/// Create a copy of Organization +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$OrganizationCopyWith<_Organization> get copyWith => __$OrganizationCopyWithImpl<_Organization>(this, _$identity); + +@override +Map toJson() { + return _$OrganizationToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Organization&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name); + +@override +String toString() { + return 'Organization(name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$OrganizationCopyWith<$Res> implements $OrganizationCopyWith<$Res> { + factory _$OrganizationCopyWith(_Organization value, $Res Function(_Organization) _then) = __$OrganizationCopyWithImpl; +@override @useResult +$Res call({ + String? name +}); + + + + +} +/// @nodoc +class __$OrganizationCopyWithImpl<$Res> + implements _$OrganizationCopyWith<$Res> { + __$OrganizationCopyWithImpl(this._self, this._then); + + final _Organization _self; + final $Res Function(_Organization) _then; + +/// Create a copy of Organization +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,}) { + return _then(_Organization( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/lib/data/services/model/organization/organization.g.dart b/lib/data/services/model/organization/organization.g.dart new file mode 100644 index 0000000..5464cf0 --- /dev/null +++ b/lib/data/services/model/organization/organization.g.dart @@ -0,0 +1,13 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'organization.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_Organization _$OrganizationFromJson(Map json) => + _Organization(name: json['name'] as String?); + +Map _$OrganizationToJson(_Organization instance) => + {'name': instance.name}; diff --git a/lib/data/services/model/tender/tender_model.dart b/lib/data/services/model/tender/tender_model.dart index 7af9ce4..6099aa0 100644 --- a/lib/data/services/model/tender/tender_model.dart +++ b/lib/data/services/model/tender/tender_model.dart @@ -1,6 +1,8 @@ // ignore_for_file: invalid_annotation_target import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:tm_app/data/services/model/error/error_model.dart'; +import 'package:tm_app/data/services/model/tender_data/tender_data.dart'; part 'tender_model.freezed.dart'; part 'tender_model.g.dart'; @@ -8,21 +10,14 @@ part 'tender_model.g.dart'; @freezed abstract class TenderModel with _$TenderModel { const factory TenderModel({ - @JsonKey(name: 'created_time') required String? createdTime, - @JsonKey(name: 'tender_id') required String? tenderId, - required String? status, - required String? title, - required String? description, - required String? location, - required String? type, - required String? deadline, - required bool? liked, - required bool? disliked, - required bool? rejected, - required bool? submitted, + + required bool? success, + required String? message, + required TenderData? data, + required ErrorModel? error, @JsonKey(name: 'profile_match') required double? profileMatch, }) = _TenderModel; factory TenderModel.fromJson(Map json) => _$TenderModelFromJson(json); -} +} \ No newline at end of file diff --git a/lib/data/services/model/tender/tender_model.freezed.dart b/lib/data/services/model/tender/tender_model.freezed.dart index b365b54..3cbb26e 100644 --- a/lib/data/services/model/tender/tender_model.freezed.dart +++ b/lib/data/services/model/tender/tender_model.freezed.dart @@ -15,7 +15,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$TenderModel { -@JsonKey(name: 'created_time') String? get createdTime;@JsonKey(name: 'tender_id') String? get tenderId; String? get status; String? get title; String? get description; String? get location; String? get type; String? get deadline; bool? get liked; bool? get disliked; bool? get rejected; bool? get submitted;@JsonKey(name: 'profile_match') double? get profileMatch; + bool? get success; String? get message; TenderData? get data; ErrorModel? get error;@JsonKey(name: 'profile_match') double? get profileMatch; /// Create a copy of TenderModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -28,16 +28,16 @@ $TenderModelCopyWith get copyWith => _$TenderModelCopyWithImpl Object.hash(runtimeType,createdTime,tenderId,status,title,description,location,type,deadline,liked,disliked,rejected,submitted,profileMatch); +int get hashCode => Object.hash(runtimeType,success,message,data,error,profileMatch); @override String toString() { - return 'TenderModel(createdTime: $createdTime, tenderId: $tenderId, status: $status, title: $title, description: $description, location: $location, type: $type, deadline: $deadline, liked: $liked, disliked: $disliked, rejected: $rejected, submitted: $submitted, profileMatch: $profileMatch)'; + return 'TenderModel(success: $success, message: $message, data: $data, error: $error, profileMatch: $profileMatch)'; } @@ -48,11 +48,11 @@ abstract mixin class $TenderModelCopyWith<$Res> { factory $TenderModelCopyWith(TenderModel value, $Res Function(TenderModel) _then) = _$TenderModelCopyWithImpl; @useResult $Res call({ -@JsonKey(name: 'created_time') String? createdTime,@JsonKey(name: 'tender_id') String? tenderId, String? status, String? title, String? description, String? location, String? type, String? deadline, bool? liked, bool? disliked, bool? rejected, bool? submitted,@JsonKey(name: 'profile_match') double? profileMatch + bool? success, String? message, TenderData? data, ErrorModel? error,@JsonKey(name: 'profile_match') double? profileMatch }); - +$TenderDataCopyWith<$Res>? get data;$ErrorModelCopyWith<$Res>? get error; } /// @nodoc @@ -65,25 +65,41 @@ class _$TenderModelCopyWithImpl<$Res> /// Create a copy of TenderModel /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? createdTime = freezed,Object? tenderId = freezed,Object? status = freezed,Object? title = freezed,Object? description = freezed,Object? location = freezed,Object? type = freezed,Object? deadline = freezed,Object? liked = freezed,Object? disliked = freezed,Object? rejected = freezed,Object? submitted = freezed,Object? profileMatch = freezed,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? success = freezed,Object? message = freezed,Object? data = freezed,Object? error = freezed,Object? profileMatch = freezed,}) { return _then(_self.copyWith( -createdTime: freezed == createdTime ? _self.createdTime : createdTime // ignore: cast_nullable_to_non_nullable -as String?,tenderId: freezed == tenderId ? _self.tenderId : tenderId // ignore: cast_nullable_to_non_nullable -as String?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable -as String?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable -as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable -as String?,location: freezed == location ? _self.location : location // ignore: cast_nullable_to_non_nullable -as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable -as String?,deadline: freezed == deadline ? _self.deadline : deadline // ignore: cast_nullable_to_non_nullable -as String?,liked: freezed == liked ? _self.liked : liked // ignore: cast_nullable_to_non_nullable -as bool?,disliked: freezed == disliked ? _self.disliked : disliked // ignore: cast_nullable_to_non_nullable -as bool?,rejected: freezed == rejected ? _self.rejected : rejected // ignore: cast_nullable_to_non_nullable -as bool?,submitted: freezed == submitted ? _self.submitted : submitted // ignore: cast_nullable_to_non_nullable -as bool?,profileMatch: freezed == profileMatch ? _self.profileMatch : profileMatch // ignore: cast_nullable_to_non_nullable +success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable +as bool?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable +as TenderData?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as ErrorModel?,profileMatch: freezed == profileMatch ? _self.profileMatch : profileMatch // ignore: cast_nullable_to_non_nullable as double?, )); } +/// Create a copy of TenderModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$TenderDataCopyWith<$Res>? get data { + if (_self.data == null) { + return null; + } + return $TenderDataCopyWith<$Res>(_self.data!, (value) { + return _then(_self.copyWith(data: value)); + }); +}/// Create a copy of TenderModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ErrorModelCopyWith<$Res>? get error { + if (_self.error == null) { + return null; + } + + return $ErrorModelCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +} } @@ -165,10 +181,10 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(name: 'created_time') String? createdTime, @JsonKey(name: 'tender_id') String? tenderId, String? status, String? title, String? description, String? location, String? type, String? deadline, bool? liked, bool? disliked, bool? rejected, bool? submitted, @JsonKey(name: 'profile_match') double? profileMatch)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? success, String? message, TenderData? data, ErrorModel? error, @JsonKey(name: 'profile_match') double? profileMatch)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _TenderModel() when $default != null: -return $default(_that.createdTime,_that.tenderId,_that.status,_that.title,_that.description,_that.location,_that.type,_that.deadline,_that.liked,_that.disliked,_that.rejected,_that.submitted,_that.profileMatch);case _: +return $default(_that.success,_that.message,_that.data,_that.error,_that.profileMatch);case _: return orElse(); } @@ -186,10 +202,10 @@ return $default(_that.createdTime,_that.tenderId,_that.status,_that.title,_that. /// } /// ``` -@optionalTypeArgs TResult when(TResult Function(@JsonKey(name: 'created_time') String? createdTime, @JsonKey(name: 'tender_id') String? tenderId, String? status, String? title, String? description, String? location, String? type, String? deadline, bool? liked, bool? disliked, bool? rejected, bool? submitted, @JsonKey(name: 'profile_match') double? profileMatch) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( bool? success, String? message, TenderData? data, ErrorModel? error, @JsonKey(name: 'profile_match') double? profileMatch) $default,) {final _that = this; switch (_that) { case _TenderModel(): -return $default(_that.createdTime,_that.tenderId,_that.status,_that.title,_that.description,_that.location,_that.type,_that.deadline,_that.liked,_that.disliked,_that.rejected,_that.submitted,_that.profileMatch);case _: +return $default(_that.success,_that.message,_that.data,_that.error,_that.profileMatch);case _: throw StateError('Unexpected subclass'); } @@ -206,10 +222,10 @@ return $default(_that.createdTime,_that.tenderId,_that.status,_that.title,_that. /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(name: 'created_time') String? createdTime, @JsonKey(name: 'tender_id') String? tenderId, String? status, String? title, String? description, String? location, String? type, String? deadline, bool? liked, bool? disliked, bool? rejected, bool? submitted, @JsonKey(name: 'profile_match') double? profileMatch)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? success, String? message, TenderData? data, ErrorModel? error, @JsonKey(name: 'profile_match') double? profileMatch)? $default,) {final _that = this; switch (_that) { case _TenderModel() when $default != null: -return $default(_that.createdTime,_that.tenderId,_that.status,_that.title,_that.description,_that.location,_that.type,_that.deadline,_that.liked,_that.disliked,_that.rejected,_that.submitted,_that.profileMatch);case _: +return $default(_that.success,_that.message,_that.data,_that.error,_that.profileMatch);case _: return null; } @@ -221,21 +237,13 @@ return $default(_that.createdTime,_that.tenderId,_that.status,_that.title,_that. @JsonSerializable() class _TenderModel implements TenderModel { - const _TenderModel({@JsonKey(name: 'created_time') required this.createdTime, @JsonKey(name: 'tender_id') required this.tenderId, required this.status, required this.title, required this.description, required this.location, required this.type, required this.deadline, required this.liked, required this.disliked, required this.rejected, required this.submitted, @JsonKey(name: 'profile_match') required this.profileMatch}); + const _TenderModel({required this.success, required this.message, required this.data, required this.error, @JsonKey(name: 'profile_match') required this.profileMatch}); factory _TenderModel.fromJson(Map json) => _$TenderModelFromJson(json); -@override@JsonKey(name: 'created_time') final String? createdTime; -@override@JsonKey(name: 'tender_id') final String? tenderId; -@override final String? status; -@override final String? title; -@override final String? description; -@override final String? location; -@override final String? type; -@override final String? deadline; -@override final bool? liked; -@override final bool? disliked; -@override final bool? rejected; -@override final bool? submitted; +@override final bool? success; +@override final String? message; +@override final TenderData? data; +@override final ErrorModel? error; @override@JsonKey(name: 'profile_match') final double? profileMatch; /// Create a copy of TenderModel @@ -251,16 +259,16 @@ Map toJson() { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderModel&&(identical(other.createdTime, createdTime) || other.createdTime == createdTime)&&(identical(other.tenderId, tenderId) || other.tenderId == tenderId)&&(identical(other.status, status) || other.status == status)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.location, location) || other.location == location)&&(identical(other.type, type) || other.type == type)&&(identical(other.deadline, deadline) || other.deadline == deadline)&&(identical(other.liked, liked) || other.liked == liked)&&(identical(other.disliked, disliked) || other.disliked == disliked)&&(identical(other.rejected, rejected) || other.rejected == rejected)&&(identical(other.submitted, submitted) || other.submitted == submitted)&&(identical(other.profileMatch, profileMatch) || other.profileMatch == profileMatch)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderModel&&(identical(other.success, success) || other.success == success)&&(identical(other.message, message) || other.message == message)&&(identical(other.data, data) || other.data == data)&&(identical(other.error, error) || other.error == error)&&(identical(other.profileMatch, profileMatch) || other.profileMatch == profileMatch)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,createdTime,tenderId,status,title,description,location,type,deadline,liked,disliked,rejected,submitted,profileMatch); +int get hashCode => Object.hash(runtimeType,success,message,data,error,profileMatch); @override String toString() { - return 'TenderModel(createdTime: $createdTime, tenderId: $tenderId, status: $status, title: $title, description: $description, location: $location, type: $type, deadline: $deadline, liked: $liked, disliked: $disliked, rejected: $rejected, submitted: $submitted, profileMatch: $profileMatch)'; + return 'TenderModel(success: $success, message: $message, data: $data, error: $error, profileMatch: $profileMatch)'; } @@ -271,11 +279,11 @@ abstract mixin class _$TenderModelCopyWith<$Res> implements $TenderModelCopyWith factory _$TenderModelCopyWith(_TenderModel value, $Res Function(_TenderModel) _then) = __$TenderModelCopyWithImpl; @override @useResult $Res call({ -@JsonKey(name: 'created_time') String? createdTime,@JsonKey(name: 'tender_id') String? tenderId, String? status, String? title, String? description, String? location, String? type, String? deadline, bool? liked, bool? disliked, bool? rejected, bool? submitted,@JsonKey(name: 'profile_match') double? profileMatch + bool? success, String? message, TenderData? data, ErrorModel? error,@JsonKey(name: 'profile_match') double? profileMatch }); - +@override $TenderDataCopyWith<$Res>? get data;@override $ErrorModelCopyWith<$Res>? get error; } /// @nodoc @@ -288,26 +296,42 @@ class __$TenderModelCopyWithImpl<$Res> /// Create a copy of TenderModel /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? createdTime = freezed,Object? tenderId = freezed,Object? status = freezed,Object? title = freezed,Object? description = freezed,Object? location = freezed,Object? type = freezed,Object? deadline = freezed,Object? liked = freezed,Object? disliked = freezed,Object? rejected = freezed,Object? submitted = freezed,Object? profileMatch = freezed,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? success = freezed,Object? message = freezed,Object? data = freezed,Object? error = freezed,Object? profileMatch = freezed,}) { return _then(_TenderModel( -createdTime: freezed == createdTime ? _self.createdTime : createdTime // ignore: cast_nullable_to_non_nullable -as String?,tenderId: freezed == tenderId ? _self.tenderId : tenderId // ignore: cast_nullable_to_non_nullable -as String?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable -as String?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable -as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable -as String?,location: freezed == location ? _self.location : location // ignore: cast_nullable_to_non_nullable -as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable -as String?,deadline: freezed == deadline ? _self.deadline : deadline // ignore: cast_nullable_to_non_nullable -as String?,liked: freezed == liked ? _self.liked : liked // ignore: cast_nullable_to_non_nullable -as bool?,disliked: freezed == disliked ? _self.disliked : disliked // ignore: cast_nullable_to_non_nullable -as bool?,rejected: freezed == rejected ? _self.rejected : rejected // ignore: cast_nullable_to_non_nullable -as bool?,submitted: freezed == submitted ? _self.submitted : submitted // ignore: cast_nullable_to_non_nullable -as bool?,profileMatch: freezed == profileMatch ? _self.profileMatch : profileMatch // ignore: cast_nullable_to_non_nullable +success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable +as bool?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable +as TenderData?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as ErrorModel?,profileMatch: freezed == profileMatch ? _self.profileMatch : profileMatch // ignore: cast_nullable_to_non_nullable as double?, )); } +/// Create a copy of TenderModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$TenderDataCopyWith<$Res>? get data { + if (_self.data == null) { + return null; + } + return $TenderDataCopyWith<$Res>(_self.data!, (value) { + return _then(_self.copyWith(data: value)); + }); +}/// Create a copy of TenderModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ErrorModelCopyWith<$Res>? get error { + if (_self.error == null) { + return null; + } + + return $ErrorModelCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +} } // dart format on diff --git a/lib/data/services/model/tender/tender_model.g.dart b/lib/data/services/model/tender/tender_model.g.dart index 2beb0e4..75eab70 100644 --- a/lib/data/services/model/tender/tender_model.g.dart +++ b/lib/data/services/model/tender/tender_model.g.dart @@ -7,34 +7,24 @@ part of 'tender_model.dart'; // ************************************************************************** _TenderModel _$TenderModelFromJson(Map json) => _TenderModel( - createdTime: json['created_time'] as String?, - tenderId: json['tender_id'] as String?, - status: json['status'] as String?, - title: json['title'] as String?, - description: json['description'] as String?, - location: json['location'] as String?, - type: json['type'] as String?, - deadline: json['deadline'] as String?, - liked: json['liked'] as bool?, - disliked: json['disliked'] as bool?, - rejected: json['rejected'] as bool?, - submitted: json['submitted'] as bool?, + success: json['success'] as bool?, + message: json['message'] as String?, + data: + json['data'] == null + ? null + : TenderData.fromJson(json['data'] as Map), + error: + json['error'] == null + ? null + : ErrorModel.fromJson(json['error'] as Map), profileMatch: (json['profile_match'] as num?)?.toDouble(), ); Map _$TenderModelToJson(_TenderModel instance) => { - 'created_time': instance.createdTime, - 'tender_id': instance.tenderId, - 'status': instance.status, - 'title': instance.title, - 'description': instance.description, - 'location': instance.location, - 'type': instance.type, - 'deadline': instance.deadline, - 'liked': instance.liked, - 'disliked': instance.disliked, - 'rejected': instance.rejected, - 'submitted': instance.submitted, + 'success': instance.success, + 'message': instance.message, + 'data': instance.data, + 'error': instance.error, 'profile_match': instance.profileMatch, }; diff --git a/lib/data/services/model/tender_data/tender_data.dart b/lib/data/services/model/tender_data/tender_data.dart new file mode 100644 index 0000000..52d7a0e --- /dev/null +++ b/lib/data/services/model/tender_data/tender_data.dart @@ -0,0 +1,34 @@ +// ignore_for_file: invalid_annotation_target + +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:tm_app/data/services/model/organization/organization.dart'; + +part 'tender_data.freezed.dart'; +part 'tender_data.g.dart'; + +@freezed +abstract class TenderData with _$TenderData { + const factory TenderData({ + + required bool? success, + required String? message, + required String? id, + @JsonKey(name: 'notice_publication_id') required String? noticePublicationId, + @JsonKey(name: 'publication_date') required int? publicationDate, + required String? title, + required String? description, + @JsonKey(name: 'procurement_type_code') required String? procurementTypeCode, + @JsonKey(name: 'procedure_code') required String? procedureCode, + @JsonKey(name: 'estimated_value') required int? estimatedValue, + required String? currency, + required String? duration, + required String? durationUnit, + @JsonKey(name: 'tender_deadline') required int? tenderDeadline, + @JsonKey(name: 'country_code') required String? countryCode, + @JsonKey(name: 'buyer_organization') required Organization? buyerOrganization, + required String? status, + }) = _TenderData; + + factory TenderData.fromJson(Map json) => + _$TenderDataFromJson(json); +} \ No newline at end of file diff --git a/lib/data/services/model/tender_data/tender_data.freezed.dart b/lib/data/services/model/tender_data/tender_data.freezed.dart new file mode 100644 index 0000000..d4c592f --- /dev/null +++ b/lib/data/services/model/tender_data/tender_data.freezed.dart @@ -0,0 +1,349 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'tender_data.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$TenderData { + + bool? get success; String? get message; String? get id;@JsonKey(name: 'notice_publication_id') String? get noticePublicationId;@JsonKey(name: 'publication_date') int? get publicationDate; String? get title; String? get description;@JsonKey(name: 'procurement_type_code') String? get procurementTypeCode;@JsonKey(name: 'procedure_code') String? get procedureCode;@JsonKey(name: 'estimated_value') int? get estimatedValue; String? get currency; String? get duration; String? get durationUnit;@JsonKey(name: 'tender_deadline') int? get tenderDeadline;@JsonKey(name: 'country_code') String? get countryCode;@JsonKey(name: 'buyer_organization') Organization? get buyerOrganization; String? get status; +/// Create a copy of TenderData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$TenderDataCopyWith get copyWith => _$TenderDataCopyWithImpl(this as TenderData, _$identity); + + /// Serializes this TenderData to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is TenderData&&(identical(other.success, success) || other.success == success)&&(identical(other.message, message) || other.message == message)&&(identical(other.id, id) || other.id == id)&&(identical(other.noticePublicationId, noticePublicationId) || other.noticePublicationId == noticePublicationId)&&(identical(other.publicationDate, publicationDate) || other.publicationDate == publicationDate)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.procurementTypeCode, procurementTypeCode) || other.procurementTypeCode == procurementTypeCode)&&(identical(other.procedureCode, procedureCode) || other.procedureCode == procedureCode)&&(identical(other.estimatedValue, estimatedValue) || other.estimatedValue == estimatedValue)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.duration, duration) || other.duration == duration)&&(identical(other.durationUnit, durationUnit) || other.durationUnit == durationUnit)&&(identical(other.tenderDeadline, tenderDeadline) || other.tenderDeadline == tenderDeadline)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.buyerOrganization, buyerOrganization) || other.buyerOrganization == buyerOrganization)&&(identical(other.status, status) || other.status == status)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,success,message,id,noticePublicationId,publicationDate,title,description,procurementTypeCode,procedureCode,estimatedValue,currency,duration,durationUnit,tenderDeadline,countryCode,buyerOrganization,status); + +@override +String toString() { + return 'TenderData(success: $success, message: $message, id: $id, noticePublicationId: $noticePublicationId, publicationDate: $publicationDate, title: $title, description: $description, procurementTypeCode: $procurementTypeCode, procedureCode: $procedureCode, estimatedValue: $estimatedValue, currency: $currency, duration: $duration, durationUnit: $durationUnit, tenderDeadline: $tenderDeadline, countryCode: $countryCode, buyerOrganization: $buyerOrganization, status: $status)'; +} + + +} + +/// @nodoc +abstract mixin class $TenderDataCopyWith<$Res> { + factory $TenderDataCopyWith(TenderData value, $Res Function(TenderData) _then) = _$TenderDataCopyWithImpl; +@useResult +$Res call({ + bool? success, String? message, String? id,@JsonKey(name: 'notice_publication_id') String? noticePublicationId,@JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description,@JsonKey(name: 'procurement_type_code') String? procurementTypeCode,@JsonKey(name: 'procedure_code') String? procedureCode,@JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit,@JsonKey(name: 'tender_deadline') int? tenderDeadline,@JsonKey(name: 'country_code') String? countryCode,@JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status +}); + + +$OrganizationCopyWith<$Res>? get buyerOrganization; + +} +/// @nodoc +class _$TenderDataCopyWithImpl<$Res> + implements $TenderDataCopyWith<$Res> { + _$TenderDataCopyWithImpl(this._self, this._then); + + final TenderData _self; + final $Res Function(TenderData) _then; + +/// Create a copy of TenderData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? success = freezed,Object? message = freezed,Object? id = freezed,Object? noticePublicationId = freezed,Object? publicationDate = freezed,Object? title = freezed,Object? description = freezed,Object? procurementTypeCode = freezed,Object? procedureCode = freezed,Object? estimatedValue = freezed,Object? currency = freezed,Object? duration = freezed,Object? durationUnit = freezed,Object? tenderDeadline = freezed,Object? countryCode = freezed,Object? buyerOrganization = freezed,Object? status = freezed,}) { + return _then(_self.copyWith( +success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable +as bool?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String?,noticePublicationId: freezed == noticePublicationId ? _self.noticePublicationId : noticePublicationId // ignore: cast_nullable_to_non_nullable +as String?,publicationDate: freezed == publicationDate ? _self.publicationDate : publicationDate // ignore: cast_nullable_to_non_nullable +as int?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String?,procurementTypeCode: freezed == procurementTypeCode ? _self.procurementTypeCode : procurementTypeCode // ignore: cast_nullable_to_non_nullable +as String?,procedureCode: freezed == procedureCode ? _self.procedureCode : procedureCode // ignore: cast_nullable_to_non_nullable +as String?,estimatedValue: freezed == estimatedValue ? _self.estimatedValue : estimatedValue // ignore: cast_nullable_to_non_nullable +as int?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?,duration: freezed == duration ? _self.duration : duration // ignore: cast_nullable_to_non_nullable +as String?,durationUnit: freezed == durationUnit ? _self.durationUnit : durationUnit // ignore: cast_nullable_to_non_nullable +as String?,tenderDeadline: freezed == tenderDeadline ? _self.tenderDeadline : tenderDeadline // ignore: cast_nullable_to_non_nullable +as int?,countryCode: freezed == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable +as String?,buyerOrganization: freezed == buyerOrganization ? _self.buyerOrganization : buyerOrganization // ignore: cast_nullable_to_non_nullable +as Organization?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of TenderData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$OrganizationCopyWith<$Res>? get buyerOrganization { + if (_self.buyerOrganization == null) { + return null; + } + + return $OrganizationCopyWith<$Res>(_self.buyerOrganization!, (value) { + return _then(_self.copyWith(buyerOrganization: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [TenderData]. +extension TenderDataPatterns on TenderData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _TenderData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _TenderData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _TenderData value) $default,){ +final _that = this; +switch (_that) { +case _TenderData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _TenderData value)? $default,){ +final _that = this; +switch (_that) { +case _TenderData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? success, String? message, String? id, @JsonKey(name: 'notice_publication_id') String? noticePublicationId, @JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description, @JsonKey(name: 'procurement_type_code') String? procurementTypeCode, @JsonKey(name: 'procedure_code') String? procedureCode, @JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit, @JsonKey(name: 'tender_deadline') int? tenderDeadline, @JsonKey(name: 'country_code') String? countryCode, @JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _TenderData() when $default != null: +return $default(_that.success,_that.message,_that.id,_that.noticePublicationId,_that.publicationDate,_that.title,_that.description,_that.procurementTypeCode,_that.procedureCode,_that.estimatedValue,_that.currency,_that.duration,_that.durationUnit,_that.tenderDeadline,_that.countryCode,_that.buyerOrganization,_that.status);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? success, String? message, String? id, @JsonKey(name: 'notice_publication_id') String? noticePublicationId, @JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description, @JsonKey(name: 'procurement_type_code') String? procurementTypeCode, @JsonKey(name: 'procedure_code') String? procedureCode, @JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit, @JsonKey(name: 'tender_deadline') int? tenderDeadline, @JsonKey(name: 'country_code') String? countryCode, @JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status) $default,) {final _that = this; +switch (_that) { +case _TenderData(): +return $default(_that.success,_that.message,_that.id,_that.noticePublicationId,_that.publicationDate,_that.title,_that.description,_that.procurementTypeCode,_that.procedureCode,_that.estimatedValue,_that.currency,_that.duration,_that.durationUnit,_that.tenderDeadline,_that.countryCode,_that.buyerOrganization,_that.status);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? success, String? message, String? id, @JsonKey(name: 'notice_publication_id') String? noticePublicationId, @JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description, @JsonKey(name: 'procurement_type_code') String? procurementTypeCode, @JsonKey(name: 'procedure_code') String? procedureCode, @JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit, @JsonKey(name: 'tender_deadline') int? tenderDeadline, @JsonKey(name: 'country_code') String? countryCode, @JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status)? $default,) {final _that = this; +switch (_that) { +case _TenderData() when $default != null: +return $default(_that.success,_that.message,_that.id,_that.noticePublicationId,_that.publicationDate,_that.title,_that.description,_that.procurementTypeCode,_that.procedureCode,_that.estimatedValue,_that.currency,_that.duration,_that.durationUnit,_that.tenderDeadline,_that.countryCode,_that.buyerOrganization,_that.status);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _TenderData implements TenderData { + const _TenderData({required this.success, required this.message, required this.id, @JsonKey(name: 'notice_publication_id') required this.noticePublicationId, @JsonKey(name: 'publication_date') required this.publicationDate, required this.title, required this.description, @JsonKey(name: 'procurement_type_code') required this.procurementTypeCode, @JsonKey(name: 'procedure_code') required this.procedureCode, @JsonKey(name: 'estimated_value') required this.estimatedValue, required this.currency, required this.duration, required this.durationUnit, @JsonKey(name: 'tender_deadline') required this.tenderDeadline, @JsonKey(name: 'country_code') required this.countryCode, @JsonKey(name: 'buyer_organization') required this.buyerOrganization, required this.status}); + factory _TenderData.fromJson(Map json) => _$TenderDataFromJson(json); + +@override final bool? success; +@override final String? message; +@override final String? id; +@override@JsonKey(name: 'notice_publication_id') final String? noticePublicationId; +@override@JsonKey(name: 'publication_date') final int? publicationDate; +@override final String? title; +@override final String? description; +@override@JsonKey(name: 'procurement_type_code') final String? procurementTypeCode; +@override@JsonKey(name: 'procedure_code') final String? procedureCode; +@override@JsonKey(name: 'estimated_value') final int? estimatedValue; +@override final String? currency; +@override final String? duration; +@override final String? durationUnit; +@override@JsonKey(name: 'tender_deadline') final int? tenderDeadline; +@override@JsonKey(name: 'country_code') final String? countryCode; +@override@JsonKey(name: 'buyer_organization') final Organization? buyerOrganization; +@override final String? status; + +/// Create a copy of TenderData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$TenderDataCopyWith<_TenderData> get copyWith => __$TenderDataCopyWithImpl<_TenderData>(this, _$identity); + +@override +Map toJson() { + return _$TenderDataToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderData&&(identical(other.success, success) || other.success == success)&&(identical(other.message, message) || other.message == message)&&(identical(other.id, id) || other.id == id)&&(identical(other.noticePublicationId, noticePublicationId) || other.noticePublicationId == noticePublicationId)&&(identical(other.publicationDate, publicationDate) || other.publicationDate == publicationDate)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.procurementTypeCode, procurementTypeCode) || other.procurementTypeCode == procurementTypeCode)&&(identical(other.procedureCode, procedureCode) || other.procedureCode == procedureCode)&&(identical(other.estimatedValue, estimatedValue) || other.estimatedValue == estimatedValue)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.duration, duration) || other.duration == duration)&&(identical(other.durationUnit, durationUnit) || other.durationUnit == durationUnit)&&(identical(other.tenderDeadline, tenderDeadline) || other.tenderDeadline == tenderDeadline)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.buyerOrganization, buyerOrganization) || other.buyerOrganization == buyerOrganization)&&(identical(other.status, status) || other.status == status)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,success,message,id,noticePublicationId,publicationDate,title,description,procurementTypeCode,procedureCode,estimatedValue,currency,duration,durationUnit,tenderDeadline,countryCode,buyerOrganization,status); + +@override +String toString() { + return 'TenderData(success: $success, message: $message, id: $id, noticePublicationId: $noticePublicationId, publicationDate: $publicationDate, title: $title, description: $description, procurementTypeCode: $procurementTypeCode, procedureCode: $procedureCode, estimatedValue: $estimatedValue, currency: $currency, duration: $duration, durationUnit: $durationUnit, tenderDeadline: $tenderDeadline, countryCode: $countryCode, buyerOrganization: $buyerOrganization, status: $status)'; +} + + +} + +/// @nodoc +abstract mixin class _$TenderDataCopyWith<$Res> implements $TenderDataCopyWith<$Res> { + factory _$TenderDataCopyWith(_TenderData value, $Res Function(_TenderData) _then) = __$TenderDataCopyWithImpl; +@override @useResult +$Res call({ + bool? success, String? message, String? id,@JsonKey(name: 'notice_publication_id') String? noticePublicationId,@JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description,@JsonKey(name: 'procurement_type_code') String? procurementTypeCode,@JsonKey(name: 'procedure_code') String? procedureCode,@JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit,@JsonKey(name: 'tender_deadline') int? tenderDeadline,@JsonKey(name: 'country_code') String? countryCode,@JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status +}); + + +@override $OrganizationCopyWith<$Res>? get buyerOrganization; + +} +/// @nodoc +class __$TenderDataCopyWithImpl<$Res> + implements _$TenderDataCopyWith<$Res> { + __$TenderDataCopyWithImpl(this._self, this._then); + + final _TenderData _self; + final $Res Function(_TenderData) _then; + +/// Create a copy of TenderData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? success = freezed,Object? message = freezed,Object? id = freezed,Object? noticePublicationId = freezed,Object? publicationDate = freezed,Object? title = freezed,Object? description = freezed,Object? procurementTypeCode = freezed,Object? procedureCode = freezed,Object? estimatedValue = freezed,Object? currency = freezed,Object? duration = freezed,Object? durationUnit = freezed,Object? tenderDeadline = freezed,Object? countryCode = freezed,Object? buyerOrganization = freezed,Object? status = freezed,}) { + return _then(_TenderData( +success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable +as bool?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String?,noticePublicationId: freezed == noticePublicationId ? _self.noticePublicationId : noticePublicationId // ignore: cast_nullable_to_non_nullable +as String?,publicationDate: freezed == publicationDate ? _self.publicationDate : publicationDate // ignore: cast_nullable_to_non_nullable +as int?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String?,procurementTypeCode: freezed == procurementTypeCode ? _self.procurementTypeCode : procurementTypeCode // ignore: cast_nullable_to_non_nullable +as String?,procedureCode: freezed == procedureCode ? _self.procedureCode : procedureCode // ignore: cast_nullable_to_non_nullable +as String?,estimatedValue: freezed == estimatedValue ? _self.estimatedValue : estimatedValue // ignore: cast_nullable_to_non_nullable +as int?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?,duration: freezed == duration ? _self.duration : duration // ignore: cast_nullable_to_non_nullable +as String?,durationUnit: freezed == durationUnit ? _self.durationUnit : durationUnit // ignore: cast_nullable_to_non_nullable +as String?,tenderDeadline: freezed == tenderDeadline ? _self.tenderDeadline : tenderDeadline // ignore: cast_nullable_to_non_nullable +as int?,countryCode: freezed == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable +as String?,buyerOrganization: freezed == buyerOrganization ? _self.buyerOrganization : buyerOrganization // ignore: cast_nullable_to_non_nullable +as Organization?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of TenderData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$OrganizationCopyWith<$Res>? get buyerOrganization { + if (_self.buyerOrganization == null) { + return null; + } + + return $OrganizationCopyWith<$Res>(_self.buyerOrganization!, (value) { + return _then(_self.copyWith(buyerOrganization: value)); + }); +} +} + +// dart format on diff --git a/lib/data/services/model/tender_data/tender_data.g.dart b/lib/data/services/model/tender_data/tender_data.g.dart new file mode 100644 index 0000000..549a9d9 --- /dev/null +++ b/lib/data/services/model/tender_data/tender_data.g.dart @@ -0,0 +1,53 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'tender_data.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_TenderData _$TenderDataFromJson(Map json) => _TenderData( + success: json['success'] as bool?, + message: json['message'] as String?, + id: json['id'] as String?, + noticePublicationId: json['notice_publication_id'] as String?, + publicationDate: (json['publication_date'] as num?)?.toInt(), + title: json['title'] as String?, + description: json['description'] as String?, + procurementTypeCode: json['procurement_type_code'] as String?, + procedureCode: json['procedure_code'] as String?, + estimatedValue: (json['estimated_value'] as num?)?.toInt(), + currency: json['currency'] as String?, + duration: json['duration'] as String?, + durationUnit: json['durationUnit'] as String?, + tenderDeadline: (json['tender_deadline'] as num?)?.toInt(), + countryCode: json['country_code'] as String?, + buyerOrganization: + json['buyer_organization'] == null + ? null + : Organization.fromJson( + json['buyer_organization'] as Map, + ), + status: json['status'] as String?, +); + +Map _$TenderDataToJson(_TenderData instance) => + { + 'success': instance.success, + 'message': instance.message, + 'id': instance.id, + 'notice_publication_id': instance.noticePublicationId, + 'publication_date': instance.publicationDate, + 'title': instance.title, + 'description': instance.description, + 'procurement_type_code': instance.procurementTypeCode, + 'procedure_code': instance.procedureCode, + 'estimated_value': instance.estimatedValue, + 'currency': instance.currency, + 'duration': instance.duration, + 'durationUnit': instance.durationUnit, + 'tender_deadline': instance.tenderDeadline, + 'country_code': instance.countryCode, + 'buyer_organization': instance.buyerOrganization, + 'status': instance.status, + };