48 lines
1.8 KiB
Go
48 lines
1.8 KiB
Go
package store
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.gobha.me/xcaliber/chat-switchboard/models"
|
|
)
|
|
|
|
// =========================================
|
|
// PROJECT STORE (v0.19.0)
|
|
// =========================================
|
|
|
|
type ProjectStore interface {
|
|
// CRUD
|
|
Create(ctx context.Context, p *models.Project) error
|
|
GetByID(ctx context.Context, id string) (*models.Project, error)
|
|
Update(ctx context.Context, id string, patch models.ProjectPatch) error
|
|
Delete(ctx context.Context, id string) error
|
|
|
|
// Listing
|
|
ListForUser(ctx context.Context, userID string, teamIDs []string, includeArchived bool) ([]models.Project, error)
|
|
|
|
// Channel association (atomic move: removes old project if any)
|
|
AddChannel(ctx context.Context, projectID, channelID string, position int) error
|
|
RemoveChannel(ctx context.Context, projectID, channelID string) error
|
|
ListChannels(ctx context.Context, projectID string) ([]models.ProjectChannel, error)
|
|
ReorderChannels(ctx context.Context, projectID string, channelIDs []string) error
|
|
|
|
// KB association
|
|
AddKB(ctx context.Context, projectID, kbID string, autoSearch bool) error
|
|
RemoveKB(ctx context.Context, projectID, kbID string) error
|
|
ListKBs(ctx context.Context, projectID string) ([]models.ProjectKB, error)
|
|
|
|
// Note association
|
|
AddNote(ctx context.Context, projectID, noteID string) error
|
|
RemoveNote(ctx context.Context, projectID, noteID string) error
|
|
ListNotes(ctx context.Context, projectID string) ([]models.ProjectNote, error)
|
|
|
|
// Access check
|
|
UserCanAccess(ctx context.Context, userID, projectID string, teamIDs []string) (bool, error)
|
|
|
|
// Get project ID for a channel (used during note auto-association)
|
|
GetProjectIDForChannel(ctx context.Context, channelID string) (string, error)
|
|
|
|
// Get KB IDs bound to a project (used for virtual injection at completion)
|
|
GetKBIDs(ctx context.Context, projectID string) ([]string, error)
|
|
}
|