import 'package:freezed_annotation/freezed_annotation.dart';

part 'hatching_models.freezed.dart';
part 'hatching_models.g.dart';

@freezed
abstract class HatchingModel with _$HatchingModel{
  const factory HatchingModel({
    int? id,
    Poultry? poultry,
    ChainCompany? chainCompany,
    num? age,
    dynamic inspectionLosses,
    VetFarm? vetFarm,
    ActiveKill? activeKill,
    KillingInfo? killingInfo,
    FreeGovernmentalInfo? freeGovernmentalInfo,
    ReportInfo? reportInfo,
    String? key,
    String? createDate,
    String? modifyDate,
    bool? trash,
    bool? hasChainCompany,
    int? poultryIdForeignKey,
    int? poultryHatchingIdKey,
    num? quantity,
    num? losses,
    num? leftOver,
    num? killedQuantity,
    num? extraKilledQuantity,
    num? governmentalKilledQuantity,
    num? governmentalQuantity,
    num? freeKilledQuantity,
    num? freeQuantity,
    num? chainKilledQuantity,
    num? chainKilledWeight,
    num? outProvinceKilledWeight,
    num? outProvinceKilledQuantity,
    num? exportKilledWeight,
    num? exportKilledQuantity,
    num? totalCommitment,
    String? commitmentType,
    num? totalCommitmentQuantity,
    num? totalFreeCommitmentQuantity,
    num? totalFreeCommitmentWeight,
    num? totalKilledWeight,
    num? totalAverageKilledWeight,
    num? requestLeftOver,
    num? hall,
    String? date,
    String? predicateDate,
    String? chickenBreed,
    num? period,
    String? allowHatching,
    String? state,
    bool? archive,
    bool? violation,
    String? message,
    Registrar? registrar,
    List<BreedItem>? breed,
    num? cityNumber,
    String? cityName,
    num? provinceNumber,
    String? provinceName,
    LastChange? lastChange,
    num? chickenAge,
    num? nowAge,
    LatestHatchingChange? latestHatchingChange,
    String? violationReport,
    String? violationMessage,
    List<String>? violationImage,
    String? violationReporter,
    String? violationReportDate,
    String? violationReportEditor,
    String? violationReportEditDate,
    num? totalLosses,
    num? 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,
    num? barDifferenceRequestWeight,
    num? barDifferenceRequestQuantity,
    String? healthCertificate,
    num? samasatDischargePercentage,
    String? personTypeName,
    String? interactTypeName,
    String? unionTypeName,
    String? certId,
    num? increaseQuantity,
    String? tenantFullname,
    String? tenantNationalCode,
    String? tenantMobile,
    String? tenantCity,
    bool? hasTenant,
    String? archiveDate,
    String? createdBy,
    String? modifiedBy,
  }) = _HatchingModel;

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

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

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

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

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

@freezed
abstract class PoultryAddress with _$PoultryAddress {
  const factory PoultryAddress({
    ProvinceRef? province,
    CityRef? city,
    String? address,
    String? postalCode,
  }) = _PoultryAddress;

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

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

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

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

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

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

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

@freezed
abstract class ChainUser with _$ChainUser {
  const factory ChainUser({
    List<String>? role,
    String? city,
    String? province,
    String? key,
    String? userGateWayId,
    int? userDjangoIdForeignKey,
    int? provinceIdForeignKey,
    int? cityIdForeignKey,
    int? systemUserProfileIdKey,
    String? fullname,
    String? firstName,
    String? lastName,
    String? nationalCode,
    String? nationalCodeImage,
    String? nationalId,
    String? mobile,
    String? birthday,
    String? image,
    String? password,
    bool? active,
    ChainUserState? state,
    num? baseOrder,
    num? cityNumber,
    String? cityName,
    num? provinceNumber,
    String? provinceName,
    String? unitName,
    String? unitNationalId,
    String? unitRegistrationNumber,
    String? unitEconomicalNumber,
    String? unitProvince,
    String? unitCity,
    String? unitPostalCode,
    String? unitAddress,
  }) = _ChainUser;

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

@freezed
abstract class ChainUserState with _$ChainUserState {
  const factory ChainUserState({
    String? city,
    String? image,
    String? mobile,
    String? birthday,
    String? province,
    String? lastName,
    String? firstName,
    String? nationalId,
    String? nationalCode,
  }) = _ChainUserState;

  factory ChainUserState.fromJson(Map<String, dynamic> json) => _$ChainUserStateFromJson(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,
    num? countOfRequest,
  }) = _ActiveKill;

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

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

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

@freezed
abstract class FreeGovernmentalInfo with _$FreeGovernmentalInfo {
  const factory FreeGovernmentalInfo({
    num? governmentalAllocatedQuantity,
    num? totalCommitmentQuantity,
    num? freeAllocatedQuantity,
    num? totalFreeCommitmentQuantity,
    num? 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({
    String? date,
    String? role,
    String? fullName,
  }) = _LatestHatchingChange;

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

@freezed
abstract class Registrar with _$Registrar {
  const factory Registrar({
    String? date,
    String? role,
    String? fullname,
  }) = _Registrar;

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

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

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

@freezed
abstract class BreedItem with _$BreedItem {
  const factory BreedItem({
    String? breed,
    num? mainQuantity,
    num? remainQuantity,
  }) = _BreedItem;

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

