import 'package:freezed_annotation/freezed_annotation.dart';

part 'kill_request_poultry.freezed.dart';
part 'kill_request_poultry.g.dart';

@freezed
abstract class KillRequestPoultry with _$KillRequestPoultry{
  const factory KillRequestPoultry({
    UserProfile? userprofile,
    Address? address,
    PoultryOwner? poultryOwner,
    PoultryTenant? poultryTenant,
    List<Hatching>? hatching,
    List<int>? registerVetHalls,
    Allow? allow,
    ProvinceAllowChooseKillHouse? provinceAllowChooseKillHouse,
    bool? provinceAllowSellFree,
    VetFarm? vetFarm,
    LastHatchingDifferentRequestQuantity? lastHatchingDiffrentRequestQuantity,
    UserBankInfo? userBankInfo,
    int? leftOverOwnHatching,
    String? key,
    bool? trash,
    int? ownerIdForeignKey,
    int? userIdForeignKey,
    int? addressIdForeignKey,
    bool? hasChainCompany,
    int? userBankIdForeignKey,
    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,
    String? hatchingDate,
    String? lastPartyDate,
    int? numberOfIncubators,
    int? herdAgeByDay,
    int? herdAgeByWeek,
    int? numberOfParty,
    String? communicationType,
    String? cooperative,
    String? dateOfRegister,
    String? unitStatus,
    bool? active,
    String? identityDocuments,
    String? samasatUserCode,
    int? baseOrder,
    String? incubationDate,
    int? walletAmount,
    int? city,
    int? cityNumber,
    String? cityName,
    int? provinceNumber,
    String? provinceName,
    int? walletIdForeignKey,
    int? poultryIdKey,
    double? lat,
    double? long,
    String? date,
    int? killingAveAge,
    int? activeLeftOver,
    int? killingAveCount,
    double? killingAveWeight,
    double? killingLiveWeight,
    double? killingCarcassesWeight,
    double? killingLossWeightPercent,
    double? realKillingAveWeight,
    double? realKillingLiveWeight,
    double? realKillingCarcassesWeight,
    double? realKillingLossWeightPercent,
    int? interestLicenseId,
    bool? orderLimit,
    int? owner,
    int? wallet,
  }) = _KillRequestPoultry;

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

@freezed
abstract class UserProfile with _$UserProfile {
  const factory UserProfile({
    String? userKey,
    int? baseOrder,
    String? fullName,
    String? mobile,
    String? city,
    String? province,
    String? breedingUniqueId,
  }) = _UserProfile;

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

@freezed
abstract class PoultryOwner with _$PoultryOwner {
  const factory PoultryOwner({
    String? fullName,
    String? mobile,
    String? unitName,
    int? numberOfHalls,
    String? breedingUniqueId,
  }) = _PoultryOwner;

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

@freezed
abstract class PoultryTenant with _$PoultryTenant {
  const factory PoultryTenant({
    String? key,
    String? firstName,
    String? lastName,
    String? fullName,
    String? mobile,
    String? nationalId,
    String? breedingUniqueId,
  }) = _PoultryTenant;

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

@freezed
abstract class Hatching with _$Hatching {
  const factory Hatching({
    String? poultryKey,
    String? poultryHatchingKey,
    String? poultry,
    int? quantity,
    int? losses,
    int? leftOver,
    double? outProvinceKilledQuantity,
    double? exportKilledQuantity,
    int? hall,
    String? date,
    int? period,
    String? state,
    int? age,
  }) = _Hatching;

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

@freezed
abstract class Allow with _$Allow {
  const factory Allow({
    bool? city,
    bool? province,
  }) = _Allow;

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

@freezed
abstract class ProvinceAllowChooseKillHouse with _$ProvinceAllowChooseKillHouse {
  const factory ProvinceAllowChooseKillHouse({
    bool? allowState,
    bool? mandatory,
  }) = _ProvinceAllowChooseKillHouse;

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

@freezed
abstract class VetFarm with _$VetFarm {
  const factory VetFarm({
    String? fullName,
    String? mobile,
    String? city,
    String? province,
  }) = _VetFarm;

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

@freezed
abstract class LastHatchingDifferentRequestQuantity
    with _$LastHatchingDifferentRequestQuantity {
  const factory LastHatchingDifferentRequestQuantity({
    double? leftExportQuantity,
    double? leftPoultryOutProvince,
    int? lastHatchingRemainQuantity,
  }) = _LastHatchingDifferentRequestQuantity;

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

@freezed
abstract class UserBankInfo with _$UserBankInfo {
  const factory UserBankInfo({
    String? key,
    String? nameOfBankUser,
    String? bankName,
    String? card,
    String? shaba,
    String? account,
    int? userBankIdKey,
    String? provinceName,
  }) = _UserBankInfo;

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