Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateCategoryRequest ¶
type CreateCategoryRequest struct {
Name string `json:"name"`
Type string `json:"type"`
ParentID *uuid.UUID `json:"parent_id,omitempty"`
Color string `json:"color"`
Icon string `json:"icon"`
}
Request/response structures
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(validator *validation.Validator, repo Repository, logger *zerolog.Logger) *Handler
func (*Handler) CreateCategories ¶
func (h *Handler) CreateCategories(w http.ResponseWriter, r *http.Request)
func (*Handler) DeleteCategory ¶
func (h *Handler) DeleteCategory(w http.ResponseWriter, r *http.Request)
func (*Handler) GetCategories ¶
func (h *Handler) GetCategories(w http.ResponseWriter, r *http.Request)
func (*Handler) UpdateCategory ¶
func (h *Handler) UpdateCategory(w http.ResponseWriter, r *http.Request)
type Repository ¶
type Repository interface {
// ListCategories retrieves all categories for a specific user
ListCategories(ctx context.Context, userID uuid.UUID) ([]repository.Category, error)
// CreateCategory creates a new category
CreateCategory(ctx context.Context, params repository.CreateCategoryParams) (repository.Category, error)
// UpdateCategory updates an existing category
UpdateCategory(ctx context.Context, params repository.UpdateCategoryParams) (repository.Category, error)
// DeleteCategory deletes a category
DeleteCategory(ctx context.Context, id uuid.UUID) error
}
Repository defines the interface for category data operations
func NewRepository ¶
func NewRepository(queries *repository.Queries) Repository
NewRepository creates a new categories repository
Click to show internal directories.
Click to hide internal directories.