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,
    String? createDate,
    String? modifyDate,
    bool? trash,
    String? date,
    List<String>? image,
    double? lat,
    double? log,
    String? reporterFullname,
    String? reporterMobile,
    String? createdBy,
    String? modifiedBy,
  }) = _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,
    String? createDate,
    String? 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({
    Poultry? poultry,
    GeneralInfo? generalInfo,
    String? chickenBreed,
    String? date,
    int? quantity,
    int? leftOver,
    int? period,
    int? losses,
    bool? violation,
    String? licenceNumber,
    int? chickenAge,
    VetFarm? vetFarm,
  }) = _Hatching;

  factory Hatching.fromJson(Map<String, dynamic> json) => _$HatchingFromJson(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 Poultry with _$Poultry {
  const factory Poultry({
    String? key,
    String? fullname,
    String? mobile,
    String? city,
    String? unitName,
    int? killingAveAge,
    int? activeLeftOver,
    int? killingAveCount,
    double? realKillingAveWeight,
    double? realKillingLiveWeight,
    double? realKillingCarcassesWeight,
    double? realKillingLossWeightPercent,
  }) = _Poultry;

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

@freezed
abstract class GeneralInfo with _$GeneralInfo {
  const factory GeneralInfo({
    int? aveAge,
    int? age,
    double? aveWeight,
    int? provinceKillRequests,
    int? provinceKillRequestsQuantity,
    double? provinceKillRequestsWeight,
    int? killHouseRequestsQuantity,
    int? killHouseRequests,
    double? killHouseRequestsWeight,
    int? totalQuantity,
    double? totalWeight,
  }) = _GeneralInfo;

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