tasks

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(
	tasksSvc *tasks.Service,
	commentsSvc *comments.Service,
	attachmentsSvc *attachments.Service,
	usersSvc *users.Service,
	projectsSvc *projects.Service,
	logger *zap.Logger,
	validate *validator.Validate,
) handler.Handler

NewHandler creates a new Handler instance with the given dependencies.

Types

type AttachmentConfirmResponse

type AttachmentConfirmResponse struct {
	ID          int64         `json:"id"`
	FileName    string        `json:"file_name"`
	SizeBytes   uint64        `json:"size_bytes"`
	DownloadURL string        `json:"download_url"`
	UploadedAt  string        `json:"uploaded_at"`
	UploadedBy  dto.UserBrief `json:"uploaded_by"`
}

type AttachmentDownloadResponse

type AttachmentDownloadResponse struct {
	DownloadURL string `json:"download_url"`
}

type AttachmentResponse

type AttachmentResponse struct {
	ID          int64         `json:"id"`
	FileName    string        `json:"file_name"`
	SizeBytes   uint64        `json:"size_bytes"`
	UploadedBy  dto.UserBrief `json:"uploaded_by"`
	UploadedAt  string        `json:"uploaded_at"`
	DownloadURL string        `json:"download_url"`
}

type AttachmentUploadRequest

type AttachmentUploadRequest struct {
	FileName  string `json:"file_name"  validate:"required"`
	SizeBytes uint64 `json:"size_bytes" validate:"required,min=1"`
}

type AttachmentUploadResponse

type AttachmentUploadResponse struct {
	ID        int64  `json:"id"`
	FileName  string `json:"file_name"`
	SizeBytes uint64 `json:"size_bytes"`
	UploadURL string `json:"upload_url"`
}

type CommentCreateRequest

type CommentCreateRequest struct {
	Content string `json:"content" validate:"required,min=1,max=10000"`
}

CommentCreateRequest represents the request body for creating a new comment.

@Description	Comment creation request with content.

type CommentResponse

type CommentResponse struct {
	ID        int64         `json:"id"`
	Author    dto.UserBrief `json:"author"`
	Content   string        `json:"content"`
	CreatedAt string        `json:"created_at"`
	UpdatedAt string        `json:"updated_at"`
}

CommentResponse represents the API response for a single comment.

@Description	Full comment details with author information.

type CommentUpdateRequest

type CommentUpdateRequest struct {
	Content string `json:"content" validate:"required,min=1,max=10000"`
}

CommentUpdateRequest represents the request body for updating a comment.

@Description	Comment update request with content.

type Handler

type Handler struct {
	handler.Base
	// contains filtered or unexported fields
}

Handler handles HTTP requests for task-related endpoints.

func (*Handler) Register

func (h *Handler) Register(r fiber.Router)

Register sets up the task routes on the given router. Routes are organized with appropriate middleware for authentication and authorization based on the operation.

type TaskCreateRequest

type TaskCreateRequest struct {
	ProjectSlug string  `json:"project_slug"          validate:"required,max=255"`
	Title       string  `json:"title"                 validate:"required,max=255"`
	Description string  `json:"description,omitempty" validate:"max=10000"`
	Priority    string  `json:"priority,omitempty"    validate:"omitempty,oneof=Trivial Minor Major Critical Blocker"`
	Kind        string  `json:"kind,omitempty"        validate:"omitempty,oneof=Bug Enhancement Task Proposal"`
	AssigneeID  *int64  `json:"assignee_id,omitempty" validate:"omitempty,min=1"`
	DueDate     *string `json:"due_date,omitempty"    validate:"omitempty,datetime=2006-01-02"`
}

TaskCreateRequest represents the request body for creating a new task.

@Description	Task creation request with title, description, priority, assignee, and due date.

type TaskDetailsResponse

type TaskDetailsResponse struct {
	TaskResponse

	Project     *dto.Project         `json:"project"`
	Comments    []CommentResponse    `json:"comments"`
	Attachments []AttachmentResponse `json:"attachments"`
}

type TaskListQuery

type TaskListQuery struct {
	dto.PaginationQuery
	dto.SortQuery

	Project    *string `query:"project"    validate:"omitempty,max=255"`
	Author     *int64  `query:"author"     validate:"omitempty,min=1"`
	Assignee   *int64  `query:"assignee"   validate:"omitempty,min=0"`
	Statuses   *string `query:"statuses"`
	Priorities *string `query:"priorities"`
}

TaskListQuery represents pagination and sorting query parameters.

type TaskListResponse

type TaskListResponse struct {
	Items []TaskResponse `json:"items"`
	Total int            `json:"total"`
}

TaskListResponse represents the API response for a list of tasks.

@Description	Paginated list of tasks with total count.

type TaskResponse

type TaskResponse struct {
	ID          int64          `json:"id"`
	ProjectSlug string         `json:"project_slug"`
	Number      int            `json:"number"`
	Title       string         `json:"title"`
	Description string         `json:"description,omitempty"`
	Priority    string         `json:"priority"`
	Status      string         `json:"status"`
	Kind        string         `json:"kind,omitempty"`
	Author      dto.UserBrief  `json:"author"`
	Assignee    *dto.UserBrief `json:"assignee,omitempty"`
	DueDate     *string        `json:"due_date,omitempty"`
	CreatedAt   string         `json:"created_at"`
	UpdatedAt   string         `json:"updated_at"`
}

TaskResponse represents the API response for a single task.

@Description	Full task details with nested author and assignee information.

type TaskUpdateRequest

type TaskUpdateRequest struct {
	Title       *string `json:"title,omitempty"       validate:"omitempty,max=255"`
	Description *string `json:"description,omitempty" validate:"omitempty,max=10000"`
	Priority    *string `json:"priority,omitempty"    validate:"omitempty,oneof=Trivial Minor Major Critical Blocker"            default:"Minor"`
	Status      *string `json:"status,omitempty"      validate:"omitempty,oneof=New Open 'In Progress' Resolved Closed Reopened"`
	Kind        *string `json:"kind,omitempty"        validate:"omitempty,oneof=Bug Enhancement Task Proposal"                   default:"Task"`
	AssigneeID  *int64  `json:"assignee_id,omitempty" validate:"omitempty,min=0"`
	DueDate     *string `json:"due_date,omitempty"    validate:"omitzero,datetime=2006-01-02"`
	Comment     *string `json:"comment,omitempty"     validate:"omitempty,max=10000"`
}

TaskUpdateRequest represents the request body for updating a task. All fields are optional to support partial updates.

@Description	Task update request with optional fields for partial updates.

Jump to

Keyboard shortcuts

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