Advertisement
Guest User

Untitled

a guest
Jun 16th, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.73 KB | None | 0 0
  1.     for {
  2.       c         <- client                                     \/> "No CP client defined !"
  3.       userId    <- basket.owner                               \/> "No onwer set for basket"
  4.       user      <- configuration.pharmacy.users.get(userId)   \/> "User not found"
  5.       response  <- c.createParcel(basket, user, description)
  6.       result    <- response.SetParcelResult                   \/> "No result in CP response"
  7.       labelUrl  <- result.LabelUrl                            \/> "No label in CP response"
  8.       parcelId  <- result.CPPclCode                           \/> "No parcel id in CP response"
  9.     } yield PackagePrepared(configuration.pharmacy.id, basket.id, pharmacist, PackageDetails(labelUrl, parcelId, description))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement