task

package
v0.0.0-...-66b7006 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProjectTask

type ProjectTask struct {
	Task
	ProjectId     int             `json:"-" db:"project_id"`
	Rate          sql.NullFloat64 `json:"-"`
	Billable      bool            `json:"-"`
	ProjectActive bool            `json:"-" db:"project_active"`
}

type Task

type Task struct {
	TaskId          int             `json:"-" db:"task_id"`
	AccountId       int             `json:"-" db:"account_id"`
	Name            string          `json:"-" db:"task_name"`
	DefaultRate     sql.NullFloat64 `json:"-" db:"default_rate"`
	DefaultBillable bool            `json:"-" db:"default_billable"`
	Common          bool            `json:"-"`
	TaskActive      bool            `json:"-" db:"task_active"`
}

func GetTaskListDifference

func GetTaskListDifference(source []Task, other []Task) []Task

Find tasks that are in the source list, but not in the other list

type TaskData

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

func (*TaskData) ArchiveTask

func (c *TaskData) ArchiveTask(taskId int, accountId int) error

func (*TaskData) DeleteTask

func (c *TaskData) DeleteTask(taskId int, accountId int) error

func (*TaskData) GetAllTasks

func (c *TaskData) GetAllTasks(accountId int, active bool) ([]*Task, error)

func (*TaskData) GetTask

func (c *TaskData) GetTask(taskId int, accountId int) (*Task, error)

func (*TaskData) RestoreTask

func (c *TaskData) RestoreTask(taskId int, accountId int) error

func (*TaskData) SaveTask

func (c *TaskData) SaveTask(task *Task) (int, error)

func (*TaskData) UpdateTask

func (c *TaskData) UpdateTask(task *Task) error

type TaskRequest

type TaskRequest struct {
	Id              int
	Name            string
	DefaultRate     float64
	DefaultBillable bool
	Common          bool
}

type TaskResource

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

func (*TaskResource) ArchiveTask

func (c *TaskResource) ArchiveTask(taskId int, accountId int) *api.Error

func (*TaskResource) DeleteTask

func (c *TaskResource) DeleteTask(taskId int, accountId int) *api.Error

func (*TaskResource) GetAllTasks

func (c *TaskResource) GetAllTasks(accountId int, active bool) ([]*Task, *api.Error)

func (*TaskResource) GetTask

func (c *TaskResource) GetTask(taskId int, accountId int) (*Task, *api.Error)

func (*TaskResource) RestoreTask

func (c *TaskResource) RestoreTask(taskId int, accountId int) *api.Error

func (*TaskResource) SaveTask

func (c *TaskResource) SaveTask(accountId int, name string, common bool, rate float64, billable bool) (*Task, *api.Error)

func (*TaskResource) UpdateTask

func (c *TaskResource) UpdateTask(updateTask *Task) *api.Error

type TaskResponse

type TaskResponse struct {
	Id              int     `json:"id,omitempty"`
	Name            string  `json:"name"`
	DefaultRate     float64 `json:"defaultRate,omitempty"`
	DefaultBillable bool    `json:"defaultBillable"`
	TaskActive      bool    `json:"taskActive"`
	Common          bool    `json:"common"`
}

func NewTaskResponse

func NewTaskResponse(task *Task) *TaskResponse

func NewTasksResponse

func NewTasksResponse(tasks []*Task) []*TaskResponse

type TaskRouter

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

func NewRouter

func NewRouter(store TaskStore, profileRouter *profile.ProfileRouter) *TaskRouter

func (*TaskRouter) Router

func (a *TaskRouter) Router() *chi.Mux

type TaskService

type TaskService interface {
	GetTask(taskId int, accountId int) (*Task, *api.Error)
	GetAllTasks(accountId int, active bool) ([]*Task, *api.Error)

	SaveTask(accountId int, name string, common bool, rate float64, billable bool) (*Task, *api.Error)

	UpdateTask(*Task) *api.Error

	ArchiveTask(taskId int, accountId int) *api.Error
	RestoreTask(taskId int, accountId int) *api.Error
	DeleteTask(taskId int, accountId int) *api.Error
}

func NewTaskService

func NewTaskService(store TaskStore) TaskService

type TaskStore

type TaskStore interface {
	GetTask(taskId int, accountId int) (*Task, error)
	GetAllTasks(accountId int, active bool) ([]*Task, error)

	SaveTask(*Task) (int, error)
	UpdateTask(*Task) error

	ArchiveTask(taskId int, accountId int) error
	RestoreTask(taskId int, accountId int) error
	DeleteTask(taskId int, accountId int) error
}

func NewTaskStore

func NewTaskStore(db *sqlx.DB) TaskStore

Jump to

Keyboard shortcuts

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