import 'package:freezed_annotation/freezed_annotation.dart';

part 'waiting_arrival.freezed.dart';
part 'waiting_arrival.g.dart';

@freezed
abstract  class WaitingArrivalModel with _$WaitingArrivalModel {
  factory WaitingArrivalModel({
    required int count,
    String? next,
    String? previous,
    required List<ResultModel> results,
  }) = _WaitingArrivalModel;

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

@freezed
abstract class ResultModel with _$ResultModel {
  factory ResultModel({
    int? id,
    ProductModel? product,
    KillHouseModel? killHouse,
    dynamic toKillHouse,
    dynamic steward,
    @JsonKey(name: 'to_steward') ToStewardModel? 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,
  }) = _ResultModel;

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

@freezed
abstract class ProductModel with _$ProductModel {
  factory ProductModel({
    double? weightAverage,
  }) = _ProductModel;

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

@freezed
abstract class ToStewardModel with _$ToStewardModel {
  factory ToStewardModel({
    int? id,
    ToStewardUserModel? user,
    AddressModel? address,
    GuildAreaActivityModel? guildAreaActivity,
    GuildTypeActivityModel? guildTypeActivity,
    List<dynamic>? killHouse,
    List<dynamic>? stewardKillHouse,
    List<dynamic>? stewards,
    GetPosStatusModel? getPosStatus,
    String? key,
    @JsonKey(name: 'create_date') String? createDate,
    @JsonKey(name: 'modify_date') String? modifyDate,
    bool? trash,
    bool? active,
    String? guildsId,
    String? licenseNumber,
    String? guildsName,
    String? typeActivity,
    String? areaActivity,
    bool? steward,
    bool? hasPos,
    String? provinceAcceptState,
  }) = _ToStewardModel;

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

@freezed
abstract class ToStewardUserModel with _$ToStewardUserModel {
  factory ToStewardUserModel({
    String? fullname,
    @JsonKey(name: 'first_name') String? firstName,
    @JsonKey(name: 'last_name') String? lastName,
    String? mobile,
    @JsonKey(name: 'national_id') String? nationalId,
    String? city,
  }) = _ToStewardUserModel;

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

@freezed
abstract class ToStewardCityModel with _$ToStewardCityModel {
  factory ToStewardCityModel({
    String? key,
    @JsonKey(name: 'name') String? title,
  }) = _ToStewardCityModel;

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

@freezed
abstract class ToStewardProvinceModel with _$ToStewardProvinceModel {
  factory ToStewardProvinceModel({
    String? key,
    @JsonKey(name: 'name') String? title,
  }) = _ToStewardProvinceModel;

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

@freezed
abstract class AddressModel with _$AddressModel {
  factory AddressModel({
    ToStewardProvinceModel? province,
    ToStewardCityModel? city,
    String? address,
    String? postalCode,
  }) = _AddressModel;

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

@freezed
abstract class GuildAreaActivityModel with _$GuildAreaActivityModel {
  factory GuildAreaActivityModel({
    String? key,
    String? title,
  }) = _GuildAreaActivityModel;

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

@freezed
abstract class GuildTypeActivityModel with _$GuildTypeActivityModel {
  factory GuildTypeActivityModel({
    String? key,
    String? title,
  }) = _GuildTypeActivityModel;

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

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

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

@freezed
abstract class KillHouseModel with _$KillHouseModel {
  factory KillHouseModel({
    String? key,
    @JsonKey(name: 'kill_house_operator') KillHouseOperatorModel? operator,
    String? name,
    bool? killer,
  }) = _KillHouseModel;

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

@freezed
abstract class KillHouseOperatorModel with _$KillHouseOperatorModel {
  factory KillHouseOperatorModel({
    UserModel? user,
  }) = _KillHouseOperatorModel;

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

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

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

@freezed
abstract class CityModel with _$CityModel {
  factory CityModel({
    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,
  }) = _CityModel;

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