feat : farms in poultry science
This commit is contained in:
@@ -0,0 +1,151 @@
|
||||
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);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,238 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'poultry_farm.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_PoultryFarm _$PoultryFarmFromJson(Map<String, dynamic> json) => _PoultryFarm(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
address: json['address'] == null
|
||||
? null
|
||||
: Address.fromJson(json['address'] as Map<String, dynamic>),
|
||||
hatching: json['hatching'] as List<dynamic>?,
|
||||
vetFarm: json['vet_farm'] == null
|
||||
? null
|
||||
: VetFarm.fromJson(json['vet_farm'] as Map<String, dynamic>),
|
||||
key: json['key'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
ownerIdForeignKey: (json['owner_id_foreign_key'] as num?)?.toInt(),
|
||||
userIdForeignKey: (json['user_id_foreign_key'] as num?)?.toInt(),
|
||||
addressIdForeignKey: (json['address_id_foreign_key'] as num?)?.toInt(),
|
||||
hasChainCompany: json['has_chain_company'] as bool?,
|
||||
userBankIdForeignKey: (json['user_bank_id_foreign_key'] as num?)?.toInt(),
|
||||
cityOperator: json['city_operator'],
|
||||
unitName: json['unit_name'] as String?,
|
||||
gisCode: json['gis_code'] as String?,
|
||||
operatingLicenceCapacity: (json['operating_licence_capacity'] as num?)
|
||||
?.toInt(),
|
||||
numberOfHalls: (json['number_of_halls'] as num?)?.toInt(),
|
||||
tenant: json['tenant'] as bool?,
|
||||
hasTenant: json['has_tenant'] as bool?,
|
||||
personType: json['person_type'],
|
||||
economicCode: json['economic_code'],
|
||||
systemCode: json['system_code'] as String?,
|
||||
epidemiologicalCode: json['epidemiological_code'] as String?,
|
||||
breedingUniqueId: json['breeding_unique_id'] as String?,
|
||||
totalCapacity: (json['total_capacity'] as num?)?.toInt(),
|
||||
licenceNumber: json['licence_number'] as String?,
|
||||
healthCertificateNumber: json['health_certificate_number'] as String?,
|
||||
numberOfRequests: (json['number_of_requests'] as num?)?.toInt(),
|
||||
hatchingDate: json['hatching_date'] as String?,
|
||||
lastPartyDate: json['last_party_date'] as String?,
|
||||
numberOfIncubators: (json['number_of_incubators'] as num?)?.toInt(),
|
||||
herdAgeByDay: (json['herd_age_by_day'] as num?)?.toInt(),
|
||||
herdAgeByWeek: (json['herd_age_by_week'] as num?)?.toInt(),
|
||||
numberOfParty: (json['number_of_party'] as num?)?.toInt(),
|
||||
communicationType: json['communication_type'],
|
||||
cooperative: json['cooperative'],
|
||||
dateOfRegister: json['date_of_register'] as String?,
|
||||
unitStatus: json['unit_status'],
|
||||
active: json['active'] as bool?,
|
||||
identityDocuments: json['identity_documents'],
|
||||
samasatUserCode: json['samasat_user_code'],
|
||||
baseOrder: json['base_order'],
|
||||
incubationDate: json['incubation_date'] as String?,
|
||||
walletAmount: (json['wallet_amount'] as num?)?.toInt(),
|
||||
city: (json['city'] as num?)?.toInt(),
|
||||
cityNumber: (json['city_number'] as num?)?.toInt(),
|
||||
cityName: json['city_name'] as String?,
|
||||
provinceNumber: (json['province_number'] as num?)?.toInt(),
|
||||
provinceName: json['province_name'] as String?,
|
||||
walletIdForeignKey: (json['wallet_id_foreign_key'] as num?)?.toInt(),
|
||||
poultryIdKey: (json['poultry_id_key'] as num?)?.toInt(),
|
||||
lat: (json['lat'] as num?)?.toDouble(),
|
||||
long: (json['long'] as num?)?.toDouble(),
|
||||
date: json['date'],
|
||||
killingAveAge: (json['killing_ave_age'] as num?)?.toInt(),
|
||||
activeLeftOver: (json['active_left_over'] as num?)?.toInt(),
|
||||
killingAveCount: (json['killing_ave_count'] as num?)?.toInt(),
|
||||
killingAveWeight: (json['killing_ave_weight'] as num?)?.toInt(),
|
||||
killingLiveWeight: (json['killing_live_weight'] as num?)?.toInt(),
|
||||
killingCarcassesWeight: (json['killing_carcasses_weight'] as num?)?.toInt(),
|
||||
killingLossWeightPercent: (json['killing_loss_weight_percent'] as num?)
|
||||
?.toInt(),
|
||||
realKillingAveWeight: (json['real_killing_ave_weight'] as num?)?.toDouble(),
|
||||
realKillingLiveWeight: (json['real_killing_live_weight'] as num?)?.toDouble(),
|
||||
realKillingCarcassesWeight: (json['real_killing_carcasses_weight'] as num?)
|
||||
?.toDouble(),
|
||||
realKillingLossWeightPercent:
|
||||
(json['real_killing_loss_weight_percent'] as num?)?.toDouble(),
|
||||
interestLicenseId: json['interest_license_id'],
|
||||
orderLimit: json['order_limit'] as bool?,
|
||||
owner: json['owner'],
|
||||
userBankInfo: json['user_bank_info'],
|
||||
wallet: (json['wallet'] as num?)?.toInt(),
|
||||
hatchingInfo: json['hatching_info'] == null
|
||||
? null
|
||||
: HatchingInfo.fromJson(json['hatching_info'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PoultryFarmToJson(_PoultryFarm instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'user': instance.user,
|
||||
'address': instance.address,
|
||||
'hatching': instance.hatching,
|
||||
'vet_farm': instance.vetFarm,
|
||||
'key': instance.key,
|
||||
'trash': instance.trash,
|
||||
'owner_id_foreign_key': instance.ownerIdForeignKey,
|
||||
'user_id_foreign_key': instance.userIdForeignKey,
|
||||
'address_id_foreign_key': instance.addressIdForeignKey,
|
||||
'has_chain_company': instance.hasChainCompany,
|
||||
'user_bank_id_foreign_key': instance.userBankIdForeignKey,
|
||||
'city_operator': instance.cityOperator,
|
||||
'unit_name': instance.unitName,
|
||||
'gis_code': instance.gisCode,
|
||||
'operating_licence_capacity': instance.operatingLicenceCapacity,
|
||||
'number_of_halls': instance.numberOfHalls,
|
||||
'tenant': instance.tenant,
|
||||
'has_tenant': instance.hasTenant,
|
||||
'person_type': instance.personType,
|
||||
'economic_code': instance.economicCode,
|
||||
'system_code': instance.systemCode,
|
||||
'epidemiological_code': instance.epidemiologicalCode,
|
||||
'breeding_unique_id': instance.breedingUniqueId,
|
||||
'total_capacity': instance.totalCapacity,
|
||||
'licence_number': instance.licenceNumber,
|
||||
'health_certificate_number': instance.healthCertificateNumber,
|
||||
'number_of_requests': instance.numberOfRequests,
|
||||
'hatching_date': instance.hatchingDate,
|
||||
'last_party_date': instance.lastPartyDate,
|
||||
'number_of_incubators': instance.numberOfIncubators,
|
||||
'herd_age_by_day': instance.herdAgeByDay,
|
||||
'herd_age_by_week': instance.herdAgeByWeek,
|
||||
'number_of_party': instance.numberOfParty,
|
||||
'communication_type': instance.communicationType,
|
||||
'cooperative': instance.cooperative,
|
||||
'date_of_register': instance.dateOfRegister,
|
||||
'unit_status': instance.unitStatus,
|
||||
'active': instance.active,
|
||||
'identity_documents': instance.identityDocuments,
|
||||
'samasat_user_code': instance.samasatUserCode,
|
||||
'base_order': instance.baseOrder,
|
||||
'incubation_date': instance.incubationDate,
|
||||
'wallet_amount': instance.walletAmount,
|
||||
'city': instance.city,
|
||||
'city_number': instance.cityNumber,
|
||||
'city_name': instance.cityName,
|
||||
'province_number': instance.provinceNumber,
|
||||
'province_name': instance.provinceName,
|
||||
'wallet_id_foreign_key': instance.walletIdForeignKey,
|
||||
'poultry_id_key': instance.poultryIdKey,
|
||||
'lat': instance.lat,
|
||||
'long': instance.long,
|
||||
'date': instance.date,
|
||||
'killing_ave_age': instance.killingAveAge,
|
||||
'active_left_over': instance.activeLeftOver,
|
||||
'killing_ave_count': instance.killingAveCount,
|
||||
'killing_ave_weight': instance.killingAveWeight,
|
||||
'killing_live_weight': instance.killingLiveWeight,
|
||||
'killing_carcasses_weight': instance.killingCarcassesWeight,
|
||||
'killing_loss_weight_percent': instance.killingLossWeightPercent,
|
||||
'real_killing_ave_weight': instance.realKillingAveWeight,
|
||||
'real_killing_live_weight': instance.realKillingLiveWeight,
|
||||
'real_killing_carcasses_weight': instance.realKillingCarcassesWeight,
|
||||
'real_killing_loss_weight_percent': instance.realKillingLossWeightPercent,
|
||||
'interest_license_id': instance.interestLicenseId,
|
||||
'order_limit': instance.orderLimit,
|
||||
'owner': instance.owner,
|
||||
'user_bank_info': instance.userBankInfo,
|
||||
'wallet': instance.wallet,
|
||||
'hatching_info': instance.hatchingInfo,
|
||||
};
|
||||
|
||||
_User _$UserFromJson(Map<String, dynamic> json) => _User(
|
||||
fullname: json['fullname'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
|
||||
'fullname': instance.fullname,
|
||||
'mobile': instance.mobile,
|
||||
};
|
||||
|
||||
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
|
||||
province: json['province'] == null
|
||||
? null
|
||||
: Province.fromJson(json['province'] as Map<String, dynamic>),
|
||||
city: json['city'] == null
|
||||
? null
|
||||
: City.fromJson(json['city'] as Map<String, dynamic>),
|
||||
address: json['address'] as String?,
|
||||
postalCode: json['postal_code'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AddressToJson(_Address instance) => <String, dynamic>{
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'address': instance.address,
|
||||
'postal_code': instance.postalCode,
|
||||
};
|
||||
|
||||
_Province _$ProvinceFromJson(Map<String, dynamic> json) =>
|
||||
_Province(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$ProvinceToJson(_Province instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_City _$CityFromJson(Map<String, dynamic> json) =>
|
||||
_City(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$CityToJson(_City instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_VetFarm _$VetFarmFromJson(Map<String, dynamic> json) => _VetFarm(
|
||||
fullName: json['full_name'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
city: json['city'] as String?,
|
||||
province: json['province'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$VetFarmToJson(_VetFarm instance) => <String, dynamic>{
|
||||
'full_name': instance.fullName,
|
||||
'mobile': instance.mobile,
|
||||
'city': instance.city,
|
||||
'province': instance.province,
|
||||
};
|
||||
|
||||
_HatchingInfo _$HatchingInfoFromJson(Map<String, dynamic> json) =>
|
||||
_HatchingInfo(
|
||||
period: (json['period'] as num?)?.toInt(),
|
||||
activeHatching: json['active_hatching'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$HatchingInfoToJson(_HatchingInfo instance) =>
|
||||
<String, dynamic>{
|
||||
'period': instance.period,
|
||||
'active_hatching': instance.activeHatching,
|
||||
};
|
||||
Reference in New Issue
Block a user