# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~

# GLOBAL SITE NAVIGATION
GET     /                           controllers.Application.index()
GET     /p                          controllers.Application.portfolio()

# Map static resources from the /public folder to the /assets URL path
GET     /assets/*file               controllers.Assets.at(path="/public", file)

# ROUTES TO HANDLE LOGIN

# Login page
GET     /login                      securesocial.controllers.LoginPage.login
GET     /logout                     securesocial.controllers.LoginPage.logout

# ROUTES TO HANDLE OUR APP

# Make a query into YahooFinanceService and return Stock data for symbol
GET     /quote/:stock              controllers.Query.getQuery(stock:String)

# This point lets us get a user.  If the user doens't exist, it will return
# a badRequest will be returned and a status of "KO"
GET     /u/:email                  controllers.UserController.getUser(email:String)

# This should be a POST or PUT
# This should only be hit after we check to see if the user exists,
# either way, this point is protected and will return a registered or new
# user
GET    /u/:first/:last/:email      controllers.UserController.addUser(first:String, last:String, email:String)

# This should be a POST or PUT
# This should only be hit to create a new league
# Also need to add support for goals
GET    /l/:name                    controllers.LeagueController.addLeague(name:String)

# GET a portfolio based on the league and user ids
GET    /p/:userId/:leagueId        controllers.PortfolioController.getPortfolioOverview(userId:Long, leagueId:Long)

# GET a leaderboard based on the league id
GET    /lb					        controllers.Application.leaderboard()
GET    /lb/:leagueId        controllers.LeaderboardController.getLeaderboard(leagueId:Long)

# TRADES
GET    /b/:portfolioId/:ticker/:qty controllers.Trader.buyStock(portfolioId:Long,ticker:String,qty:Long)
GET    /s/:portfolioId/:ticker/:qty controllers.Trader.sellStock(portfolioId:Long,ticker:String,qty:Long)


# JAVASCRIPT ROUTES

GET     /javascriptRoutes     controllers.Application.javascriptRoutes


# User Registration and password handling
# TODO I don't think we need most of these, we should play with them and see if
# we can get rid of them
GET     /signup                     securesocial.controllers.Registration.startSignUp
POST    /signup                     securesocial.controllers.Registration.handleStartSignUp
GET     /signup/:token              securesocial.controllers.Registration.signUp(token)
POST    /signup/:token              securesocial.controllers.Registration.handleSignUp(token)
GET     /reset                      securesocial.controllers.Registration.startResetPassword
POST    /reset                      securesocial.controllers.Registration.handleStartResetPassword
GET     /reset/:token               securesocial.controllers.Registration.resetPassword(token)
POST    /reset/:token               securesocial.controllers.Registration.handleResetPassword(token)
GET     /password                   securesocial.controllers.PasswordChange.page
POST    /password                   securesocial.controllers.PasswordChange.handlePasswordChange

# Providers entry points
GET     /authenticate/:provider     securesocial.controllers.ProviderController.authenticate(provider)
POST    /authenticate/:provider     securesocial.controllers.ProviderController.authenticateByPost(provider)
GET     /not-authorized             securesocial.controllers.ProviderController.notAuthorized


