import 'PointsDetails.dart';

class PointsAmountPerday {
  double amountPerDay;
  String day;
  List<PointsDetails> pointsDetails;
  double pointsPerDay;
  String transationDate;

  PointsAmountPerday(
      {this.amountPerDay,
        this.day,
        this.pointsDetails,
        this.pointsPerDay,
        this.transationDate});

  PointsAmountPerday.fromJson(Map<String, dynamic> json) {
    amountPerDay = json['AmountPerDay'];
    day = json['Day'];
    if (json['PointsDetails'] != null) {
      pointsDetails = new List<PointsDetails>();
      json['PointsDetails'].forEach((v) {
        pointsDetails.add(new PointsDetails.fromJson(v));
      });
    }
    pointsPerDay = json['PointsPerDay'];
    transationDate = json['TransationDate'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['AmountPerDay'] = this.amountPerDay;
    data['Day'] = this.day;
    if (this.pointsDetails != null) {
      data['PointsDetails'] =
          this.pointsDetails.map((v) => v.toJson()).toList();
    }
    data['PointsPerDay'] = this.pointsPerDay;
    data['TransationDate'] = this.transationDate;
    return data;
  }
}