// ignore_for_file: invalid_annotation_target

import 'package:freezed_annotation/freezed_annotation.dart';

part 'tender_approvals_stats_data.freezed.dart';
part 'tender_approvals_stats_data.g.dart';

@freezed
abstract class TenderApprovalsStatsData with _$TenderApprovalsStatsData {
  @JsonSerializable(explicitToJson: true)
  const factory TenderApprovalsStatsData({
    @JsonKey(name: 'company_id') required String? companyId,
    @JsonKey(name: 'total_approvals') required int? totalApprovals,
    @JsonKey(name: 'submitted_tenders') required int? submittedTenders,
    @JsonKey(name: 'rejected_tenders') required int? rejectedTenders,
    @JsonKey(name: 'self_apply_count') required int? selfApplyCount,
    @JsonKey(name: 'partnership_count') required int? partnershipCount,
    @JsonKey(name: 'approvals_by_status')
    required ApprovalsByStatus? approvalsByStatus,
    @JsonKey(name: 'approvals_by_submission')
    required ApprovalsBySubmission? approvalsBySubmission,
    @JsonKey(name: 'last_updated') required int? lastUpdated,
  }) = _TenderApprovalsStatsData;

  factory TenderApprovalsStatsData.fromJson(Map<String, dynamic> json) =>
      _$TenderApprovalsStatsDataFromJson(json);
}

@freezed
abstract class ApprovalsByStatus with _$ApprovalsByStatus {
  const factory ApprovalsByStatus({
    @JsonKey(name: 'submitted') required int? submitted,
    @JsonKey(name: 'rejected') required int? rejected,
  }) = _ApprovalsByStatus;

  factory ApprovalsByStatus.fromJson(Map<String, dynamic> json) =>
      _$ApprovalsByStatusFromJson(json);
}

@freezed
abstract class ApprovalsBySubmission with _$ApprovalsBySubmission {
  const factory ApprovalsBySubmission({
    @JsonKey(name: 'partnership') required int? partnership,
    @JsonKey(name: 'self-apply') required int? selfApply,
  }) = _ApprovalsBySubmission;

  factory ApprovalsBySubmission.fromJson(Map<String, dynamic> json) =>
      _$ApprovalsBySubmissionFromJson(json);
}
