import 'package:freezed_annotation/freezed_annotation.dart';

part 'imported_loads_model.freezed.dart';
part 'imported_loads_model.g.dart';

@freezed
abstract class ImportedLoadsModel with _$ImportedLoadsModel {
  const factory ImportedLoadsModel({
    int? count,
    String? next,
    String? previous,
    List<ImportedLoad>? results,
  }) = _ImportedLoadsModel;

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

@freezed
abstract class ImportedLoad with _$ImportedLoad {
  const factory ImportedLoad({
    int? id,
    Product? product,
    KillHouse? killHouse,
    dynamic toKillHouse,
    dynamic steward,
    ToSteward? toSteward,
    dynamic guilds,
    dynamic toGuilds,
    dynamic toColdHouse,
    int? indexWeight,
    int? dateTimestamp,
    int? newState,
    int? newReceiverState,
    int? newAllocationState,
    String? key,
    String? createDate,
    String? modifyDate,
    bool? trash,
    int? numberOfCarcasses,
    int? realNumberOfCarcasses,
    int? receiverRealNumberOfCarcasses,
    double? weightOfCarcasses,
    double? realWeightOfCarcasses,
    double? receiverRealWeightOfCarcasses,
    double? weightLossOfCarcasses,
    bool? finalRegistration,
    String? sellType,
    String? productName,
    String? sellerType,
    String? type,
    String? saleType,
    String? allocationType,
    bool? systemRegistrationCode,
    int? registrationCode,
    int? amount,
    int? totalAmount,
    int? totalAmountPaid,
    int? totalAmountRemain,
    dynamic loggedRegistrationCode,
    String? state,
    String? receiverState,
    String? allocationState,
    String? date,
    dynamic role,
    dynamic stewardTempKey,
    bool? approvedPriceStatus,
    bool? calculateStatus,
    bool? temporaryTrash,
    bool? temporaryDeleted,
    dynamic createdBy,
    dynamic modifiedBy,
    dynamic wareHouse,
    dynamic stewardWareHouse,
    dynamic car,
    dynamic dispenser,
  }) = _ImportedLoad;

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

@freezed
abstract class Product with _$Product {
  const factory Product({
    double? weightAverage,
  }) = _Product;

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

@freezed
abstract class KillHouse with _$KillHouse {
  const factory KillHouse({
    String? key,
    KillHouseOperator? killHouseOperator,
    String? name,
    bool? killer,
  }) = _KillHouse;

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

@freezed
abstract class KillHouseOperator with _$KillHouseOperator {
  const factory KillHouseOperator({
    User? user,
  }) = _KillHouseOperator;

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

@freezed
abstract class User with _$User {
  const factory User({
    String? fullname,
    String? firstName,
    String? lastName,
    int? baseOrder,
    String? mobile,
    String? nationalId,
    String? nationalCode,
    String? key,
    City? city,
    String? unitName,
    String? unitNationalId,
    String? unitRegistrationNumber,
    String? unitEconomicalNumber,
    String? unitProvince,
    String? unitCity,
    String? unitPostalCode,
    String? unitAddress,
  }) = _User;

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

@freezed
abstract class City with _$City {
  const factory City({
    int? id,
    String? key,
    String? createDate,
    String? modifyDate,
    bool? trash,
    int? provinceIdForeignKey,
    int? cityIdKey,
    String? name,
    double? productPrice,
    bool? provinceCenter,
    int? cityNumber,
    String? cityName,
    int? provinceNumber,
    String? provinceName,
    dynamic createdBy,
    dynamic modifiedBy,
    int? province,
  }) = _City;

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

@freezed
abstract class ToSteward with _$ToSteward {
  const factory ToSteward({
    int? id,
    ToStewardUser? user,
    Address? address,
    Activity? guildAreaActivity,
    Activity? guildTypeActivity,
    List<dynamic>? killHouse,
    List<dynamic>? stewardKillHouse,
    List<dynamic>? stewards,
    PosStatus? getPosStatus,
    String? key,
    String? createDate,
    String? modifyDate,
    bool? trash,
    dynamic userIdForeignKey,
    dynamic addressIdForeignKey,
    dynamic userBankIdForeignKey,
    dynamic walletIdForeignKey,
    dynamic provincialGovernmentIdKey,
    dynamic identityDocuments,
    bool? active,
    int? cityNumber,
    String? cityName,
    String? guildsId,
    String? licenseNumber,
    String? guildsName,
    dynamic phone,
    String? typeActivity,
    String? areaActivity,
    int? provinceNumber,
    String? provinceName,
    bool? steward,
    bool? hasPos,
    dynamic centersAllocation,
    dynamic killHouseCentersAllocation,
    dynamic allocationLimit,
    bool? limitationAllocation,
    dynamic registerarRole,
    dynamic registerarFullname,
    dynamic registerarMobile,
    bool? killHouseRegister,
    bool? stewardRegister,
    bool? guildsRoomRegister,
    bool? posCompanyRegister,
    String? provinceAcceptState,
    dynamic provinceMessage,
    dynamic condition,
    dynamic descriptionCondition,
    bool? stewardActive,
    dynamic stewardAllocationLimit,
    bool? stewardLimitationAllocation,
    bool? license,
    dynamic licenseForm,
    dynamic licenseFile,
    dynamic reviewerRole,
    dynamic reviewerFullname,
    dynamic reviewerMobile,
    dynamic checkerMessage,
    bool? finalAccept,
    bool? temporaryRegistration,
    dynamic createdBy,
    dynamic modifiedBy,
    dynamic userBankInfo,
    int? wallet,
    List<dynamic>? cars,
    List<dynamic>? userLevel,
  }) = _ToSteward;

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

@freezed
abstract class ToStewardUser with _$ToStewardUser {
  const factory ToStewardUser({
    String? fullname,
    String? firstName,
    String? lastName,
    String? mobile,
    String? nationalId,
    String? city,
  }) = _ToStewardUser;

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

@freezed
abstract class Address with _$Address {
  const factory Address({
    Province? province,
    CitySimple? 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 CitySimple with _$CitySimple {
  const factory CitySimple({
    String? key,
    String? name,
  }) = _CitySimple;

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

@freezed
abstract class Activity with _$Activity {
  const factory Activity({
    String? key,
    String? title,
  }) = _Activity;

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

@freezed
abstract class PosStatus with _$PosStatus {
  const factory PosStatus({
    int? lenActiveSessions,
    bool? hasPons,
    bool? hasActivePons,
  }) = _PosStatus;

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