import 'package:rasadyar_core/core.dart';

part 'all_poultry.freezed.dart';
part 'all_poultry.g.dart';

@freezed
abstract class AllPoultry with _$AllPoultry {
  const factory AllPoultry({
    User? user,
    String? key,
    String? unitName,
    Address? address,
    int? lastHatchingRemainQuantity,
    bool? provinceAllowSellFree,
    ChainCompany? chainCompany,
  }) = _AllPoultry;

  factory AllPoultry.fromJson(Map<String, dynamic> json) =>
      _$AllPoultryFromJson(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({
    City? city,
  }) = _Address;

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

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

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

@freezed
abstract class ChainCompany with _$ChainCompany {
  const factory ChainCompany({
    bool? chainCompany,
    String? hatchingKey,
  }) = _ChainCompany;

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