import 'package:diplomaticquarterapp/core/model/pharmacies/Customer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';

class ShoppingCart {
  int languageId;
  String id;
  // List<Null> productAttributes;
  double customerEnteredPrice;
  int quantity;
  dynamic discountAmountInclTax;
  dynamic subtotal;
  dynamic subtotalWithVat;
  dynamic subtotalVatAmount;
  dynamic subtotalVatRate;
  dynamic currency;
  dynamic currencyn;
  dynamic rentalStartDateUtc;
  dynamic rentalEndDateUtc;
  dynamic createdOnUtc;
  dynamic updatedOnUtc;
  dynamic shoppingCartType;
  int productId;
  PharmacyProduct product;
  int customerId;
  Customer customer;
  double unitPriceInclTax;
  double unitPriceExclTax;
  double priceInclTax;
  double priceExclTax;
  dynamic discountAmountExclTax;
  double originalProductCost;
  String attributeDescription;
  int downloadCount;
  bool isDownloadActivated;
  int licenseDownloadId;
  double itemWeight;

  ShoppingCart(
      {this.languageId,
      this.id,
      // this.productAttributes,
      this.customerEnteredPrice,
      this.quantity,
      this.discountAmountInclTax,
      this.subtotal,
      this.subtotalWithVat,
      this.subtotalVatAmount,
      this.subtotalVatRate,
      this.currency,
      this.currencyn,
      this.rentalStartDateUtc,
      this.rentalEndDateUtc,
      this.createdOnUtc,
      this.updatedOnUtc,
      this.shoppingCartType,
      this.productId,
      this.product,
      this.customerId,
      this.customer,
      this.unitPriceInclTax,
      this.unitPriceExclTax,
      this.priceInclTax,
      this.priceExclTax,
      this.discountAmountExclTax,
      this.originalProductCost,
      this.attributeDescription,
      this.downloadCount,
      this.isDownloadActivated,
      this.licenseDownloadId,
      this.itemWeight,
      });

  ShoppingCart.fromJson(Map<String, dynamic> json) {
    languageId = json['language_id'];
    id = json['id'];
    /*if (json['product_attributes'] != null) {
      productAttributes = new List<Null>();
      json['product_attributes'].forEach((v) {
        productAttributes.add(new Null.fromJson(v));
      });
    }*/
    customerEnteredPrice = json['customer_entered_price'];
    quantity = json['quantity'];
    discountAmountInclTax = json['discount_amount_incl_tax'];
    subtotal = json['subtotal'];
    subtotalWithVat = json['subtotal_with_vat'];
    subtotalVatAmount = json['subtotal_vat_amount'];
    subtotalVatRate = json['subtotal_vat_rate'];
    currency = json['currency'];
    currencyn = json['currencyn'];
    rentalStartDateUtc = json['rental_start_date_utc'];
    rentalEndDateUtc = json['rental_end_date_utc'];
    createdOnUtc = json['created_on_utc'];
    updatedOnUtc = json['updated_on_utc'];
    shoppingCartType = json['shopping_cart_type'];
    productId = json['product_id'];
    product = json['product'] != null
        ? new PharmacyProduct.fromJson(json['product'])
        : null;
    customerId = json['customer_id'];
    customer = json['customer'] != null
        ? new Customer.fromJson(json['customer'])
        : null;

    unitPriceInclTax = json['unit_price_incl_tax'];
    unitPriceExclTax = json['unit_price_excl_tax'];
    priceInclTax = json['price_incl_tax'];
    priceExclTax = json['price_excl_tax'];
    discountAmountExclTax = json['discount_amount_excl_tax'];
    originalProductCost = json['original_product_cost'];
    attributeDescription = json['attribute_description'];
    downloadCount = json['download_count'];
    isDownloadActivated = json['isDownload_activated'];
    licenseDownloadId = json['license_download_id'];
    itemWeight = json['item_weight'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['language_id'] = this.languageId;
    data['id'] = this.id;
    /*if (this.productAttributes != null) {
      data['product_attributes'] =
          this.productAttributes.map((v) => v.toJson()).toList();
    }*/
    data['customer_entered_price'] = this.customerEnteredPrice;
    data['quantity'] = this.quantity;
    data['discount_amount_incl_tax'] = this.discountAmountInclTax;
    data['subtotal'] = this.subtotal;
    data['subtotal_with_vat'] = this.subtotalWithVat;
    data['subtotal_vat_amount'] = this.subtotalVatAmount;
    data['subtotal_vat_rate'] = this.subtotalVatRate;
    data['currency'] = this.currency;
    data['currencyn'] = this.currencyn;
    data['rental_start_date_utc'] = this.rentalStartDateUtc;
    data['rental_end_date_utc'] = this.rentalEndDateUtc;
    data['created_on_utc'] = this.createdOnUtc;
    data['updated_on_utc'] = this.updatedOnUtc;
    data['shopping_cart_type'] = this.shoppingCartType;
    data['product_id'] = this.productId;
    if (this.product != null) {
      data['product'] = this.product.toJson();
    }
    data['customer_id'] = this.customerId;
    if (this.customer != null) {
      data['customer'] = this.customer.toJson();
    }
    data['unit_price_incl_tax'] = this.unitPriceInclTax;
    data['unit_price_excl_tax'] = this.unitPriceExclTax;
    data['price_incl_tax'] = this.priceInclTax;
    data['price_excl_tax'] = this.priceExclTax;
    data['discount_amount_excl_tax'] = this.discountAmountExclTax;
    data['original_product_cost'] = this.originalProductCost;
    data['attribute_description'] = this.attributeDescription;
    data['download_count'] = this.downloadCount;
    data['isDownload_activated'] = this.isDownloadActivated;
    data['license_download_id'] = this.licenseDownloadId;
    data['item_weight'] = this.itemWeight;

    return data;
  }
}
