Created
June 4, 2015 03:11
-
-
Save ryandavidhartman/3099c64896e5d486f99e to your computer and use it in GitHub Desktop.
Scala Question
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class StoreViewSummaryResponse( | |
invoiceData: Iterable[(Invoice, ServiceProvider, Address, ContactInformationData, Sku, Option[String])], | |
orderTotal: org.joda.money.Money) | |
lazy val viewSummary: Service[StoreViewSummaryRequest, StoreViewSummaryResponse] = monitored { | |
//get data from db as Iterables[T] | |
invoice, serviceProviders primaryAddresses, transactionIds | |
// get from remote server (returns a list of Future[Sku] ) | |
val shopSkus = skuIds map shopSkuAdapter.getSkuFromShop | |
val orderTotal = Money.of(CurrencyUnit.USD, 12.99) | |
Future.sequence(shopSkus) map (skus => StoreViewSummaryResponse( | |
ZipHelpers.zipped6( | |
invoices, | |
seerviceProviders, | |
primaryAddresses, | |
primaryContactInformations.map(_.get.contactInformationData), | |
skus, | |
transactionIds), | |
orderTotal)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment