TTime/backend/internal/handlers/global_state.go

42 lines
1.4 KiB
Go
Raw Normal View History

package handlers
import (
"ttime/internal/database"
"github.com/gofiber/fiber/v2"
)
// The actual interface that we will use
type GlobalState interface {
2024-03-14 21:25:14 +01:00
Register(c *fiber.Ctx) error // To register a new user
UserDelete(c *fiber.Ctx) error // To delete a user
Login(c *fiber.Ctx) error // To get the token
LoginRenew(c *fiber.Ctx) error // To renew the token
CreateProject(c *fiber.Ctx) error // To create a new project
GetUserProjects(c *fiber.Ctx) error // To get all projects
2024-03-16 22:47:19 +01:00
SubmitWeeklyReport(c *fiber.Ctx) error
2024-03-17 18:05:54 +01:00
GetWeeklyReport(c *fiber.Ctx) error
SignReport(c *fiber.Ctx) error
GetProject(c *fiber.Ctx) error
AddUserToProjectHandler(c *fiber.Ctx) error
PromoteToAdmin(c *fiber.Ctx) error
GetWeeklyReportsUserHandler(c *fiber.Ctx) error
IsProjectManagerHandler(c *fiber.Ctx) error
2024-03-20 15:11:25 +01:00
DeleteProject(c *fiber.Ctx) error // To delete a project // WIP
ListAllUsers(c *fiber.Ctx) error // To get a list of all users in the application database
ListAllUsersProject(c *fiber.Ctx) error // To get a list of all users for a specific project
ProjectRoleChange(c *fiber.Ctx) error // To change a users role in a project
ChangeUserName(c *fiber.Ctx) error // WIP
GetAllUsersProject(c *fiber.Ctx) error // WIP
}
// "Constructor"
func NewGlobalState(db database.Database) GlobalState {
return &GState{Db: db}
}
// The global state, which implements all the handlers
type GState struct {
Db database.Database
2024-03-06 09:41:36 +01:00
}