// 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: 'tender_id') required String? tenderId,
    @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,
    @JsonKey(name: 'tender_deadline') required int? tenderDeadline,
    @JsonKey(name: 'submission_deadline') required int? submissionDeadline,
    @JsonKey(name: 'application_deadline') 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 String? status,
  }) = _TenderData;

  factory TenderData.fromJson(Map<String, Object?> json) =>
      _$TenderDataFromJson(json);
}
