Skip to content

Instantly share code, notes, and snippets.

@NTCoding
Last active December 12, 2015 11:48
Show Gist options
  • Select an option

  • Save NTCoding/e018efdde8e3c45a1a05 to your computer and use it in GitHub Desktop.

Select an option

Save NTCoding/e018efdde8e3c45a1a05 to your computer and use it in GitHub Desktop.
object RecommendAFriend{
def apply(validate: NewAccountDetails => Unit, findCustomer: String => Option[User],
createCustomer: NewAccountDetails => User, referralPolicy: (User, User) => Future[Unit])
(referrerId: Int, friendsAccountDetails: NewAcccountDetails) = {
validate(friendsAccountDetails)
val user = findCustomer(referrerId);
val friend = createCustomer(friendsAccountDetails)
referralPolicy(user, friend)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment