import '../pharmacies/Customer.dart';

class Reviews {
  int? id;
  int? position;
  int? reviewId;
  int? customerId;
  int? productId;
  int? storeId;
  bool? isApproved;
  String? title;
  String? reviewText;
  String? replyText;
  int? rating;
  int? helpfulYesTotal;
  int? helpfulNoTotal;
  String? createdOnUtc;
  Customer? customer;
  //dynamic product;

  Reviews(
      {this.id,
        this.position,
        this.reviewId,
        this.customerId,
        this.productId,
        this.storeId,
        this.isApproved,
        this.title,
        this.reviewText,
        this.replyText,
        this.rating,
        this.helpfulYesTotal,
        this.helpfulNoTotal,
        this.createdOnUtc,
        this.customer,
       // this.product
      });

  Reviews.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    position = json['position'];
    reviewId = json['review_id'];
    customerId = json['customer_id'];
    productId = json['product_id'];
    storeId = json['store_id'];
    isApproved = json['is_approved'];
    title = json['title'];
    reviewText = json['review_text'];
    replyText = json['reply_text'];
    rating = json['rating'];
    helpfulYesTotal = json['helpful_yes_total'];
    helpfulNoTotal = json['helpful_no_total'];
    createdOnUtc = json['created_on_utc'];
    customer = json['customer'] != null
        ? new Customer.fromJson(json['customer'])
        : null;
   // product = json['product'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['position'] = this.position;
    data['review_id'] = this.reviewId;
    data['customer_id'] = this.customerId;
    data['product_id'] = this.productId;
    data['store_id'] = this.storeId;
    data['is_approved'] = this.isApproved;
    data['title'] = this.title;
    data['review_text'] = this.reviewText;
    data['reply_text'] = this.replyText;
    data['rating'] = this.rating;
    data['helpful_yes_total'] = this.helpfulYesTotal;
    data['helpful_no_total'] = this.helpfulNoTotal;
    data['created_on_utc'] = this.createdOnUtc;
    if (this.customer != null) {
      data['customer'] = this.customer!.toJson();
    }
   // data['product'] = this.product;
    return data;
  }
}