toEntity method

  1. @override
OrderEntity toEntity({
  1. String? appId,
})
override

Implementation

@override
OrderEntity toEntity({String? appId}) {
  return OrderEntity(
    appId: appId,
    customerId: (customer != null) ? customer!.documentID : null,
    name: (name != null) ? name : null,
    email: (email != null) ? email : null,
    shipStreet1: (shipStreet1 != null) ? shipStreet1 : null,
    shipStreet2: (shipStreet2 != null) ? shipStreet2 : null,
    shipCity: (shipCity != null) ? shipCity : null,
    shipState: (shipState != null) ? shipState : null,
    postcode: (postcode != null) ? postcode : null,
    country: (country != null) ? country : null,
    invoiceSame: (invoiceSame != null) ? invoiceSame : null,
    invoiceStreet1: (invoiceStreet1 != null) ? invoiceStreet1 : null,
    invoiceStreet2: (invoiceStreet2 != null) ? invoiceStreet2 : null,
    invoiceCity: (invoiceCity != null) ? invoiceCity : null,
    invoiceState: (invoiceState != null) ? invoiceState : null,
    invoicePostcode: (invoicePostcode != null) ? invoicePostcode : null,
    invoiceCountry: (invoiceCountry != null) ? invoiceCountry : null,
    products: (products != null)
        ? products!.map((item) => item.toEntity(appId: appId)).toList()
        : null,
    totalPrice: (totalPrice != null) ? totalPrice : null,
    currency: (currency != null) ? currency : null,
    paymentReference: (paymentReference != null) ? paymentReference : null,
    shipmentReference: (shipmentReference != null) ? shipmentReference : null,
    deliveryReference: (deliveryReference != null) ? deliveryReference : null,
    paymentNote: (paymentNote != null) ? paymentNote : null,
    shipmentNote: (shipmentNote != null) ? shipmentNote : null,
    deliveryNote: (deliveryNote != null) ? deliveryNote : null,
    status: (status != null) ? status!.index : null,
    timeStamp: (timeStamp != null) ? timeStamp : null,
  );
}