import 'package:freezed_annotation/freezed_annotation.dart';

part 'hatching_details.freezed.dart';
part 'hatching_details.g.dart';

@freezed
abstract class HatchingDetails with _$HatchingDetails {
  const factory HatchingDetails({
     int? id,
    String? chainCompany,
    int? age,
    dynamic inspectionLosses,
    VetFarm? vetFarm,
    ActiveKill? activeKill,
    KillingInfo? killingInfo,
    FreeGovernmentalInfo? freeGovernmentalInfo,
    String? key,
    DateTime? createDate,
    DateTime? modifyDate,
    bool? trash,
    bool? hasChainCompany,
    dynamic poultryIdForeignKey,
    dynamic poultryHatchingIdKey,
    int? quantity,
    int? losses,
    int? leftOver,
    int? killedQuantity,
    int? extraKilledQuantity,
    double? governmentalKilledQuantity,
    double? governmentalQuantity,
    double? freeKilledQuantity,
    double? freeQuantity,
    double? chainKilledQuantity,
    double? chainKilledWeight,
    double? outProvinceKilledWeight,
    double? outProvinceKilledQuantity,
    double? exportKilledWeight,
    double? exportKilledQuantity,
    double? totalCommitment,
    String? commitmentType,
    double? totalCommitmentQuantity,
    double? totalFreeCommitmentQuantity,
    double? totalFreeCommitmentWeight,
    double? totalKilledWeight,
    double? totalAverageKilledWeight,
    int? requestLeftOver,
    int? hall,
    DateTime? date,
    DateTime? predicateDate,
    String? chickenBreed,
    int? period,
    String? allowHatching,
    String? state,
    bool? archive,
    bool? violation,
    dynamic message,
    dynamic registrar,
    List<Breed>? breed,
    int? cityNumber,
    String? cityName,
    int? provinceNumber,
    String? provinceName,
    LastChange? lastChange,
    int? chickenAge,
    int? nowAge,
    LatestHatchingChange? latestHatchingChange,
    dynamic violationReport,
    String? violationMessage,
    dynamic violationImage,
    dynamic violationReporter,
    dynamic violationReportDate,
    dynamic violationReportEditor,
    dynamic violationReportEditDate,
    int? totalLosses,
    int? directLosses,
    dynamic directLossesInputer,
    dynamic directLossesDate,
    dynamic directLossesEditor,
    dynamic directLossesLastEditDate,
    dynamic endPeriodLossesInputer,
    dynamic endPeriodLossesDate,
    dynamic endPeriodLossesEditor,
    dynamic endPeriodLossesLastEditDate,
    String? breedingUniqueId,
    String? licenceNumber,
    bool? temporaryTrash,
    bool? temporaryDeleted,
    dynamic firstDateInputArchive,
    dynamic secondDateInputArchive,
    dynamic inputArchiver,
    dynamic outputArchiveDate,
    dynamic outputArchiver,
    double? barDifferenceRequestWeight,
    double? barDifferenceRequestQuantity,
    dynamic healthCertificate,
    int? samasatDischargePercentage,
    String? personTypeName,
    String? interactTypeName,
    String? unionTypeName,
    String? certId,
    int? increaseQuantity,
    dynamic tenantFullname,
    dynamic tenantNationalCode,
    dynamic tenantMobile,
    dynamic tenantCity,
    bool? hasTenant,
    dynamic createdBy,
    dynamic modifiedBy,
    int? poultry,
  }) = _HatchingDetails;

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

@freezed
abstract class VetFarm with _$VetFarm {
  const factory VetFarm({
    String? vetFarmFullName,
    String? vetFarmMobile,
  }) = _VetFarm;

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

@freezed
abstract class ActiveKill with _$ActiveKill {
  const factory ActiveKill({
    bool? activeKill,
    int? countOfRequest,
  }) = _ActiveKill;

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

@freezed
abstract class KillingInfo with _$KillingInfo {
  const factory KillingInfo({
    String? violationMessage,
    int? provinceKillRequests,
    int? provinceKillRequestsQuantity,
    double? provinceKillRequestsWeight,
    int? killHouseRequests,
    int? killHouseRequestsFirstQuantity,
    double? killHouseRequestsFirstWeight,
    int? barCompleteWithKillHouse,
    int? acceptedRealQuantityFinal,
    double? acceptedRealWightFinal,
    int? wareHouseBars,
    int? wareHouseBarsQuantity,
    double? wareHouseBarsWeight,
    double? wareHouseBarsWeightLose,
  }) = _KillingInfo;

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

@freezed
abstract class FreeGovernmentalInfo with _$FreeGovernmentalInfo {
  const factory FreeGovernmentalInfo({
    int? governmentalAllocatedQuantity,
    double? totalCommitmentQuantity,
    int? freeAllocatedQuantity,
    double? totalFreeCommitmentQuantity,
    int? leftTotalFreeCommitmentQuantity,
  }) = _FreeGovernmentalInfo;

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

@freezed
abstract class Breed with _$Breed {
  const factory Breed({
    String? breed,
    int? mainQuantity,
    int? remainQuantity,
  }) = _Breed;

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

@freezed
abstract class LastChange with _$LastChange {
  const factory LastChange({
    DateTime? date,
    String? role,
    String? type,
    String? fullName,
  }) = _LastChange;

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

@freezed
abstract class LatestHatchingChange with _$LatestHatchingChange {
  const factory LatestHatchingChange({
    DateTime? date,
    String? role,
    String? fullName,
  }) = _LatestHatchingChange;

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