import 'package:yumi/shared/business_logic/models/res/login_res.dart';

/// id : 0
/// label : ""
/// discount : 0.0
/// propsResources : {"id":0,"sysOrigin":"","type":"","code":"","name":"","cover":"","sourceUrl":"","expand":"","amount":0.0,"del":false,"roomSendCoverUrl":"","roomOpenedUrl":"","roomNotOpenedUrl":"","imSendCoverUrl":"","imOpenedUrl":"","imNotOpenedUrl":"","imOpenedUrlTwo":"","createTime":0,"updateTime":0}
/// propsPrices : [{"days":0,"amount":0.0,"discountAmount":0.0}]
/// diamondPrices : [{"days":0,"amount":0.0,"discountAmount":0.0}]

class StoreListRes {
  StoreListRes({
      String? id,
      String? label,
      num? discount,
      PropsResources? propsResources,
      List<PropsPrices>? propsPrices,
      List<DiamondPrices>? diamondPrices,}){
    _id = id;
    _label = label;
    _discount = discount;
    _propsResources = propsResources;
    _propsPrices = propsPrices;
    _diamondPrices = diamondPrices;
}

  StoreListRes.fromJson(dynamic json) {
    _id = json['id'];
    _label = json['label'];
    _discount = json['discount'];
    _propsResources = json['propsResources'] != null ? PropsResources.fromJson(json['propsResources']) : null;
    if (json['propsPrices'] != null) {
      _propsPrices = [];
      json['propsPrices'].forEach((v) {
        _propsPrices?.add(PropsPrices.fromJson(v));
      });
    }
    if (json['diamondPrices'] != null) {
      _diamondPrices = [];
      json['diamondPrices'].forEach((v) {
        _diamondPrices?.add(DiamondPrices.fromJson(v));
      });
    }
  }
  String? _id;
  String? _label;
  num? _discount;
  PropsResources? _propsResources;
  List<PropsPrices>? _propsPrices;
  List<DiamondPrices>? _diamondPrices;
StoreListRes copyWith({  String? id,
  String? label,
  num? discount,
  PropsResources? propsResources,
  List<PropsPrices>? propsPrices,
  List<DiamondPrices>? diamondPrices,
}) => StoreListRes(  id: id ?? _id,
  label: label ?? _label,
  discount: discount ?? _discount,
  propsResources: propsResources ?? _propsResources,
  propsPrices: propsPrices ?? _propsPrices,
  diamondPrices: diamondPrices ?? _diamondPrices,
);
  String? get id => _id;
  String? get label => _label;
  num? get discount => _discount;
  PropsResources? get propsResources => _propsResources;
  List<PropsPrices>? get propsPrices => _propsPrices;
  List<DiamondPrices>? get diamondPrices => _diamondPrices;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['label'] = _label;
    map['discount'] = _discount;
    if (_propsResources != null) {
      map['propsResources'] = _propsResources?.toJson();
    }
    if (_propsPrices != null) {
      map['propsPrices'] = _propsPrices?.map((v) => v.toJson()).toList();
    }
    if (_diamondPrices != null) {
      map['diamondPrices'] = _diamondPrices?.map((v) => v.toJson()).toList();
    }
    return map;
  }

}

/// days : 0
/// amount : 0.0
/// discountAmount : 0.0

class DiamondPrices {
  DiamondPrices({
      num? days,
      num? amount,
      num? discountAmount,}){
    _days = days;
    _amount = amount;
    _discountAmount = discountAmount;
}

  DiamondPrices.fromJson(dynamic json) {
    _days = json['days'];
    _amount = json['amount'];
    _discountAmount = json['discountAmount'];
  }
  num? _days;
  num? _amount;
  num? _discountAmount;
DiamondPrices copyWith({  num? days,
  num? amount,
  num? discountAmount,
}) => DiamondPrices(  days: days ?? _days,
  amount: amount ?? _amount,
  discountAmount: discountAmount ?? _discountAmount,
);
  num? get days => _days;
  num? get amount => _amount;
  num? get discountAmount => _discountAmount;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['days'] = _days;
    map['amount'] = _amount;
    map['discountAmount'] = _discountAmount;
    return map;
  }

}

/// days : 0
/// amount : 0.0
/// discountAmount : 0.0

class PropsPrices {
  PropsPrices({
      num? days,
      num? amount,
      num? discountAmount,}){
    _days = days;
    _amount = amount;
    _discountAmount = discountAmount;
}

  PropsPrices.fromJson(dynamic json) {
    _days = json['days'];
    _amount = json['amount'];
    _discountAmount = json['discountAmount'];
  }
  num? _days;
  num? _amount;
  num? _discountAmount;
PropsPrices copyWith({  num? days,
  num? amount,
  num? discountAmount,
}) => PropsPrices(  days: days ?? _days,
  amount: amount ?? _amount,
  discountAmount: discountAmount ?? _discountAmount,
);
  num? get days => _days;
  num? get amount => _amount;
  num? get discountAmount => _discountAmount;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['days'] = _days;
    map['amount'] = _amount;
    map['discountAmount'] = _discountAmount;
    return map;
  }

}

