import 'package:freezed_annotation/freezed_annotation.dart';

part 'allocated_made.freezed.dart';
part 'allocated_made.g.dart';

@freezed
abstract class AllocatedMadeModel with _$AllocatedMadeModel {
  factory AllocatedMadeModel({
    int? count,
    String? next,
    String? previous,
    List<AllocatedMadeResult>? results,
  }) = _AllocatedMadeModel;

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

@freezed
abstract class AllocatedMadeResult with _$AllocatedMadeResult {
  factory AllocatedMadeResult({
    int? id,
    Product? product,
    dynamic kill_house,
    dynamic to_kill_house,
    Steward? steward,
    dynamic to_steward,
    dynamic guilds,
    Steward? to_guilds,
    dynamic to_cold_house,
    int? index_weight,
    int? date_timestamp,
    int? new_state,
    int? new_receiver_state,
    int? new_allocation_state,
    String? key,
    String? create_date,
    String? modify_date,
    bool? trash,
    int? number_of_carcasses,
    int? real_number_of_carcasses,
    int? receiver_real_number_of_carcasses,
    int? weight_of_carcasses,
    int? real_weight_of_carcasses,
    int? receiver_real_weight_of_carcasses,
    int? weight_loss_of_carcasses,
    bool? final_registration,
    String? sell_type,
    String? product_name,
    String? seller_type,
    String? type,
    String? sale_type,
    String? allocation_type,
    bool? system_registration_code,
    int? registration_code,
    int? amount,
    int? total_amount,
    int? total_amount_paid,
    int? total_amount_remain,
    String? logged_registration_code,
    String? state,
    String? receiver_state,
    String? allocation_state,
    String? date,
    String? role,
    String? steward_temp_key,
    bool? approved_price_status,
    bool? calculate_status,
    bool? temporary_trash,
    bool? temporary_deleted,
    String? created_by,
    String? modified_by,
    dynamic ware_house,
    dynamic steward_ware_house,
    dynamic car,
    dynamic dispenser,
  }) = _AllocatedMadeResult;

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

@freezed
abstract class Product with _$Product {
  factory Product({
    int? weight_average,
  }) = _Product;

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

@freezed
abstract class Steward with _$Steward {
  factory Steward({
    int? id,
    User? user,
    Address? address,
    Activity? guild_area_activity,
    Activity? guild_type_activity,
    List<dynamic>? kill_house,
    List<dynamic>? steward_kill_house,
    List<dynamic>? stewards,
    PosStatus? get_pos_status,
    String? key,
    String? create_date,
    String? modify_date,
    bool? trash,
    dynamic user_id_foreign_key,
    dynamic address_id_foreign_key,
    dynamic user_bank_id_foreign_key,
    dynamic wallet_id_foreign_key,
    dynamic provincial_government_id_key,
    dynamic identity_documents,
    bool? active,
    int? city_number,
    String? city_name,
    String? guilds_id,
    String? license_number,
    String? guilds_name,
    String? phone,
    String? type_activity,
    String? area_activity,
    int? province_number,
    String? province_name,
    bool? steward,
    bool? has_pos,
    dynamic centers_allocation,
    dynamic kill_house_centers_allocation,
    dynamic allocation_limit,
    bool? limitation_allocation,
    String? registerar_role,
    String? registerar_fullname,
    String? registerar_mobile,
    bool? kill_house_register,
    bool? steward_register,
    bool? guilds_room_register,
    bool? pos_company_register,
    String? province_accept_state,
    String? province_message,
    String? condition,
    String? description_condition,
    bool? steward_active,
    dynamic steward_allocation_limit,
    bool? steward_limitation_allocation,
    bool? license,
    dynamic license_form,
    dynamic license_file,
    String? reviewer_role,
    String? reviewer_fullname,
    String? reviewer_mobile,
    String? checker_message,
    bool? final_accept,
    bool? temporary_registration,
    String? created_by,
    String? modified_by,
    dynamic user_bank_info,
    int? wallet,
    List<dynamic>? cars,
    List<dynamic>? user_level,
  }) = _Steward;

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

@freezed
abstract class User with _$User {
  factory User({
    String? fullname,
    String? first_name,
    String? last_name,
    String? mobile,
    String? national_id,
    String? city,
  }) = _User;

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

@freezed
abstract class Address with _$Address {
  factory Address({
    Province? province,
    Province? city,
    String? address,
    String? postal_code,
  }) = _Address;

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

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

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

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

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

@freezed
abstract class PosStatus with _$PosStatus {
  factory PosStatus({
    int? len_active_sessions,
    bool? has_pons,
    bool? has_active_pons,
  }) = _PosStatus;

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