fromMap static method
Implementation
static OrderRead? fromMap(Object? body) {
final source = readRecord(body, envelopeKey: 'order');
if (source == null) return null;
return OrderRead(
account: OrderReadAccount.fromMap(source['account']),
activityLogs: readList<OrderReadActivityLog>(
source['activity_logs'], OrderReadActivityLog.fromMap),
allowContract: readFlag(source['allow_contract']),
billingAddress:
OrderReadBillingAddress.fromMap(source['billing_address']),
billingPreferences:
OrderReadBillingPreferences.fromMap(source['billing_preferences']),
billingStartDate: readText(source['billing_start_date']),
billingStartDayOfMonth: readText(source['billing_start_day_of_month']),
communicationPreferences: readList<OrderReadCommunicationPreference>(
source['communication_preferences'],
OrderReadCommunicationPreference.fromMap),
contractProperties:
OrderReadContractProperties.fromMap(source['contract_properties']),
createdBy: readAny(source['created_by']),
createdOn: readText(source['created_on']),
currency: OrderReadCurrency.fromMap(source['currency']),
customAttributes: readList<OrderReadCustomAttribute>(
source['custom_attributes'], OrderReadCustomAttribute.fromMap),
customForm: OrderReadCustomForm.fromMap(source['custom_form']),
customerPurchaseOrderId: readText(source['customer_purchase_order_id']),
description: readText(source['description']),
discountProfile:
OrderReadDiscountProfile.fromMap(source['discount_profile']),
displayName: readText(source['display_name']),
id: readText(source['id']),
invoiceNote: readText(source['invoice_note']),
kpis: OrderReadKpis.fromMap(source['kpis']),
lastUpdatedBy: readAny(source['last_updated_by']),
lastUpdatedOn: readText(source['last_updated_on']),
lines: readList<OrderReadLine>(source['lines'], OrderReadLine.fromMap),
manager: OrderReadManager.fromMap(source['manager']),
name: readText(source['name']),
nextBillingFromDate: readText(source['next_billing_from_date']),
nextBillingFromDateUtc: readText(source['next_billing_from_date_utc']),
object: readText(source['object']),
orderStartDate: readText(source['order_start_date']),
orderType: readText(source['order_type']),
origin: readText(source['origin']),
originalTotal: readText(source['original_total']),
preOrder: readFlag(source['pre_order']),
priceTaxInclusive: readFlag(source['price_tax_inclusive']),
quoteConverted: readFlag(source['quote_converted']),
quoteOrder: readFlag(source['quote_order']),
referralAccount: readAny(source['referral_account']),
salesRep: readAny(source['sales_rep']),
shippingAddress:
OrderReadShippingAddress.fromMap(source['shipping_address']),
shippingCost: readDecimal(source['shipping_cost']),
shippingLineItems:
readList<Object>(source['shipping_line_items'], readAny),
shippingProfile: readAny(source['shipping_profile']),
status: readText(source['status']),
subtotal: readText(source['subtotal']),
tax: readText(source['tax']),
timeZone: OrderReadTimeZone.fromMap(source['time_zone']),
total: readText(source['total']),
version: readInteger(source['version']),
);
}