Created
August 17, 2017 12:09
-
-
Save akshanshjain95/12954e66b6eda6c1afd6a19759ae9ee6 to your computer and use it in GitHub Desktop.
Main Class of Akka Main Assignment
This file contains 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
import Models.Category | |
import Services.{SalaryDepositService, UserAccountService} | |
import akka.actor.{ActorSystem, Props} | |
import scala.concurrent.Future | |
import scala.concurrent.ExecutionContext.Implicits.global | |
object MainClass extends App { | |
val actorSystem = ActorSystem("AccountSystemActor") | |
val database = new Database | |
val databaseServiceActor = actorSystem.actorOf(DatabaseServiceActor.props(database)) | |
val accountGeneratorActor = actorSystem.actorOf(AccountGeneratorActor.props(databaseServiceActor)) | |
val linkBillerToAccountActor = actorSystem.actorOf(LinkBillerToAccountActor.props(databaseServiceActor)) | |
val salaryDepositorActor = actorSystem.actorOf(SalaryDepositorActor.props(databaseServiceActor)) | |
val listOAccountInformaion = List(List("Akshansh", "B-62, Sector-56, Noida", "AkshanshJain1995", "10.00"), | |
List("Akshansh", "B-62, Sector-56, Noida", "Akshansh9195Jain", "10.00")) | |
val userAccountServiceObj = new UserAccountService | |
val mapOfAccounts = userAccountServiceObj.createAccount(listOAccountInformaion, accountGeneratorActor) | |
mapOfAccounts.map(println(_)) | |
val resultString = userAccountServiceObj.linkBillerToAccount(3L, "PhoneBiller", Category.phone, linkBillerToAccountActor) | |
resultString.map(println(_)) | |
val salaryDepositServiceObj = new SalaryDepositService | |
val resultBool = salaryDepositServiceObj.depositSalary(3L, "Akshansh", 50000.00, salaryDepositorActor) | |
resultBool.map(println(_)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment