// Copyright 2023 Harran Ali <harran.m@gmail.com>. All rights reserved.
// Copyright (c) 2024 Zeni Kim <zenik@smarteching.com>
// Use of this source code is governed by MIT-style
// license that can be found in the LICENSE file.

package main

import (
	"git.smarteching.com/goffee/core"
	"git.smarteching.com/goffee/cup/controllers"
	"git.smarteching.com/goffee/cup/hooks"
)

// Register the app controllers
func registerRoutes() {
	controller := core.ResolveRouter()
	//#############################
	//# App Routes            #####
	//#############################

	// Define your routes here...
	controller.Get("/", controllers.WelcomeHome)
	// Uncomment the lines below to enable theme demo
	controller.Get("/themebase", controllers.Themedemo)
	controller.Get("/themeform", controllers.Themeform)
	controller.Get("/themecontent", controllers.Themecontent)
	controller.Get("/themepanel", controllers.Themedemo)
	controller.Get("/themeelements", controllers.ThemeElements)

	// Uncomment the lines below to enable authentication
	controller.Post("/signup", controllers.Signup)
	controller.Post("/signin", controllers.Signin)
	controller.Post("/signout", controllers.Signout)
	controller.Post("/reset-password", controllers.ResetPasswordRequest)
	controller.Post("/reset-password/code/:code", controllers.SetNewPassword)

	controller.Get("/dashboard", controllers.WelcomeToDashboard, hooks.AuthCheck)

	controller.Get("/appsample", controllers.AppSample, hooks.AuthCheck)
	controller.Post("/appsample", controllers.AppSample, hooks.AuthCheck)

	controller.Get("/applogin", controllers.AppLogin, hooks.CheckSessionCookie)
	controller.Post("/applogin", controllers.AppLogin, hooks.CheckSessionCookie)
}
