dde66521f6
- Introduced a .dockerignore file to optimize Docker builds by excluding unnecessary files. - Updated the Dockerfile to use a Flutter base image, enabling web builds for the application. - Added new data models for `Lot` and `OrganizationAddress` to represent tender details more accurately. - Enhanced the `Organization` model to include `companyId` and a nested `address` field. - Updated the `TenderData` model to include new fields such as `noticeTypeCode`, `formType`, and `lots`, reflecting the API response structure. - Regenerated necessary code for data models to ensure compatibility with the updated structures.
64 lines
2.9 KiB
Dart
64 lines
2.9 KiB
Dart
// ignore_for_file: invalid_annotation_target
|
|
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
import 'package:tm_app/core/utils/date_utils.dart';
|
|
import 'package:tm_app/data/services/model/lot/lot.dart';
|
|
import 'package:tm_app/data/services/model/organization/organization.dart';
|
|
|
|
part 'tender_data.freezed.dart';
|
|
part 'tender_data.g.dart';
|
|
|
|
// AI-NOTE (for PR reviewer): New fields were added to mirror the
|
|
// /tenders/details/:id response so the tender-details page can show them:
|
|
// notice_type_code, form_type, notice_language_code, issue_date, issue_time,
|
|
// lots, official_languages. issue_date/issue_time reuse unixTimestampFromJson
|
|
// (epoch seconds, tolerant of ms/string) like the other timestamp fields. All
|
|
// fields are nullable to stay resilient to partial API payloads. Freezed/json
|
|
// codegen (.freezed.dart/.g.dart) was regenerated for these.
|
|
@freezed
|
|
abstract class TenderData with _$TenderData {
|
|
const factory TenderData({
|
|
required bool? success,
|
|
required String? message,
|
|
required String? id,
|
|
@JsonKey(name: 'tender_id') required String? tenderId,
|
|
@JsonKey(name: 'notice_publication_id')
|
|
required String? noticePublicationId,
|
|
@JsonKey(name: 'notice_type_code') required String? noticeTypeCode,
|
|
@JsonKey(name: 'form_type') required String? formType,
|
|
@JsonKey(name: 'notice_language_code') required String? noticeLanguageCode,
|
|
@JsonKey(name: 'issue_date', fromJson: unixTimestampFromJson)
|
|
required int? issueDate,
|
|
@JsonKey(name: 'issue_time', fromJson: unixTimestampFromJson)
|
|
required int? issueTime,
|
|
@JsonKey(name: 'publication_date', fromJson: unixTimestampFromJson)
|
|
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,
|
|
@JsonKey(name: 'tender_deadline', fromJson: unixTimestampFromJson)
|
|
required int? tenderDeadline,
|
|
@JsonKey(name: 'submission_deadline', fromJson: unixTimestampFromJson)
|
|
required int? submissionDeadline,
|
|
@JsonKey(name: 'application_deadline', fromJson: unixTimestampFromJson)
|
|
required int? applicationDeadline,
|
|
@JsonKey(name: 'submission_url') required String? submissionUrl,
|
|
@JsonKey(name: 'country_code') required String? countryCode,
|
|
@JsonKey(name: 'duration_unit') required String? durationUnit,
|
|
@JsonKey(name: 'buyer_organization')
|
|
required Organization? buyerOrganization,
|
|
required List<Lot>? lots,
|
|
@JsonKey(name: 'official_languages')
|
|
required List<String>? officialLanguages,
|
|
required String? status,
|
|
}) = _TenderData;
|
|
|
|
factory TenderData.fromJson(Map<String, Object?> json) =>
|
|
_$TenderDataFromJson(json);
|
|
}
|