package controllers import play.api._ import play.api.data._ import play.api.data.Forms._ import play.api.mvc._ import play.api.db.slick._ import play.api.db.slick.Config.driver.simple._ import play.api.Play.current import scala.concurrent.Future import models._ object Account extends Controller { def summary = Auth { implicit request => if (request.account.isEmpty) { Redirect(routes.Authentication.login()) .flashing("error" -> "Authentication required") } else { DB.withSession { implicit session => val userUuid = request.account.get.userUuid val transactions = Tables.Transactions.filter(_.userUuid === userUuid).sortBy(_.transactionDate.desc).run Ok(views.html.pages.accountSummary(transactions)) } } } }