Documentation
¶
Index ¶
- func NewDocumentTypeService(docTypeRepo port.DocumentTypeRepository, templateRepo port.TemplateRepository) cataloguc.DocumentTypeUseCase
- func NewFolderService(folderRepo port.FolderRepository) cataloguc.FolderUseCase
- func NewTagService(tagRepo port.TagRepository) cataloguc.TagUseCase
- type DocumentTypeService
- func (s *DocumentTypeService) CreateDocumentType(ctx context.Context, cmd cataloguc.CreateDocumentTypeCommand) (*entity.DocumentType, error)
- func (s *DocumentTypeService) DeleteDocumentType(ctx context.Context, cmd cataloguc.DeleteDocumentTypeCommand) (*cataloguc.DeleteDocumentTypeResult, error)
- func (s *DocumentTypeService) GetDocumentType(ctx context.Context, id string) (*entity.DocumentType, error)
- func (s *DocumentTypeService) GetDocumentTypeByCode(ctx context.Context, tenantID, code string) (*entity.DocumentType, error)
- func (s *DocumentTypeService) ListDocumentTypes(ctx context.Context, tenantID string, filters port.DocumentTypeFilters) ([]*entity.DocumentType, int64, error)
- func (s *DocumentTypeService) ListDocumentTypesWithCount(ctx context.Context, tenantID string, filters port.DocumentTypeFilters) ([]*entity.DocumentTypeListItem, int64, error)
- func (s *DocumentTypeService) UpdateDocumentType(ctx context.Context, cmd cataloguc.UpdateDocumentTypeCommand) (*entity.DocumentType, error)
- type FolderService
- func (s *FolderService) CreateFolder(ctx context.Context, cmd cataloguc.CreateFolderCommand) (*entity.Folder, error)
- func (s *FolderService) DeleteFolder(ctx context.Context, id string) error
- func (s *FolderService) GetFolder(ctx context.Context, id string) (*entity.Folder, error)
- func (s *FolderService) GetFolderPath(ctx context.Context, id string) ([]*entity.Folder, error)
- func (s *FolderService) GetFolderTree(ctx context.Context, workspaceID string) ([]*entity.FolderTree, error)
- func (s *FolderService) GetFolderWithCounts(ctx context.Context, id string) (*entity.FolderWithCounts, error)
- func (s *FolderService) ListChildFolders(ctx context.Context, workspaceID string, parentID *string) ([]*entity.Folder, error)
- func (s *FolderService) ListFolders(ctx context.Context, workspaceID string) ([]*entity.Folder, error)
- func (s *FolderService) ListFoldersWithCounts(ctx context.Context, workspaceID string) ([]*entity.FolderWithCounts, error)
- func (s *FolderService) ListRootFolders(ctx context.Context, workspaceID string) ([]*entity.Folder, error)
- func (s *FolderService) MoveFolder(ctx context.Context, cmd cataloguc.MoveFolderCommand) (*entity.Folder, error)
- func (s *FolderService) UpdateFolder(ctx context.Context, cmd cataloguc.UpdateFolderCommand) (*entity.Folder, error)
- type TagService
- func (s *TagService) CreateTag(ctx context.Context, cmd cataloguc.CreateTagCommand) (*entity.Tag, error)
- func (s *TagService) DeleteTag(ctx context.Context, id string) error
- func (s *TagService) FindTagByName(ctx context.Context, workspaceID, name string) (*entity.Tag, error)
- func (s *TagService) GetTag(ctx context.Context, id string) (*entity.Tag, error)
- func (s *TagService) ListTags(ctx context.Context, workspaceID string) ([]*entity.Tag, error)
- func (s *TagService) ListTagsWithCount(ctx context.Context, workspaceID string) ([]*entity.TagWithCount, error)
- func (s *TagService) UpdateTag(ctx context.Context, cmd cataloguc.UpdateTagCommand) (*entity.Tag, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDocumentTypeService ¶
func NewDocumentTypeService( docTypeRepo port.DocumentTypeRepository, templateRepo port.TemplateRepository, ) cataloguc.DocumentTypeUseCase
NewDocumentTypeService creates a new document type service.
func NewFolderService ¶
func NewFolderService(folderRepo port.FolderRepository) cataloguc.FolderUseCase
NewFolderService creates a new folder service.
func NewTagService ¶
func NewTagService(tagRepo port.TagRepository) cataloguc.TagUseCase
NewTagService creates a new tag service.
Types ¶
type DocumentTypeService ¶
type DocumentTypeService struct {
// contains filtered or unexported fields
}
DocumentTypeService implements document type business logic.
func (*DocumentTypeService) CreateDocumentType ¶
func (s *DocumentTypeService) CreateDocumentType(ctx context.Context, cmd cataloguc.CreateDocumentTypeCommand) (*entity.DocumentType, error)
CreateDocumentType creates a new document type.
func (*DocumentTypeService) DeleteDocumentType ¶
func (s *DocumentTypeService) DeleteDocumentType(ctx context.Context, cmd cataloguc.DeleteDocumentTypeCommand) (*cataloguc.DeleteDocumentTypeResult, error)
DeleteDocumentType attempts to delete a document type. Global types (from SYS tenant) cannot be deleted by other tenants.
func (*DocumentTypeService) GetDocumentType ¶
func (s *DocumentTypeService) GetDocumentType(ctx context.Context, id string) (*entity.DocumentType, error)
GetDocumentType retrieves a document type by ID.
func (*DocumentTypeService) GetDocumentTypeByCode ¶
func (s *DocumentTypeService) GetDocumentTypeByCode(ctx context.Context, tenantID, code string) (*entity.DocumentType, error)
GetDocumentTypeByCode retrieves a document type by code within a tenant. For non-SYS tenants, also checks global (SYS tenant) types.
func (*DocumentTypeService) ListDocumentTypes ¶
func (s *DocumentTypeService) ListDocumentTypes(ctx context.Context, tenantID string, filters port.DocumentTypeFilters) ([]*entity.DocumentType, int64, error)
ListDocumentTypes lists all document types for a tenant with pagination.
func (*DocumentTypeService) ListDocumentTypesWithCount ¶
func (s *DocumentTypeService) ListDocumentTypesWithCount(ctx context.Context, tenantID string, filters port.DocumentTypeFilters) ([]*entity.DocumentTypeListItem, int64, error)
ListDocumentTypesWithCount lists document types with template usage count. For non-SYS tenants, includes global (SYS tenant) types with priority for own types.
func (*DocumentTypeService) UpdateDocumentType ¶
func (s *DocumentTypeService) UpdateDocumentType(ctx context.Context, cmd cataloguc.UpdateDocumentTypeCommand) (*entity.DocumentType, error)
UpdateDocumentType updates a document type's details (name and description only). Global types (from SYS tenant) cannot be modified by other tenants.
type FolderService ¶
type FolderService struct {
// contains filtered or unexported fields
}
FolderService implements folder business logic.
func (*FolderService) CreateFolder ¶
func (s *FolderService) CreateFolder(ctx context.Context, cmd cataloguc.CreateFolderCommand) (*entity.Folder, error)
CreateFolder creates a new folder.
func (*FolderService) DeleteFolder ¶
func (s *FolderService) DeleteFolder(ctx context.Context, id string) error
DeleteFolder deletes a folder.
func (*FolderService) GetFolderPath ¶
GetFolderPath retrieves the full path of a folder from root.
func (*FolderService) GetFolderTree ¶
func (s *FolderService) GetFolderTree(ctx context.Context, workspaceID string) ([]*entity.FolderTree, error)
GetFolderTree retrieves the complete folder tree for a workspace.
func (*FolderService) GetFolderWithCounts ¶
func (s *FolderService) GetFolderWithCounts(ctx context.Context, id string) (*entity.FolderWithCounts, error)
GetFolderWithCounts retrieves a folder by ID including item counts.
func (*FolderService) ListChildFolders ¶
func (s *FolderService) ListChildFolders(ctx context.Context, workspaceID string, parentID *string) ([]*entity.Folder, error)
ListChildFolders lists all child folders of a parent.
func (*FolderService) ListFolders ¶
func (s *FolderService) ListFolders(ctx context.Context, workspaceID string) ([]*entity.Folder, error)
ListFolders lists all folders in a workspace.
func (*FolderService) ListFoldersWithCounts ¶
func (s *FolderService) ListFoldersWithCounts(ctx context.Context, workspaceID string) ([]*entity.FolderWithCounts, error)
ListFoldersWithCounts lists all folders in a workspace including item counts.
func (*FolderService) ListRootFolders ¶
func (s *FolderService) ListRootFolders(ctx context.Context, workspaceID string) ([]*entity.Folder, error)
ListRootFolders lists all root folders in a workspace.
func (*FolderService) MoveFolder ¶
func (s *FolderService) MoveFolder(ctx context.Context, cmd cataloguc.MoveFolderCommand) (*entity.Folder, error)
MoveFolder moves a folder to a new parent.
func (*FolderService) UpdateFolder ¶
func (s *FolderService) UpdateFolder(ctx context.Context, cmd cataloguc.UpdateFolderCommand) (*entity.Folder, error)
UpdateFolder updates a folder's details.
type TagService ¶
type TagService struct {
// contains filtered or unexported fields
}
TagService implements tag business logic.
func (*TagService) CreateTag ¶
func (s *TagService) CreateTag(ctx context.Context, cmd cataloguc.CreateTagCommand) (*entity.Tag, error)
CreateTag creates a new tag.
func (*TagService) DeleteTag ¶
func (s *TagService) DeleteTag(ctx context.Context, id string) error
DeleteTag deletes a tag.
func (*TagService) FindTagByName ¶
func (s *TagService) FindTagByName(ctx context.Context, workspaceID, name string) (*entity.Tag, error)
FindTagByName finds a tag by name within a workspace.
func (*TagService) ListTagsWithCount ¶
func (s *TagService) ListTagsWithCount(ctx context.Context, workspaceID string) ([]*entity.TagWithCount, error)
ListTagsWithCount lists all tags with their template counts.
func (*TagService) UpdateTag ¶
func (s *TagService) UpdateTag(ctx context.Context, cmd cataloguc.UpdateTagCommand) (*entity.Tag, error)
UpdateTag updates a tag's details.