import 'package:app_hit_a_wod/src/models/box.model.dart';
import 'package:app_hit_a_wod/src/models/company.model.dart';
import 'package:app_hit_a_wod/src/models/pricing.model.dart';
import 'package:app_hit_a_wod/src/models/role.model.dart';
import 'package:app_hit_a_wod/src/models/user_subscription.model.dart';

class SubscriptionSelection {
  Box box;
  Role role;
  Company company;
  Pricing pricing;
  UserSubscription us;
  bool active = false;
  String level;

  SubscriptionSelection();

  factory SubscriptionSelection.fromJson(Map<String, dynamic> json) {
    return SubscriptionSelection()
      ..box = json["box"] == null
        ? null
        : Box.fromJson(json["box"] as Map<String, dynamic>)
      ..role = json["role"] == null
        ? null
        : Role.fromJson(json["role"] as Map<String, dynamic>)
      ..company = json["company"] == null
        ? null
        : Company.fromJson(json["company"] as Map<String, dynamic>)
      ..pricing = json["pricing"] == null
        ? null
        : Pricing.fromJson(json["pricing"] as Map<String, dynamic>)
      ..us = json["us"] == null
        ? null
        : UserSubscription.fromJson(json["us"] as Map<String, dynamic>)
      ..active = false
      ..level = json["level"] as String;
  }

}