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({
    int? id,
    ProductModel? product,
    KillHouseModel? killHouse,
    dynamic toKillHouse,
    StewardModel? steward,
    StewardModel? 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,
    bool? overhead,
    bool? warehouse,
    bool? stewardWarehouse,
    String? quota,

  }) = _WaitingArrivalModel;

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

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

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

/// =======================
/// KILL HOUSE SECTION
/// =======================
@freezed
abstract class KillHouseModel with _$KillHouseModel {
  factory KillHouseModel({
    String? key,
    String? name,
    bool? killer,
    KillHouseOperatorModel? killHouseOperator,
  }) = _KillHouseModel;

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

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

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

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

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

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

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

/// =======================
/// TO STEWARD SECTION
/// =======================
@freezed
abstract class StewardModel with _$StewardModel {
  factory StewardModel({
    int? id,
    StewardUserModel? user,
    AddressModel? address,
    GetPosStatusModel? getPosStatus,
    String? key,
    String? createDate,
    String? modifyDate,
    bool? trash,
    bool? active,
    int? cityNumber,
    String? cityName,
    String? guildsId,
    String? licenseNumber,
    String? guildsName,
    String? phone,
    String? typeActivity,
    String? areaActivity,
    int? provinceNumber,
    String? provinceName,
    bool? steward,
    bool? hasPos,
    int? allocationLimit,
    bool? limitationAllocation,
    String? provinceAcceptState,
    bool? stewardActive,
    bool? stewardLimitationAllocation,
    bool? license,
    int? wallet,
  }) = _StewardModel;

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

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

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

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

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

@freezed
abstract class ProvinceModel with _$ProvinceModel {
  factory ProvinceModel({
    String? key,
    String? name,
  }) = _ProvinceModel;

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

@freezed
abstract class CityModel with _$CityModel {
  factory CityModel({
    String? key,
    String? name,
  }) = _CityModel;

  factory CityModel.fromJson(Map<String, dynamic> json) =>
      _$CityModelFromJson(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);
}
