tasks

package
v0.0.0-...-05df700 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminPosition      = "admin"
	ManagerPosition    = "manager"
	AccountantPosition = "accountant"
	WorkerPosition     = "worker"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountCreatedMessage

type AccountCreatedMessage struct {
	PublicId string `json:"public_id"`
	Email    string `json:"email"`
	Fullname string `json:"full_name"`
	Position string `json:"position"`
}

type AuthAccount

type AuthAccount struct {
	PublicId string `json:"public_id"`
	Email    string `json:"email"`
	Fullname string `json:"full_name"`
	Position string `json:"position"`
}

func Authorize

func Authorize(ctx *gin.Context, allowedRoles []string) *AuthAccount

type BaseKafkaMessage

type BaseKafkaMessage struct {
	Type string `json:"type"`
	Data []byte `json:"data"`
}

type CreateTaskRequest

type CreateTaskRequest struct {
	Description string `json:"description"`
}

type CreateTaskResponse

type CreateTaskResponse struct {
	Task Task `json:"task"`
}

type ListMyTasksResponse

type ListMyTasksResponse struct {
	Tasks []Task `json:"tasks"`
}

type ListTasksResponse

type ListTasksResponse struct {
	Tasks []Task `json:"tasks"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(tasksRepo *tasks_repo.Repository, accountsRepo *accounts_repo.Repository) *Service

func (*Service) CompleteTask

func (s *Service) CompleteTask(ctx *gin.Context)

CompleteTask godoc @Summary Complete firmware @Description Complete firmware @Tags tasks @Accept json @Produce json @Param id path int true "Task Id" @Success 201 @Router /api/v1/tasks/{id}/complete [post] @Security OAuth2Password

func (*Service) CreateTask

func (s *Service) CreateTask(ctx *gin.Context)

CreateTask godoc @Summary Create new task @Description Create new task @Tags tasks @Accept json @Produce json @Param ecu body CreateTaskRequest true "Add task" @Success 201 {object} CreateTaskResponse @Router /api/v1/tasks [post] @Security OAuth2Password

func (*Service) ListMyTasks

func (s *Service) ListMyTasks(ctx *gin.Context)

CreateTask godoc @Summary List my tasks @Description List my tasks @Tags tasks @Accept json @Produce json @Success 201 {object} ListMyTasksResponse @Router /api/v1/tasks/my [get] @Security OAuth2Password

func (*Service) ListTasks

func (s *Service) ListTasks(ctx *gin.Context)

CreateTask godoc @Summary List all tasks @Description List all tasks @Tags tasks @Accept json @Produce json @Success 201 {object} ListTasksResponse @Router /api/v1/tasks [get] @Security OAuth2Password

func (*Service) SetupRoutes

func (s *Service) SetupRoutes(router gin.IRouter)

func (*Service) ShuffleTasks

func (s *Service) ShuffleTasks(ctx *gin.Context)

CreateTask godoc @Summary Shuffle tasks @Description Shuffle tasks @Tags tasks @Accept json @Produce json @Success 201 {object} ShuffleTasksResponse @Router /api/v1/tasks/shuffle [post] @Security OAuth2Password

type ShuffleTasksResponse

type ShuffleTasksResponse struct{}

type Task

type Task struct {
	Id          int    `json:"id"`
	AssigneId   int    `json:"assigne_id"`
	Description string `json:"description"`
	Status      string `json:"status"`
}

type TaskAddedMessage

type TaskAddedMessage struct {
	Id              int    `json:"id"`
	AssignePublicId string `json:"assigne_public_id"`
	Description     string `json:"descirption"`
}

type TaskAssignedMessage

type TaskAssignedMessage struct {
	Id              int    `json:"id"`
	AssignePublicId string `json:"assigne_public_id"`
}

type TaskCompletedMessage

type TaskCompletedMessage struct {
	Id              int    `json:"id"`
	AssignePublicId string `json:"assigne_public_id"`
	When            string `json:"when"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL