Merge remote-tracking branch 'origin/refactor_dark_mood_repository'
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import 'package:tm_app/core/utils/result.dart';
|
||||
import 'package:tm_app/data/services/model/tender_detail_request/tender_detail_request.dart';
|
||||
import 'package:tm_app/data/services/model/tender_detail_response/tender_detail_response_model.dart';
|
||||
import 'package:tm_app/data/services/tender_detail_service.dart';
|
||||
|
||||
class TenderDetailRepository {
|
||||
TenderDetailRepository({required TenderDetailService tenderDetailService})
|
||||
: _tenderDetailService = tenderDetailService;
|
||||
|
||||
final TenderDetailService _tenderDetailService;
|
||||
|
||||
Future<Result<TenderDetailResponseModel>> getTenderDetail({
|
||||
required TenderDetailRequest request,
|
||||
}) async {
|
||||
return await _tenderDetailService.getTenderDetail(request: request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
const tenderDetailMockData = '''
|
||||
{
|
||||
"data": {
|
||||
"date": "2025-05-21",
|
||||
"status": "Open",
|
||||
"title": "Operation, support and further development of open e-platform Operation, support and further development of open e-platform",
|
||||
"id": "JNDFKMDV-100JF",
|
||||
"approvalDate": "2025-05-21",
|
||||
"submissionDate": "2025-05-21",
|
||||
"client": "Procurement Notice Procurement NoticeProcurement Notice",
|
||||
"deliveryLocation": "Norrbotten County",
|
||||
"referenceNumber": "KLF 2025/120",
|
||||
"country": "UK",
|
||||
"flagAsset": "assets/icons/SE.png",
|
||||
"locationTitle": "Lorem ipsum is amet",
|
||||
"locationDescription": "Luleå Municipality is procuring on behalf of Norrbotten’s e-board (all municipalities in Norrbotten). The procurement includes operation, support, and further development of the existing open e-platform. No additional information, amendments, or answers to questions will be provided after June 16.",
|
||||
"documentName": "PDF, Document",
|
||||
"documentUrl": "https://www.tenders.com",
|
||||
"profileMatch": 0.75,
|
||||
"incompleteResume": true,
|
||||
"incompleteResumeReason": "No experience in e-platform development"
|
||||
}
|
||||
}
|
||||
''';
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: invalid_annotation_target
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'tender_detail_request.freezed.dart';
|
||||
part 'tender_detail_request.g.dart';
|
||||
|
||||
@freezed
|
||||
class TenderDetailRequest with _$TenderDetailRequest {
|
||||
const factory TenderDetailRequest({
|
||||
@JsonKey(name: 'id') required String id,
|
||||
}) = _TenderDetailRequest;
|
||||
|
||||
factory TenderDetailRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$TenderDetailRequestFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// 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_detail_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
|
||||
);
|
||||
|
||||
TenderDetailRequest _$TenderDetailRequestFromJson(Map<String, dynamic> json) {
|
||||
return _TenderDetailRequest.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$TenderDetailRequest {
|
||||
@JsonKey(name: "id")
|
||||
String get id => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this TenderDetailRequest to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of TenderDetailRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$TenderDetailRequestCopyWith<TenderDetailRequest> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $TenderDetailRequestCopyWith<$Res> {
|
||||
factory $TenderDetailRequestCopyWith(
|
||||
TenderDetailRequest value,
|
||||
$Res Function(TenderDetailRequest) then,
|
||||
) = _$TenderDetailRequestCopyWithImpl<$Res, TenderDetailRequest>;
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: "id") String id});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$TenderDetailRequestCopyWithImpl<$Res, $Val extends TenderDetailRequest>
|
||||
implements $TenderDetailRequestCopyWith<$Res> {
|
||||
_$TenderDetailRequestCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of TenderDetailRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({Object? id = null}) {
|
||||
return _then(
|
||||
_value.copyWith(
|
||||
id:
|
||||
null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
)
|
||||
as $Val,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$TenderDetailRequestImplCopyWith<$Res>
|
||||
implements $TenderDetailRequestCopyWith<$Res> {
|
||||
factory _$$TenderDetailRequestImplCopyWith(
|
||||
_$TenderDetailRequestImpl value,
|
||||
$Res Function(_$TenderDetailRequestImpl) then,
|
||||
) = __$$TenderDetailRequestImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: "id") String id});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$TenderDetailRequestImplCopyWithImpl<$Res>
|
||||
extends _$TenderDetailRequestCopyWithImpl<$Res, _$TenderDetailRequestImpl>
|
||||
implements _$$TenderDetailRequestImplCopyWith<$Res> {
|
||||
__$$TenderDetailRequestImplCopyWithImpl(
|
||||
_$TenderDetailRequestImpl _value,
|
||||
$Res Function(_$TenderDetailRequestImpl) _then,
|
||||
) : super(_value, _then);
|
||||
|
||||
/// Create a copy of TenderDetailRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({Object? id = null}) {
|
||||
return _then(
|
||||
_$TenderDetailRequestImpl(
|
||||
id:
|
||||
null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$TenderDetailRequestImpl implements _TenderDetailRequest {
|
||||
const _$TenderDetailRequestImpl({@JsonKey(name: "id") required this.id});
|
||||
|
||||
factory _$TenderDetailRequestImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$TenderDetailRequestImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: "id")
|
||||
final String id;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TenderDetailRequest(id: $id)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$TenderDetailRequestImpl &&
|
||||
(identical(other.id, id) || other.id == id));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id);
|
||||
|
||||
/// Create a copy of TenderDetailRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$TenderDetailRequestImplCopyWith<_$TenderDetailRequestImpl> get copyWith =>
|
||||
__$$TenderDetailRequestImplCopyWithImpl<_$TenderDetailRequestImpl>(
|
||||
this,
|
||||
_$identity,
|
||||
);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$TenderDetailRequestImplToJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _TenderDetailRequest implements TenderDetailRequest {
|
||||
const factory _TenderDetailRequest({
|
||||
@JsonKey(name: "id") required final String id,
|
||||
}) = _$TenderDetailRequestImpl;
|
||||
|
||||
factory _TenderDetailRequest.fromJson(Map<String, dynamic> json) =
|
||||
_$TenderDetailRequestImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "id")
|
||||
String get id;
|
||||
|
||||
/// Create a copy of TenderDetailRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$TenderDetailRequestImplCopyWith<_$TenderDetailRequestImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'tender_detail_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$TenderDetailRequestImpl _$$TenderDetailRequestImplFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _$TenderDetailRequestImpl(id: json['id'] as String);
|
||||
|
||||
Map<String, dynamic> _$$TenderDetailRequestImplToJson(
|
||||
_$TenderDetailRequestImpl instance,
|
||||
) => <String, dynamic>{'id': instance.id};
|
||||
@@ -0,0 +1,34 @@
|
||||
// ignore_for_file: invalid_annotation_target
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'tender_detail_response_model.freezed.dart';
|
||||
part 'tender_detail_response_model.g.dart';
|
||||
|
||||
@freezed
|
||||
class TenderDetailResponseModel with _$TenderDetailResponseModel {
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
const factory TenderDetailResponseModel({
|
||||
required String? date,
|
||||
required String? status,
|
||||
required String? title,
|
||||
required String? id,
|
||||
required String? approvalDate,
|
||||
required String? submissionDate,
|
||||
required String? client,
|
||||
required String? deliveryLocation,
|
||||
required String? referenceNumber,
|
||||
required String? country,
|
||||
required String? flagAsset,
|
||||
required String? locationTitle,
|
||||
required String? locationDescription,
|
||||
required String? documentName,
|
||||
required String? documentUrl,
|
||||
required double? profileMatch,
|
||||
required bool? incompleteResume,
|
||||
required String? incompleteResumeReason,
|
||||
}) = _TenderDetailResponseModel;
|
||||
|
||||
factory TenderDetailResponseModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$TenderDetailResponseModelFromJson(json);
|
||||
}
|
||||
+599
@@ -0,0 +1,599 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// 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_detail_response_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
|
||||
);
|
||||
|
||||
TenderDetailResponseModel _$TenderDetailResponseModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) {
|
||||
return _TenderDetailResponseModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$TenderDetailResponseModel {
|
||||
String? get date => throw _privateConstructorUsedError;
|
||||
String? get status => throw _privateConstructorUsedError;
|
||||
String? get title => throw _privateConstructorUsedError;
|
||||
String? get id => throw _privateConstructorUsedError;
|
||||
String? get approvalDate => throw _privateConstructorUsedError;
|
||||
String? get submissionDate => throw _privateConstructorUsedError;
|
||||
String? get client => throw _privateConstructorUsedError;
|
||||
String? get deliveryLocation => throw _privateConstructorUsedError;
|
||||
String? get referenceNumber => throw _privateConstructorUsedError;
|
||||
String? get country => throw _privateConstructorUsedError;
|
||||
String? get flagAsset => throw _privateConstructorUsedError;
|
||||
String? get locationTitle => throw _privateConstructorUsedError;
|
||||
String? get locationDescription => throw _privateConstructorUsedError;
|
||||
String? get documentName => throw _privateConstructorUsedError;
|
||||
String? get documentUrl => throw _privateConstructorUsedError;
|
||||
double? get profileMatch => throw _privateConstructorUsedError;
|
||||
bool? get incompleteResume => throw _privateConstructorUsedError;
|
||||
String? get incompleteResumeReason => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this TenderDetailResponseModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of TenderDetailResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$TenderDetailResponseModelCopyWith<TenderDetailResponseModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $TenderDetailResponseModelCopyWith<$Res> {
|
||||
factory $TenderDetailResponseModelCopyWith(
|
||||
TenderDetailResponseModel value,
|
||||
$Res Function(TenderDetailResponseModel) then,
|
||||
) = _$TenderDetailResponseModelCopyWithImpl<$Res, TenderDetailResponseModel>;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? date,
|
||||
String? status,
|
||||
String? title,
|
||||
String? id,
|
||||
String? approvalDate,
|
||||
String? submissionDate,
|
||||
String? client,
|
||||
String? deliveryLocation,
|
||||
String? referenceNumber,
|
||||
String? country,
|
||||
String? flagAsset,
|
||||
String? locationTitle,
|
||||
String? locationDescription,
|
||||
String? documentName,
|
||||
String? documentUrl,
|
||||
double? profileMatch,
|
||||
bool? incompleteResume,
|
||||
String? incompleteResumeReason,
|
||||
});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$TenderDetailResponseModelCopyWithImpl<
|
||||
$Res,
|
||||
$Val extends TenderDetailResponseModel
|
||||
>
|
||||
implements $TenderDetailResponseModelCopyWith<$Res> {
|
||||
_$TenderDetailResponseModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of TenderDetailResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? date = freezed,
|
||||
Object? status = freezed,
|
||||
Object? title = freezed,
|
||||
Object? id = freezed,
|
||||
Object? approvalDate = freezed,
|
||||
Object? submissionDate = freezed,
|
||||
Object? client = freezed,
|
||||
Object? deliveryLocation = freezed,
|
||||
Object? referenceNumber = freezed,
|
||||
Object? country = freezed,
|
||||
Object? flagAsset = freezed,
|
||||
Object? locationTitle = freezed,
|
||||
Object? locationDescription = freezed,
|
||||
Object? documentName = freezed,
|
||||
Object? documentUrl = freezed,
|
||||
Object? profileMatch = freezed,
|
||||
Object? incompleteResume = freezed,
|
||||
Object? incompleteResumeReason = freezed,
|
||||
}) {
|
||||
return _then(
|
||||
_value.copyWith(
|
||||
date:
|
||||
freezed == date
|
||||
? _value.date
|
||||
: date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
status:
|
||||
freezed == status
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
title:
|
||||
freezed == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
id:
|
||||
freezed == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
approvalDate:
|
||||
freezed == approvalDate
|
||||
? _value.approvalDate
|
||||
: approvalDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
submissionDate:
|
||||
freezed == submissionDate
|
||||
? _value.submissionDate
|
||||
: submissionDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
client:
|
||||
freezed == client
|
||||
? _value.client
|
||||
: client // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
deliveryLocation:
|
||||
freezed == deliveryLocation
|
||||
? _value.deliveryLocation
|
||||
: deliveryLocation // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
referenceNumber:
|
||||
freezed == referenceNumber
|
||||
? _value.referenceNumber
|
||||
: referenceNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
country:
|
||||
freezed == country
|
||||
? _value.country
|
||||
: country // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
flagAsset:
|
||||
freezed == flagAsset
|
||||
? _value.flagAsset
|
||||
: flagAsset // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
locationTitle:
|
||||
freezed == locationTitle
|
||||
? _value.locationTitle
|
||||
: locationTitle // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
locationDescription:
|
||||
freezed == locationDescription
|
||||
? _value.locationDescription
|
||||
: locationDescription // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
documentName:
|
||||
freezed == documentName
|
||||
? _value.documentName
|
||||
: documentName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
documentUrl:
|
||||
freezed == documentUrl
|
||||
? _value.documentUrl
|
||||
: documentUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
profileMatch:
|
||||
freezed == profileMatch
|
||||
? _value.profileMatch
|
||||
: profileMatch // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
incompleteResume:
|
||||
freezed == incompleteResume
|
||||
? _value.incompleteResume
|
||||
: incompleteResume // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
incompleteResumeReason:
|
||||
freezed == incompleteResumeReason
|
||||
? _value.incompleteResumeReason
|
||||
: incompleteResumeReason // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
)
|
||||
as $Val,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$TenderDetailResponseModelImplCopyWith<$Res>
|
||||
implements $TenderDetailResponseModelCopyWith<$Res> {
|
||||
factory _$$TenderDetailResponseModelImplCopyWith(
|
||||
_$TenderDetailResponseModelImpl value,
|
||||
$Res Function(_$TenderDetailResponseModelImpl) then,
|
||||
) = __$$TenderDetailResponseModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({
|
||||
String? date,
|
||||
String? status,
|
||||
String? title,
|
||||
String? id,
|
||||
String? approvalDate,
|
||||
String? submissionDate,
|
||||
String? client,
|
||||
String? deliveryLocation,
|
||||
String? referenceNumber,
|
||||
String? country,
|
||||
String? flagAsset,
|
||||
String? locationTitle,
|
||||
String? locationDescription,
|
||||
String? documentName,
|
||||
String? documentUrl,
|
||||
double? profileMatch,
|
||||
bool? incompleteResume,
|
||||
String? incompleteResumeReason,
|
||||
});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$TenderDetailResponseModelImplCopyWithImpl<$Res>
|
||||
extends
|
||||
_$TenderDetailResponseModelCopyWithImpl<
|
||||
$Res,
|
||||
_$TenderDetailResponseModelImpl
|
||||
>
|
||||
implements _$$TenderDetailResponseModelImplCopyWith<$Res> {
|
||||
__$$TenderDetailResponseModelImplCopyWithImpl(
|
||||
_$TenderDetailResponseModelImpl _value,
|
||||
$Res Function(_$TenderDetailResponseModelImpl) _then,
|
||||
) : super(_value, _then);
|
||||
|
||||
/// Create a copy of TenderDetailResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? date = freezed,
|
||||
Object? status = freezed,
|
||||
Object? title = freezed,
|
||||
Object? id = freezed,
|
||||
Object? approvalDate = freezed,
|
||||
Object? submissionDate = freezed,
|
||||
Object? client = freezed,
|
||||
Object? deliveryLocation = freezed,
|
||||
Object? referenceNumber = freezed,
|
||||
Object? country = freezed,
|
||||
Object? flagAsset = freezed,
|
||||
Object? locationTitle = freezed,
|
||||
Object? locationDescription = freezed,
|
||||
Object? documentName = freezed,
|
||||
Object? documentUrl = freezed,
|
||||
Object? profileMatch = freezed,
|
||||
Object? incompleteResume = freezed,
|
||||
Object? incompleteResumeReason = freezed,
|
||||
}) {
|
||||
return _then(
|
||||
_$TenderDetailResponseModelImpl(
|
||||
date:
|
||||
freezed == date
|
||||
? _value.date
|
||||
: date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
status:
|
||||
freezed == status
|
||||
? _value.status
|
||||
: status // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
title:
|
||||
freezed == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
id:
|
||||
freezed == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
approvalDate:
|
||||
freezed == approvalDate
|
||||
? _value.approvalDate
|
||||
: approvalDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
submissionDate:
|
||||
freezed == submissionDate
|
||||
? _value.submissionDate
|
||||
: submissionDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
client:
|
||||
freezed == client
|
||||
? _value.client
|
||||
: client // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
deliveryLocation:
|
||||
freezed == deliveryLocation
|
||||
? _value.deliveryLocation
|
||||
: deliveryLocation // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
referenceNumber:
|
||||
freezed == referenceNumber
|
||||
? _value.referenceNumber
|
||||
: referenceNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
country:
|
||||
freezed == country
|
||||
? _value.country
|
||||
: country // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
flagAsset:
|
||||
freezed == flagAsset
|
||||
? _value.flagAsset
|
||||
: flagAsset // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
locationTitle:
|
||||
freezed == locationTitle
|
||||
? _value.locationTitle
|
||||
: locationTitle // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
locationDescription:
|
||||
freezed == locationDescription
|
||||
? _value.locationDescription
|
||||
: locationDescription // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
documentName:
|
||||
freezed == documentName
|
||||
? _value.documentName
|
||||
: documentName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
documentUrl:
|
||||
freezed == documentUrl
|
||||
? _value.documentUrl
|
||||
: documentUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
profileMatch:
|
||||
freezed == profileMatch
|
||||
? _value.profileMatch
|
||||
: profileMatch // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
incompleteResume:
|
||||
freezed == incompleteResume
|
||||
? _value.incompleteResume
|
||||
: incompleteResume // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
incompleteResumeReason:
|
||||
freezed == incompleteResumeReason
|
||||
? _value.incompleteResumeReason
|
||||
: incompleteResumeReason // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class _$TenderDetailResponseModelImpl implements _TenderDetailResponseModel {
|
||||
const _$TenderDetailResponseModelImpl({
|
||||
required this.date,
|
||||
required this.status,
|
||||
required this.title,
|
||||
required this.id,
|
||||
required this.approvalDate,
|
||||
required this.submissionDate,
|
||||
required this.client,
|
||||
required this.deliveryLocation,
|
||||
required this.referenceNumber,
|
||||
required this.country,
|
||||
required this.flagAsset,
|
||||
required this.locationTitle,
|
||||
required this.locationDescription,
|
||||
required this.documentName,
|
||||
required this.documentUrl,
|
||||
required this.profileMatch,
|
||||
required this.incompleteResume,
|
||||
required this.incompleteResumeReason,
|
||||
});
|
||||
|
||||
factory _$TenderDetailResponseModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$TenderDetailResponseModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String? date;
|
||||
@override
|
||||
final String? status;
|
||||
@override
|
||||
final String? title;
|
||||
@override
|
||||
final String? id;
|
||||
@override
|
||||
final String? approvalDate;
|
||||
@override
|
||||
final String? submissionDate;
|
||||
@override
|
||||
final String? client;
|
||||
@override
|
||||
final String? deliveryLocation;
|
||||
@override
|
||||
final String? referenceNumber;
|
||||
@override
|
||||
final String? country;
|
||||
@override
|
||||
final String? flagAsset;
|
||||
@override
|
||||
final String? locationTitle;
|
||||
@override
|
||||
final String? locationDescription;
|
||||
@override
|
||||
final String? documentName;
|
||||
@override
|
||||
final String? documentUrl;
|
||||
@override
|
||||
final double? profileMatch;
|
||||
@override
|
||||
final bool? incompleteResume;
|
||||
@override
|
||||
final String? incompleteResumeReason;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TenderDetailResponseModel(date: $date, status: $status, title: $title, id: $id, approvalDate: $approvalDate, submissionDate: $submissionDate, client: $client, deliveryLocation: $deliveryLocation, referenceNumber: $referenceNumber, country: $country, flagAsset: $flagAsset, locationTitle: $locationTitle, locationDescription: $locationDescription, documentName: $documentName, documentUrl: $documentUrl, profileMatch: $profileMatch, incompleteResume: $incompleteResume, incompleteResumeReason: $incompleteResumeReason)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$TenderDetailResponseModelImpl &&
|
||||
(identical(other.date, date) || other.date == date) &&
|
||||
(identical(other.status, status) || other.status == status) &&
|
||||
(identical(other.title, title) || other.title == title) &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.approvalDate, approvalDate) ||
|
||||
other.approvalDate == approvalDate) &&
|
||||
(identical(other.submissionDate, submissionDate) ||
|
||||
other.submissionDate == submissionDate) &&
|
||||
(identical(other.client, client) || other.client == client) &&
|
||||
(identical(other.deliveryLocation, deliveryLocation) ||
|
||||
other.deliveryLocation == deliveryLocation) &&
|
||||
(identical(other.referenceNumber, referenceNumber) ||
|
||||
other.referenceNumber == referenceNumber) &&
|
||||
(identical(other.country, country) || other.country == country) &&
|
||||
(identical(other.flagAsset, flagAsset) ||
|
||||
other.flagAsset == flagAsset) &&
|
||||
(identical(other.locationTitle, locationTitle) ||
|
||||
other.locationTitle == locationTitle) &&
|
||||
(identical(other.locationDescription, locationDescription) ||
|
||||
other.locationDescription == locationDescription) &&
|
||||
(identical(other.documentName, documentName) ||
|
||||
other.documentName == documentName) &&
|
||||
(identical(other.documentUrl, documentUrl) ||
|
||||
other.documentUrl == documentUrl) &&
|
||||
(identical(other.profileMatch, profileMatch) ||
|
||||
other.profileMatch == profileMatch) &&
|
||||
(identical(other.incompleteResume, incompleteResume) ||
|
||||
other.incompleteResume == incompleteResume) &&
|
||||
(identical(other.incompleteResumeReason, incompleteResumeReason) ||
|
||||
other.incompleteResumeReason == incompleteResumeReason));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
date,
|
||||
status,
|
||||
title,
|
||||
id,
|
||||
approvalDate,
|
||||
submissionDate,
|
||||
client,
|
||||
deliveryLocation,
|
||||
referenceNumber,
|
||||
country,
|
||||
flagAsset,
|
||||
locationTitle,
|
||||
locationDescription,
|
||||
documentName,
|
||||
documentUrl,
|
||||
profileMatch,
|
||||
incompleteResume,
|
||||
incompleteResumeReason,
|
||||
);
|
||||
|
||||
/// Create a copy of TenderDetailResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$TenderDetailResponseModelImplCopyWith<_$TenderDetailResponseModelImpl>
|
||||
get copyWith => __$$TenderDetailResponseModelImplCopyWithImpl<
|
||||
_$TenderDetailResponseModelImpl
|
||||
>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$TenderDetailResponseModelImplToJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _TenderDetailResponseModel implements TenderDetailResponseModel {
|
||||
const factory _TenderDetailResponseModel({
|
||||
required final String? date,
|
||||
required final String? status,
|
||||
required final String? title,
|
||||
required final String? id,
|
||||
required final String? approvalDate,
|
||||
required final String? submissionDate,
|
||||
required final String? client,
|
||||
required final String? deliveryLocation,
|
||||
required final String? referenceNumber,
|
||||
required final String? country,
|
||||
required final String? flagAsset,
|
||||
required final String? locationTitle,
|
||||
required final String? locationDescription,
|
||||
required final String? documentName,
|
||||
required final String? documentUrl,
|
||||
required final double? profileMatch,
|
||||
required final bool? incompleteResume,
|
||||
required final String? incompleteResumeReason,
|
||||
}) = _$TenderDetailResponseModelImpl;
|
||||
|
||||
factory _TenderDetailResponseModel.fromJson(Map<String, dynamic> json) =
|
||||
_$TenderDetailResponseModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String? get date;
|
||||
@override
|
||||
String? get status;
|
||||
@override
|
||||
String? get title;
|
||||
@override
|
||||
String? get id;
|
||||
@override
|
||||
String? get approvalDate;
|
||||
@override
|
||||
String? get submissionDate;
|
||||
@override
|
||||
String? get client;
|
||||
@override
|
||||
String? get deliveryLocation;
|
||||
@override
|
||||
String? get referenceNumber;
|
||||
@override
|
||||
String? get country;
|
||||
@override
|
||||
String? get flagAsset;
|
||||
@override
|
||||
String? get locationTitle;
|
||||
@override
|
||||
String? get locationDescription;
|
||||
@override
|
||||
String? get documentName;
|
||||
@override
|
||||
String? get documentUrl;
|
||||
@override
|
||||
double? get profileMatch;
|
||||
@override
|
||||
bool? get incompleteResume;
|
||||
@override
|
||||
String? get incompleteResumeReason;
|
||||
|
||||
/// Create a copy of TenderDetailResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$TenderDetailResponseModelImplCopyWith<_$TenderDetailResponseModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'tender_detail_response_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$TenderDetailResponseModelImpl _$$TenderDetailResponseModelImplFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _$TenderDetailResponseModelImpl(
|
||||
date: json['date'] as String?,
|
||||
status: json['status'] as String?,
|
||||
title: json['title'] as String?,
|
||||
id: json['id'] as String?,
|
||||
approvalDate: json['approvalDate'] as String?,
|
||||
submissionDate: json['submissionDate'] as String?,
|
||||
client: json['client'] as String?,
|
||||
deliveryLocation: json['deliveryLocation'] as String?,
|
||||
referenceNumber: json['referenceNumber'] as String?,
|
||||
country: json['country'] as String?,
|
||||
flagAsset: json['flagAsset'] as String?,
|
||||
locationTitle: json['locationTitle'] as String?,
|
||||
locationDescription: json['locationDescription'] as String?,
|
||||
documentName: json['documentName'] as String?,
|
||||
documentUrl: json['documentUrl'] as String?,
|
||||
profileMatch: (json['profileMatch'] as num?)?.toDouble(),
|
||||
incompleteResume: json['incompleteResume'] as bool?,
|
||||
incompleteResumeReason: json['incompleteResumeReason'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$TenderDetailResponseModelImplToJson(
|
||||
_$TenderDetailResponseModelImpl instance,
|
||||
) => <String, dynamic>{
|
||||
'date': instance.date,
|
||||
'status': instance.status,
|
||||
'title': instance.title,
|
||||
'id': instance.id,
|
||||
'approvalDate': instance.approvalDate,
|
||||
'submissionDate': instance.submissionDate,
|
||||
'client': instance.client,
|
||||
'deliveryLocation': instance.deliveryLocation,
|
||||
'referenceNumber': instance.referenceNumber,
|
||||
'country': instance.country,
|
||||
'flagAsset': instance.flagAsset,
|
||||
'locationTitle': instance.locationTitle,
|
||||
'locationDescription': instance.locationDescription,
|
||||
'documentName': instance.documentName,
|
||||
'documentUrl': instance.documentUrl,
|
||||
'profileMatch': instance.profileMatch,
|
||||
'incompleteResume': instance.incompleteResume,
|
||||
'incompleteResumeReason': instance.incompleteResumeReason,
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:tm_app/core/utils/logger.dart';
|
||||
import 'package:tm_app/core/utils/result.dart';
|
||||
import 'package:tm_app/data/services/mock_data/tender_detail_mock.dart';
|
||||
import 'package:tm_app/data/services/model/tender_detail_request/tender_detail_request.dart';
|
||||
import 'package:tm_app/data/services/model/tender_detail_response/tender_detail_response_model.dart';
|
||||
import 'package:tm_app/data/services/network_manager.dart';
|
||||
|
||||
class TenderDetailService {
|
||||
TenderDetailService({required NetworkManager networkManager})
|
||||
: _networkManager = networkManager;
|
||||
|
||||
final NetworkManager _networkManager;
|
||||
|
||||
Future<Result<TenderDetailResponseModel>> getTenderDetail({
|
||||
required TenderDetailRequest request,
|
||||
}) async {
|
||||
try {
|
||||
await Future.delayed(const Duration(seconds: 2));
|
||||
appLogger.info('get tender detail success');
|
||||
|
||||
return Result.ok(
|
||||
TenderDetailResponseModel.fromJson(
|
||||
jsonDecode(tenderDetailMockData)['data'],
|
||||
),
|
||||
);
|
||||
} catch (e, stackTrace) {
|
||||
appLogger.error('get tender detail failed: $e', stackTrace: stackTrace);
|
||||
return Result.error(Exception(e));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user