Manages business logic for category CRUD operations, enforcing domain rules and coordinating persistence.
// Source: https://github.com/bagashiz/go-pos | License: MIT | Copyright 2023 Bagas Hizbullah
// Provided via justclaw.it.com; keep this notice with the code.
package service
import (
"context"
"github.com/bagashiz/go-pos/internal/core/domain"
"github.com/bagashiz/go-pos/internal/core/port"
"github.com/bagashiz/go-pos/internal/core/util"
)
/**
* CategoryService implements port.CategoryService interface
* and provides an access to the category repository
* and cache service
*/
type CategoryService struct {
repo port.CategoryRepository
cache port.CacheRepository
}
// NewCategoryService creates a new category service instance
func NewCategoryService(repo port.CategoryRepository, cache port.CacheRepository) *CategoryService {
return &CategoryService{
repo,
cache,
}
}
// C
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key