timeentry

package
v0.0.0-...-8491d02 Latest Latest
Warning

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

Go to latest
Published: May 8, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handlers

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

Handlers provides HTTP handlers for time entry management

func NewHandlers

func NewHandlers(service Service) *Handlers

NewHandlers creates a new Handlers

func (*Handlers) Aggregate

func (h *Handlers) Aggregate(c echo.Context) error

Aggregate handles aggregating time entries based on parameters

func (*Handlers) Create

func (h *Handlers) Create(c echo.Context) error

Create handles the creation of a new time entry

func (*Handlers) Delete

func (h *Handlers) Delete(c echo.Context) error

Delete handles deleting a time entry

func (*Handlers) GetByID

func (h *Handlers) GetByID(c echo.Context) error

GetByID handles retrieving a time entry by ID

func (*Handlers) GetRunningTimers

func (h *Handlers) GetRunningTimers(c echo.Context) error

GetRunningTimers handles retrieving all running timers for a user

func (*Handlers) List

func (h *Handlers) List(c echo.Context) error

List handles retrieving time entries based on filter parameters

func (*Handlers) RegisterRoutes

func (h *Handlers) RegisterRoutes(g *echo.Group, rbacMiddleware *middleware.RBACMiddleware)

RegisterRoutes registers the time entry routes

func (*Handlers) StartTimer

func (h *Handlers) StartTimer(c echo.Context) error

StartTimer handles starting a timer for a task

func (*Handlers) StopTimer

func (h *Handlers) StopTimer(c echo.Context) error

StopTimer handles stopping a running timer for a task

func (*Handlers) Update

func (h *Handlers) Update(c echo.Context) error

Update handles updating a time entry

type Service

type Service interface {
	// Create creates a new time entry
	Create(ctx context.Context, req models.TimeEntryRequest, userID uuid.UUID) (*models.TimeEntryResponse, error)

	// GetByID retrieves a time entry by ID
	GetByID(ctx context.Context, id uuid.UUID) (*models.TimeEntryResponse, error)

	// List retrieves time entries based on filter parameters
	List(ctx context.Context, params models.TimeEntryListParams) ([]models.TimeEntryResponse, int, error)

	// Update updates a time entry
	Update(ctx context.Context, id uuid.UUID, req models.TimeEntryRequest) (*models.TimeEntryResponse, error)

	// Delete deletes a time entry
	Delete(ctx context.Context, id uuid.UUID) error

	// StartTimer starts a timer for a task
	StartTimer(ctx context.Context, taskID uuid.UUID, description string, userID uuid.UUID) (*models.TimeEntryResponse, error)

	// StopTimer stops a running timer for a task
	StopTimer(ctx context.Context, taskID uuid.UUID, userID uuid.UUID) (*models.TimeEntryResponse, error)

	// GetRunningTimers retrieves all running timers for a user
	GetRunningTimers(ctx context.Context, userID uuid.UUID) ([]models.TimeEntryResponse, error)

	// Aggregate aggregates time entries based on parameters
	Aggregate(ctx context.Context, params models.TimeEntryAggregationParams) ([]models.TimeEntryAggregation, error)
}

Service provides time entry management functionality

func NewService

func NewService(timeEntryRepo repository.TimeEntryRepository, taskRepo repository.TaskRepository, userRepo repository.UserRepository) Service

NewService creates a new time entry service

Jump to

Keyboard shortcuts

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