toDocument method

  1. @override
Map<String, Object?> toDocument()
override

Implementation

@override
Map<String, Object?> toDocument() {
  final List<Map<String?, dynamic>>? productsListMap = products != null
      ? products!.map((item) => item.toDocument()).toList()
      : null;

  Map<String, Object?> theDocument = HashMap();
  if (appId != null) {
    theDocument["appId"] = appId;
  } else {
    theDocument["appId"] = null;
  }
  if (customerId != null) {
    theDocument["customerId"] = customerId;
  } else {
    theDocument["customerId"] = null;
  }
  if (name != null) {
    theDocument["name"] = name;
  } else {
    theDocument["name"] = null;
  }
  if (email != null) {
    theDocument["email"] = email;
  } else {
    theDocument["email"] = null;
  }
  if (shipStreet1 != null) {
    theDocument["shipStreet1"] = shipStreet1;
  } else {
    theDocument["shipStreet1"] = null;
  }
  if (shipStreet2 != null) {
    theDocument["shipStreet2"] = shipStreet2;
  } else {
    theDocument["shipStreet2"] = null;
  }
  if (shipCity != null) {
    theDocument["shipCity"] = shipCity;
  } else {
    theDocument["shipCity"] = null;
  }
  if (shipState != null) {
    theDocument["shipState"] = shipState;
  } else {
    theDocument["shipState"] = null;
  }
  if (postcode != null) {
    theDocument["postcode"] = postcode;
  } else {
    theDocument["postcode"] = null;
  }
  if (country != null) {
    theDocument["country"] = country;
  } else {
    theDocument["country"] = null;
  }
  if (invoiceSame != null) {
    theDocument["invoiceSame"] = invoiceSame;
  } else {
    theDocument["invoiceSame"] = null;
  }
  if (invoiceStreet1 != null) {
    theDocument["invoiceStreet1"] = invoiceStreet1;
  } else {
    theDocument["invoiceStreet1"] = null;
  }
  if (invoiceStreet2 != null) {
    theDocument["invoiceStreet2"] = invoiceStreet2;
  } else {
    theDocument["invoiceStreet2"] = null;
  }
  if (invoiceCity != null) {
    theDocument["invoiceCity"] = invoiceCity;
  } else {
    theDocument["invoiceCity"] = null;
  }
  if (invoiceState != null) {
    theDocument["invoiceState"] = invoiceState;
  } else {
    theDocument["invoiceState"] = null;
  }
  if (invoicePostcode != null) {
    theDocument["invoicePostcode"] = invoicePostcode;
  } else {
    theDocument["invoicePostcode"] = null;
  }
  if (invoiceCountry != null) {
    theDocument["invoiceCountry"] = invoiceCountry;
  } else {
    theDocument["invoiceCountry"] = null;
  }
  if (products != null) {
    theDocument["products"] = productsListMap;
  } else {
    theDocument["products"] = null;
  }
  if (totalPrice != null) {
    theDocument["totalPrice"] = totalPrice;
  } else {
    theDocument["totalPrice"] = null;
  }
  if (currency != null) {
    theDocument["currency"] = currency;
  } else {
    theDocument["currency"] = null;
  }
  if (paymentReference != null) {
    theDocument["paymentReference"] = paymentReference;
  } else {
    theDocument["paymentReference"] = null;
  }
  if (shipmentReference != null) {
    theDocument["shipmentReference"] = shipmentReference;
  } else {
    theDocument["shipmentReference"] = null;
  }
  if (deliveryReference != null) {
    theDocument["deliveryReference"] = deliveryReference;
  } else {
    theDocument["deliveryReference"] = null;
  }
  if (paymentNote != null) {
    theDocument["paymentNote"] = paymentNote;
  } else {
    theDocument["paymentNote"] = null;
  }
  if (shipmentNote != null) {
    theDocument["shipmentNote"] = shipmentNote;
  } else {
    theDocument["shipmentNote"] = null;
  }
  if (deliveryNote != null) {
    theDocument["deliveryNote"] = deliveryNote;
  } else {
    theDocument["deliveryNote"] = null;
  }
  if (status != null) {
    theDocument["status"] = status;
  } else {
    theDocument["status"] = null;
  }
  if (timeStamp != null) {
    theDocument["timeStamp"] = timeStamp;
  } else {
    theDocument["timeStamp"] = null;
  }
  return theDocument;
}