fromMap static method

OrderLine? fromMap(
  1. Object? body
)

Implementation

static OrderLine? fromMap(Object? body) {
  final source = readRecord(body, envelopeKey: 'order_line');
  if (source == null) return null;
  return OrderLine(
    chargeItemUuid: readText(source['charge_item_uuid']),
    expectedDeliveryDate: readText(source['expected_delivery_date']),
    id: readText(source['id']),
    item: OrderLineItem.fromMap(source['item']),
    itemAccountingCode:
        OrderLineItemAccountingCode.fromMap(source['item_accounting_code']),
    itemChargeType: readText(source['item_charge_type']),
    itemCustomAttributes:
        readList<Object>(source['item_custom_attributes'], readAny),
    itemDescription: readText(source['item_description']),
    itemInvoiceNote: readText(source['item_invoice_note']),
    itemOrderQuantity: readInteger(source['item_order_quantity']),
    itemPriceSnapshot:
        OrderLineItemPriceSnapshot.fromMap(source['item_price_snapshot']),
    itemPriceTax: OrderLineItemPriceTax.fromMap(source['item_price_tax']),
    itemProperties:
        OrderLineItemProperties.fromMap(source['item_properties']),
    itemSaleTaxConfiguration: OrderLineItemSaleTaxConfiguration.fromMap(
        source['item_sale_tax_configuration']),
    itemType: readText(source['item_type']),
    object: readText(source['object']),
    preOrderStockDetails: OrderLinePreOrderStockDetails.fromMap(
        source['pre_order_stock_details']),
    shippingCost: readDecimal(source['shipping_cost']),
    subtotal: readText(source['subtotal']),
    tax: readText(source['tax']),
    taxExemptWhenSold: readFlag(source['tax_exempt_when_sold']),
    total: readText(source['total']),
    version: readInteger(source['version']),
  );
}