import 'package:freezed_annotation/freezed_annotation.dart';

part 'hatching_report.freezed.dart';
part 'hatching_report.g.dart';

@freezed
abstract class HatchingReport with _$HatchingReport {
  const factory HatchingReport({
    int? id,
    PoultryScience? poultryScience,
    Hatching? hatching,
    String? key,
    User? user,
    DateTime? createDate,
    DateTime? modifyDate,
    bool? trash,
    DateTime? date,
    List<String>? image,
    double? lat,
    double? log,
    String? reporterFullname,
    String? reporterMobile,
    String? state,
    double? realQuantityAi,
    String? messageAi,
    double? realQuantity,
    String? message,
    String? messageRegistererFullname,
    String? messageRegistererMobile,
    String? messageRegistererRole,
  }) = _HatchingReport;

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

@freezed
abstract class PoultryScience with _$PoultryScience {
  const factory PoultryScience({
    int? id,
    User? user,
    String? key,
    DateTime? createDate,
    DateTime? modifyDate,
    bool? trash,
    String? createdBy,
    String? modifiedBy,
    List<int>? poultry,
  }) = _PoultryScience;

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

@freezed
abstract  class User with _$User {
  const factory User({
    String? fullname,
    String? mobile,
  }) = _User;

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

@freezed
abstract  class Hatching with _$Hatching {
  const factory Hatching({
    int? id,
    Poultry? poultry,
    ChainCompany? chainCompany,
    int? age,
    String? inspectionLosses,
    VetFarm? vetFarm,
    ActiveKill? activeKill,
    KillingInfo? killingInfo,
    FreeGovernmentalInfo? freeGovernmentalInfo,
    ReportInfo? reportInfo,
    String? key,
    DateTime? createDate,
    DateTime? modifyDate,
    bool? trash,
    bool? hasChainCompany,
    String? poultryIdForeignKey,
    String? 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,
    String? predicateDate,
    String? chickenBreed,
    int? period,
    String? allowHatching,
    String? state,
    bool? archive,
    bool? violation,
    String? message,
    Registrar? registrar,
    List<Breed>? breed,
    int? cityNumber,
    String? cityName,
    int? provinceNumber,
    String? provinceName,
    LastChange? lastChange,
    int? chickenAge,
    int? nowAge,
    LatestHatchingChange? latestHatchingChange,
    String? violationReport,
    String? violationMessage,
    List<String>? violationImage,
    String? violationReporter,
    DateTime? violationReportDate,
    String? violationReportEditor,
    DateTime? violationReportEditDate,
    int? totalLosses,
    int? directLosses,
    String? directLossesInputer,
    String? directLossesDate,
    String? directLossesEditor,
    String? directLossesLastEditDate,
    String? endPeriodLossesInputer,
    String? endPeriodLossesDate,
    String? endPeriodLossesEditor,
    String? endPeriodLossesLastEditDate,
    String? breedingUniqueId,
    String? licenceNumber,
    bool? temporaryTrash,
    bool? temporaryDeleted,
    String? firstDateInputArchive,
    String? secondDateInputArchive,
    String? inputArchiver,
    String? outputArchiveDate,
    String? outputArchiver,
    double? barDifferenceRequestWeight,
    double? barDifferenceRequestQuantity,
    String? healthCertificate,
    double? samasatDischargePercentage,
    String? personTypeName,
    String? interactTypeName,
    String? unionTypeName,
    String? certId,
    int? increaseQuantity,
    String? tenantFullname,
    String? tenantNationalCode,
    String? tenantMobile,
    String? tenantCity,
    bool? hasTenant,
    String? archiveDate,
    String? createdBy,
    String? modifiedBy,
  }) = _Hatching;

  factory Hatching.fromJson(Map<String, dynamic> json) => _$HatchingFromJson(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 Registrar with _$Registrar {
  const factory Registrar({
    DateTime? date,
    String? role,
    String? fullname,
  }) = _Registrar;

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

@freezed
abstract class Poultry with _$Poultry {
  const factory Poultry({
    int? id,
    User? user,
    Address? address,
    String? key,
    bool? trash,
    int? ownerIdForeignKey,
    int? userIdForeignKey,
    int? addressIdForeignKey,
    bool? hasChainCompany,
    String? cityOperator,
    String? unitName,
    String? gisCode,
    int? operatingLicenceCapacity,
    int? numberOfHalls,
    bool? tenant,
    bool? hasTenant,
    String? personType,
    String? economicCode,
    String? systemCode,
    String? epidemiologicalCode,
    String? breedingUniqueId,
    int? totalCapacity,
    String? licenceNumber,
    String? healthCertificateNumber,
    int? numberOfRequests,
    DateTime? hatchingDate,
    DateTime? lastPartyDate,
    int? numberOfIncubators,
    int? herdAgeByDay,
    int? herdAgeByWeek,
    int? numberOfParty,
    String? communicationType,
    String? cooperative,
    DateTime? dateOfRegister,
    String? unitStatus,
    bool? active,
    String? identityDocuments,
    String? samasatUserCode,
    String? baseOrder,
    DateTime? incubationDate,
    double? walletAmount,
    int? city,
    int? cityNumber,
    String? cityName,
    int? provinceNumber,
    String? provinceName,
    double? lat,
    double? long,
    String? date,
    int? killingAveAge,
    double? activeLeftOver,
    int? killingAveCount,
    double? killingAveWeight,
    double? killingLiveWeight,
    double? killingCarcassesWeight,
    double? killingLossWeightPercent,
    double? realKillingAveWeight,
    double? realKillingLiveWeight,
    double? realKillingCarcassesWeight,
    double? realKillingLossWeightPercent,
    String? interestLicenceId,
    bool? orderLimit,
    int? owner,
    int? userBankInfo,
    int? wallet,
  }) = _Poultry;

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

@freezed
abstract class ChainCompany with _$ChainCompany {
  const factory ChainCompany({
    User? user,
    String? userBankInfo,
    String? key,
    bool? trash,
    String? name,
    String? city,
    String? province,
    String? postalCode,
    String? address,
    int? wallet,
  }) = _ChainCompany;

  factory ChainCompany.fromJson(Map<String, dynamic> json) => _$ChainCompanyFromJson(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,
    int? provinceKillRequestsWeight,
    int? killHouseRequests,
    int? killHouseRequestsFirstQuantity,
    int? killHouseRequestsFirstWeight,
    int? barCompleteWithKillHouse,
    int? acceptedRealQuantityFinal,
    int? acceptedRealWightFinal,
  }) = _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 ReportInfo with _$ReportInfo {
  const factory ReportInfo({
    bool? poultryScience,
    bool? image,
  }) = _ReportInfo;

  factory ReportInfo.fromJson(Map<String, dynamic> json) => _$ReportInfoFromJson(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);
}

@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 Address with _$Address {
  const factory Address({
    Province? province,
    City? city,
    String? address,
    String? postalCode,
  }) = _Address;

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

@freezed
abstract class Province with _$Province {
  const factory Province({
    String? key,
    String? name,
  }) = _Province;

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

@freezed
abstract class City with _$City {
  const factory City({
    String? key,
    String? name,
  }) = _City;

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