mapReceiptOrder method
Implementation
ReceiptOrder mapReceiptOrder(ReceiptOrderResp? resp) {
return ReceiptOrder(
orderID: resp?.orderID,
branchID: resp?.branchID,
branchName: resp?.branchName,
shippingMethod: resp?.shippingMethod,
operationalStatus: resp?.operationalStatus,
shippingPrice: resp?.shippingPrice,
quantity: resp?.quantity,
subtotal: resp?.subtotal,
tax: resp?.tax,
giftCards: mapReceiptGiftCards(resp?.giftCards),
courier: ReceiptCourier(
name: resp?.courier?.name,
rateName: resp?.courier?.rateName,
maxDay: resp?.courier?.maxDay,
minDay: resp?.courier?.minDay,
),
giftCertificates:
resp?.giftCertificates
?.map((e) => mapReceiptGiftCertificates(e))
.toList(),
total: resp?.total,
completed: resp?.completed,
orderNumber: resp?.orderNumber,
status: resp?.status,
billingInformation: mapReceiptBillingInformation(
resp?.billingInformation,
),
orderDeliveries:
resp?.orderDeliveries
?.map(
(e) => mapReceiptOrderDeliveries(
e,
resp.shippingMethod,
resp.branchID,
resp.orderID,
),
)
.toList(),
orderDiscounts:
resp?.orderDiscounts
?.map((e) => mapReceiptOrderDiscounts(e))
.toList(),
shipping: resp?.shipping,
);
}