import 'package:freezed_annotation/freezed_annotation.dart';

part 'poultry_farm.freezed.dart';
part 'poultry_farm.g.dart';

@freezed
abstract class PoultryFarm with _$PoultryFarm {
  const factory PoultryFarm({
    int? id,
    User? user,
    Address? address,
    List<dynamic>? hatching,
    VetFarm? vetFarm,
    String? key,
    bool? trash,
    int? ownerIdForeignKey,
    int? userIdForeignKey,
    int? addressIdForeignKey,
    bool? hasChainCompany,
    int? userBankIdForeignKey,
    dynamic cityOperator,
    String? unitName,
    String? gisCode,
    int? operatingLicenceCapacity,
    int? numberOfHalls,
    bool? tenant,
    bool? hasTenant,
    dynamic personType,
    dynamic 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,
    dynamic communicationType,
    dynamic cooperative,
    String? dateOfRegister,
    dynamic unitStatus,
    bool? active,
    dynamic identityDocuments,
    dynamic samasatUserCode,
    dynamic baseOrder,
    String? incubationDate,
    int? walletAmount,
    int? city,
    int? cityNumber,
    String? cityName,
    int? provinceNumber,
    String? provinceName,
    int? walletIdForeignKey,
    int? poultryIdKey,
    double? lat,
    double? long,
    dynamic date,
    int? killingAveAge,
    int? activeLeftOver,
    int? killingAveCount,
    int? killingAveWeight,
    int? killingLiveWeight,
    int? killingCarcassesWeight,
    int? killingLossWeightPercent,
    double? realKillingAveWeight,
    double? realKillingLiveWeight,
    double? realKillingCarcassesWeight,
    double? realKillingLossWeightPercent,
    dynamic interestLicenseId,
    bool? orderLimit,
    dynamic owner,
    dynamic userBankInfo,
    int? wallet,
    HatchingInfo? hatchingInfo,
  }) = _PoultryFarm;

  factory PoultryFarm.fromJson(Map<String, dynamic> json) =>
      _$PoultryFarmFromJson(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 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 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 HatchingInfo with _$HatchingInfo{
  const factory HatchingInfo({
    int? period,
    bool? activeHatching,
  }) = _HatchingInfo;

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