Documentation
¶
Index ¶
- Constants
- Variables
- func AddHistoryEvent(ctx context.Context, db *sql.DB, projectID int64, ticketID string, ...) error
- func AddSdlcStageRole(ctx context.Context, db *sql.DB, sdlcID, stageID, roleID int64) error
- func AddTicketLabel(ctx context.Context, db *sql.DB, ticketID string, labelID int64) error
- func ChatEnabled(ctx context.Context, db *sql.DB) (bool, error)
- func CreateSession(ctx context.Context, db *sql.DB, userID string) (string, error)
- func DecryptEmail(stored string) (string, error)
- func DeleteAgent(ctx context.Context, db *sql.DB, id string) error
- func DeleteAgentConfig(ctx context.Context, db *sql.DB, agentID string, key string) error
- func DeleteDependency(ctx context.Context, db *sql.DB, projectID int64, ticketID, dependsOn string) error
- func DeleteGoal(ctx context.Context, db *sql.DB, id int64) error
- func DeleteLabel(ctx context.Context, db *sql.DB, id int64) error
- func DeleteProject(ctx context.Context, db *sql.DB, id int64) error
- func DeleteRole(ctx context.Context, db *sql.DB, id int64) error
- func DeleteSdlc(ctx context.Context, db *sql.DB, id int64) error
- func DeleteSession(ctx context.Context, db *sql.DB, token string) error
- func DeleteStory(ctx context.Context, db *sql.DB, storyID int64) error
- func DeleteTeam(ctx context.Context, db *sql.DB, id int64) error
- func DeleteTicket(ctx context.Context, db *sql.DB, id string) error
- func DeleteTimeEntry(ctx context.Context, db *sql.DB, id int64) error
- func DeleteUser(ctx context.Context, db *sql.DB, username string) error
- func DetectSchemaVersion(path string) (int, error)
- func EncryptEmail(plaintext string) (string, error)
- func ExplainNoWork(ctx context.Context, db *sql.DB, projectID int64, username string) ([]string, error)
- func GetAgentConfigMap(ctx context.Context, db *sql.DB, agentID string) (map[string]string, error)
- func GetAgentConfigUpdatedAt(ctx context.Context, db *sql.DB, agentID string) (string, error)
- func GetSdlcStageOrder(ctx context.Context, db *sql.DB, stageID int64) (int, error)
- func HighestProjectRoleForTeams(ctx context.Context, db *sql.DB, projectID int64, teamIDs []int64) (string, bool, error)
- func ImportSnapshot(ctx context.Context, db *sql.DB, snapshot Snapshot) error
- func Init(path, adminUsername, adminPassword string, seedFn ...SeedFunc) error
- func LinkStoryToTicket(ctx context.Context, db *sql.DB, storyID int64, ticketID string) error
- func ListTicketsByLabel(ctx context.Context, db *sql.DB, labelID int64) ([]string, error)
- func Open(path string) (*sql.DB, error)
- func ParseLifecycleStatus(raw string) (string, string, error)
- func ProjectRoleForUser(ctx context.Context, db *sql.DB, projectID int64, userID string) (string, bool, error)
- func PurgeExpiredSessions(ctx context.Context, db *sql.DB) (int64, error)
- func PurgeOldHistory(ctx context.Context, db *sql.DB, retentionDays int) (int64, error)
- func ReapStaleAgents(ctx context.Context, db *sql.DB, thresholdMinutes int) (int64, error)
- func RegistrationEnabled(ctx context.Context, db *sql.DB) (bool, error)
- func RemoveProjectMember(ctx context.Context, db *sql.DB, projectID int64, userID string) error
- func RemoveProjectTeamMember(ctx context.Context, db *sql.DB, projectID, teamID int64) error
- func RemoveSdlcStage(ctx context.Context, db *sql.DB, stageID int64) error
- func RemoveSdlcStageRole(ctx context.Context, db *sql.DB, sdlcID, stageID, roleID int64) error
- func RemoveTeamAgent(ctx context.Context, db *sql.DB, teamID int64, agentID string) error
- func RemoveTeamMember(ctx context.Context, db *sql.DB, teamID int64, userID string) error
- func RemoveTicketLabel(ctx context.Context, db *sql.DB, ticketID string, labelID int64) error
- func RenameProjectPrefix(ctx context.Context, db *sql.DB, projectID int64, newPrefix string) (int, error)
- func RenderLifecycleStatus(stage, state string) string
- func ReorderSdlcStageRoles(ctx context.Context, db *sql.DB, sdlcID, stageID int64, roleIDs []int64) error
- func ReorderSdlcStages(ctx context.Context, db *sql.DB, sdlcID int64, orderedStageIDs []int64) error
- func ResolveSdlcID(ctx context.Context, db *sql.DB, ticket Ticket) *int64
- func SetAgentConfig(ctx context.Context, db *sql.DB, agentID string, key, value string) error
- func SetChatEnabled(ctx context.Context, db *sql.DB, enabled bool) error
- func SetChatLimitsConfig(ctx context.Context, db *sql.DB, maxConnections, maxDurationMin int) error
- func SetProjectDefaultDraft(ctx context.Context, db *sql.DB, projectID int64, draft bool) error
- func SetRegistrationEnabled(ctx context.Context, db *sql.DB, enabled bool) error
- func SetUserEnabled(ctx context.Context, db *sql.DB, username string, enabled bool) error
- func StoryIDForTicket(ctx context.Context, db *sql.DB, ticketID string) (int64, bool, error)
- func TeamDescendantIDs(ctx context.Context, db *sql.DB, teamID int64) ([]int64, error)
- func TeamIDsForUserWithAncestors(ctx context.Context, db *sql.DB, userID string) ([]int64, error)
- func TeamRoleForUser(ctx context.Context, db *sql.DB, teamID int64, userID string) (string, bool, error)
- func TotalTimeForTicket(ctx context.Context, db *sql.DB, ticketID string) (int, error)
- func UpgradeDatabase(ctx context.Context, sourcePath, targetPath string) error
- func ValidLifecycle(stage, state string) bool
- func ValidStage(stage string) bool
- func ValidState(state string) bool
- type Agent
- func AuthenticateAgent(ctx context.Context, db *sql.DB, agentID, plainPassword string) (Agent, error)
- func CreateAgent(ctx context.Context, db *sql.DB, plainPassword string) (Agent, string, error)
- func GetAgentByID(ctx context.Context, db *sql.DB, id string) (Agent, error)
- func GetAgentByUUID(ctx context.Context, db *sql.DB, uuid string) (Agent, error)
- func ListAgents(ctx context.Context, db *sql.DB) ([]Agent, error)
- func ListAgentsPage(ctx context.Context, db *sql.DB, limit, offset int) ([]Agent, error)
- func SetAgentEnabled(ctx context.Context, db *sql.DB, id string, enabled bool) (Agent, error)
- func TouchAgent(ctx context.Context, db *sql.DB, id string, status string) (Agent, error)
- func UpdateAgent(ctx context.Context, db *sql.DB, id string, params AgentUpdateParams) (Agent, error)
- type AgentConfigEntry
- type AgentStatus
- type AgentUpdateParams
- type ChatLimits
- type Comment
- type CountSummary
- type Dependency
- type Goal
- type GuidanceMap
- type HistoryEvent
- func ListHistoryEvents(ctx context.Context, db *sql.DB, ticketID string, limit, offset int) ([]HistoryEvent, error)
- func ListProjectHistory(ctx context.Context, db *sql.DB, projectID int64, limit int) ([]HistoryEvent, error)
- func ListProjectHistoryFiltered(ctx context.Context, db *sql.DB, projectID int64, limit int, ...) ([]HistoryEvent, error)
- type HistoryFilter
- type Label
- func CreateLabel(ctx context.Context, db *sql.DB, projectID int64, name, color string) (Label, error)
- func CreateLabelWithParams(ctx context.Context, db *sql.DB, params LabelCreateParams) (Label, error)
- func GetLabel(ctx context.Context, db *sql.DB, id int64) (Label, error)
- func ListLabels(ctx context.Context, db *sql.DB, projectID int64, limit, offset int) ([]Label, error)
- func ListTicketLabels(ctx context.Context, db *sql.DB, ticketID string) ([]Label, error)
- type LabelCreateParams
- type Project
- func CreateProject(ctx context.Context, db *sql.DB, title, description, acceptanceCriteria string, ...) (Project, error)
- func CreateProjectWithParams(ctx context.Context, db *sql.DB, params ProjectCreateParams) (Project, error)
- func GetProject(ctx context.Context, db *sql.DB, rawID string) (Project, error)
- func GetProjectByID(ctx context.Context, db *sql.DB, id int64) (Project, error)
- func ListProjects(ctx context.Context, db *sql.DB, limit int) ([]Project, error)
- func ListProjectsVisibleToUser(ctx context.Context, db *sql.DB, user User) ([]Project, error)
- func SetProjectStatus(ctx context.Context, db *sql.DB, id int64, enabled bool) (Project, error)
- func UpdateProject(ctx context.Context, db *sql.DB, id int64, ...) (Project, error)
- func UpdateProjectWithParams(ctx context.Context, db *sql.DB, id int64, params ProjectUpdateParams) (Project, error)
- type ProjectCreateParams
- type ProjectMember
- func AddProjectMember(ctx context.Context, db *sql.DB, projectID int64, userID string, role string) (ProjectMember, error)
- func GetProjectMember(ctx context.Context, db *sql.DB, projectID int64, userID string) (ProjectMember, error)
- func ListProjectMembers(ctx context.Context, db *sql.DB, projectID int64) ([]ProjectMember, error)
- type ProjectTeamMember
- type ProjectUpdateParams
- type ResolvedGuidance
- type Role
- func CreateRole(ctx context.Context, db *sql.DB, sdlcID *int64, title, description, ac string) (Role, error)
- func CreateRoleWithParams(ctx context.Context, db *sql.DB, params RoleCreateParams) (Role, error)
- func GetRoleByID(ctx context.Context, db *sql.DB, id int64) (Role, error)
- func GetRoleByTitle(ctx context.Context, db *sql.DB, title string) (Role, error)
- func ListRoles(ctx context.Context, db *sql.DB, limit int) ([]Role, error)
- func ListRolesBySdlc(ctx context.Context, db *sql.DB, sdlcID int64) ([]Role, error)
- func ListSdlcStageRoles(ctx context.Context, db *sql.DB, sdlcID, stageID int64) ([]Role, error)
- func UpdateRole(ctx context.Context, db *sql.DB, id int64, title, description, ac string) (Role, error)
- func UpdateRoleWithParams(ctx context.Context, db *sql.DB, id int64, params RoleUpdateParams) (Role, error)
- type RoleCreateParams
- type RoleUpdateParams
- type SchemaVersionError
- type Sdlc
- func CreateSdlc(ctx context.Context, db *sql.DB, name, description string) (Sdlc, error)
- func CreateSdlcWithParams(ctx context.Context, db *sql.DB, id *int64, name, description string) (Sdlc, error)
- func ImportSdlc(ctx context.Context, db *sql.DB, export SdlcExport) (Sdlc, error)
- func ListSdlcs(ctx context.Context, db *sql.DB, limit, offset int) ([]Sdlc, error)
- type SdlcExport
- type SdlcStage
- func AddSdlcStage(ctx context.Context, db *sql.DB, sdlcID int64, ...) (SdlcStage, error)
- func AddSdlcStageWithDefinitions(ctx context.Context, db *sql.DB, sdlcID int64, stageName, wow, dor, dod string, ...) (SdlcStage, error)
- func GetSdlcStage(ctx context.Context, db *sql.DB, stageID int64) (SdlcStage, error)
- func ListSdlcStages(ctx context.Context, db *sql.DB, sdlcID int64) ([]SdlcStage, error)
- func UpdateSdlcStage(ctx context.Context, db *sql.DB, stageID int64, ...) (SdlcStage, error)
- func UpdateSdlcStageWithDefinitions(ctx context.Context, db *sql.DB, stageID int64, name, wow, dor, dod string) (SdlcStage, error)
- type SdlcStageExport
- type SdlcWithStages
- type SeedFunc
- type Snapshot
- type SnapshotTable
- type Story
- func CreateStory(ctx context.Context, db *sql.DB, projectID int64, title, description string, ...) (Story, error)
- func CreateStoryWithParams(ctx context.Context, db *sql.DB, params StoryCreateParams) (Story, error)
- func GetStory(ctx context.Context, db *sql.DB, storyID int64) (Story, error)
- func ListStoriesByProject(ctx context.Context, db *sql.DB, projectID int64, limit, offset int) ([]Story, error)
- func UpdateStory(ctx context.Context, db *sql.DB, storyID int64, title, description string) (Story, error)
- func UpdateStoryStatus(ctx context.Context, db *sql.DB, storyID int64, status string) (Story, error)
- type StoryCreateParams
- type Team
- func CreateTeam(ctx context.Context, db *sql.DB, name string, parentTeamID *int64) (Team, error)
- func CreateTeamWithParams(ctx context.Context, db *sql.DB, params TeamCreateParams) (Team, error)
- func GetTeamByID(ctx context.Context, db *sql.DB, id int64) (Team, error)
- func ListTeams(ctx context.Context, db *sql.DB, limit int) ([]Team, error)
- func UpdateTeam(ctx context.Context, db *sql.DB, id int64, name string, parentTeamID *int64) (Team, error)
- type TeamAgent
- type TeamCreateParams
- type TeamMember
- type Ticket
- func CloneTicket(ctx context.Context, db *sql.DB, id string, author string, createdBy string) (Ticket, error)
- func CreateTicket(ctx context.Context, db *sql.DB, params TicketCreateParams) (Ticket, error)
- func CurrentAssignedTicketForUser(ctx context.Context, db *sql.DB, projectID int64, username string) (Ticket, bool, error)
- func GetTicket(ctx context.Context, db *sql.DB, id string) (Ticket, error)
- func GetTicketByProject(ctx context.Context, db *sql.DB, projectID int64, id string) (Ticket, error)
- func GetTicketByRef(ctx context.Context, db *sql.DB, raw string) (Ticket, error)
- func ListTicketParents(ctx context.Context, db *sql.DB, id string) ([]Ticket, error)
- func ListTickets(ctx context.Context, db *sql.DB, params TicketListParams) ([]Ticket, error)
- func ListTicketsByProject(ctx context.Context, db *sql.DB, projectID int64) ([]Ticket, error)
- func NextTicket(ctx context.Context, db *sql.DB, id string, actorUsername, actorID string) (Ticket, error)
- func PreviousTicket(ctx context.Context, db *sql.DB, id string, actorUsername, actorID string) (Ticket, error)
- func RequestTicket(ctx context.Context, db *sql.DB, params TicketRequestParams) (Ticket, string, error)
- func SearchTickets(ctx context.Context, db *sql.DB, projectID int64, query string) ([]Ticket, error)
- func SetTicketArchived(ctx context.Context, db *sql.DB, id string, archived bool, ...) (Ticket, error)
- func SetTicketComplete(ctx context.Context, db *sql.DB, id string, complete bool, ...) (Ticket, error)
- func SetTicketDraft(ctx context.Context, db *sql.DB, id string, draft bool, actorUsername string, ...) (Ticket, error)
- func SetTicketHealth(ctx context.Context, db *sql.DB, id string, score int) (Ticket, error)
- func SetTicketSdlc(ctx context.Context, db *sql.DB, ticketID string, sdlcID int64) (Ticket, error)
- func UnsetTicketSdlc(ctx context.Context, db *sql.DB, ticketID string) (Ticket, error)
- func UpdateTicket(ctx context.Context, db *sql.DB, id string, params TicketUpdateParams) (Ticket, error)
- type TicketContext
- type TicketCreateParams
- type TicketHistoryEvent
- type TicketListParams
- type TicketRequestParams
- type TicketUpdateParams
- type TimeEntry
- type TypeCount
- type User
- func AuthenticateUser(ctx context.Context, db *sql.DB, username, plainPassword string) (User, error)
- func CreateUser(ctx context.Context, db *sql.DB, username, plainPassword, role string) (User, error)
- func GetUserByID(ctx context.Context, db *sql.DB, id string) (User, error)
- func GetUserByToken(ctx context.Context, db *sql.DB, token string) (User, error)
- func GetUserByUsername(ctx context.Context, db *sql.DB, username string) (User, error)
- func ListUsers(ctx context.Context, db *sql.DB, limit int) ([]User, error)
- func RegisterUser(ctx context.Context, db *sql.DB, username, plainPassword string) (User, error)
- func ResetUserPassword(ctx context.Context, db *sql.DB, username, newPlainPassword string) (User, error)
Constants ¶
const ( AgentConfigKeyLLM = "llm" AgentConfigKeyProjectID = "project_id" AgentConfigKeyPollSeconds = "poll_seconds" AgentConfigKeyVerbose = "verbose" )
Predefined agent config keys
const ( StageDesign = "design" StageDevelop = "develop" StageTest = "test" StageDone = "done" )
const ( StateIdle = "idle" StateActive = "active" StateSuccess = "success" StateFail = "fail" StateComplete = "complete" )
const ( DefaultListLimit = 100 DefaultHistoryLimit = 50 )
const ( ProjectVisibilityPrivate = "private" ProjectVisibilityPublic = "public" )
const ( ProjectRoleViewer = "viewer" ProjectRoleEditor = "editor" ProjectRoleOwner = "owner" )
const ( LegacySchemaVersion = 1 CurrentSchemaVersion = 2 )
const ( DefaultChatMaxConnections = 2 DefaultChatMaxDurationMinutes = 3 DefaultChatEnabled = true )
const ( TeamRoleMember = "member" TeamRoleOwner = "owner" )
const DefaultGuidanceStageKey = "default"
const SnapshotSchemaVersion = "ticket.schema.v1"
Variables ¶
var ( ErrInvalidCredentials = errors.New("invalid credentials") ErrForbidden = errors.New("forbidden") ErrAdminRequired = errors.New("user is not an admin") ErrAccountLocked = errors.New("account locked, try again later") )
var ( ErrTeamNotFound = errors.New("team not found") ErrTeamMemberNotFound = errors.New("team member not found") )
var ( ErrTicketNotFound = errors.New("ticket not found") ErrTicketHasChildren = errors.New("ticket has child tickets") ErrTicketClosed = errors.New("ticket is closed") ErrTicketArchived = errors.New("ticket is archived") )
var ErrDependencyNotFound = errors.New("dependency not found")
var ErrLabelNotFound = errors.New("label not found")
var ErrProjectMembershipNotFound = errors.New("project membership not found")
var ErrProjectNotFound = errors.New("project not found")
var ErrSdlcStageNotFound = errors.New("sdlc stage not found in sdlc")
var ErrTimeEntryNotFound = errors.New("time entry not found")
Functions ¶
func AddHistoryEvent ¶
func AddSdlcStageRole ¶ added in v0.1.842
func AddTicketLabel ¶
func CreateSession ¶
func DecryptEmail ¶
DecryptEmail decrypts an email address encrypted with EncryptEmail. If the value doesn't have the "enc:" prefix, it's returned as plaintext.
func DeleteAgentConfig ¶
func DeleteDependency ¶
func DeleteProject ¶
DeleteProject removes a project and all associated data.
func DeleteSdlc ¶ added in v0.1.842
func DetectSchemaVersion ¶ added in v0.1.842
func EncryptEmail ¶
EncryptEmail encrypts an email address using AES-256-GCM. If no encryption key is configured, the plaintext is returned as-is.
func ExplainNoWork ¶
func ExplainNoWork(ctx context.Context, db *sql.DB, projectID int64, username string) ([]string, error)
ExplainNoWork returns human-readable reasons why no ticket was available for automatic assignment in the given project.
func GetAgentConfigMap ¶
GetAgentConfigMap returns agent config as a map[string]string.
func GetAgentConfigUpdatedAt ¶
GetAgentConfigUpdatedAt returns the most recent updated_at timestamp from agent_config. Returns empty string if no config exists.
func GetSdlcStageOrder ¶ added in v0.1.842
GetSdlcStageOrder returns the sort_order for a sdlc stage by ID.
func Init ¶
Init creates a new database at path with an admin user and a default project. The seedFn (if non-nil) is called to populate SDLCs and roles from embedded static files. If nil, no SDLCs are created and the project has no lifecycle.
func LinkStoryToTicket ¶
func ListTicketsByLabel ¶
func ProjectRoleForUser ¶
func PurgeExpiredSessions ¶ added in v0.1.733
PurgeExpiredSessions deletes sessions whose expires_at is in the past. Returns the number of rows deleted.
func PurgeOldHistory ¶ added in v0.1.733
PurgeOldHistory deletes ticket_history events older than retentionDays days. Returns the number of rows deleted.
func ReapStaleAgents ¶
ReapStaleAgents sets any non-idle agent to "idle" if its last_seen is older than the given threshold (in minutes). Returns the number of agents reaped.
func RemoveProjectMember ¶
func RemoveProjectTeamMember ¶
func RemoveSdlcStage ¶ added in v0.1.842
func RemoveSdlcStageRole ¶ added in v0.1.842
func RemoveTeamAgent ¶
func RemoveTeamMember ¶
func RemoveTicketLabel ¶
func RenameProjectPrefix ¶ added in v0.1.733
func RenameProjectPrefix(ctx context.Context, db *sql.DB, projectID int64, newPrefix string) (int, error)
RenameProjectPrefix changes a project's prefix and re-keys every ticket in that project. All foreign-key references (parent_id, clone_of, dependencies, comments, history, labels, time entries, story links) are updated in a single transaction.
func RenderLifecycleStatus ¶
func ReorderSdlcStageRoles ¶ added in v0.1.842
func ReorderSdlcStages ¶ added in v0.1.842
func ResolveSdlcID ¶ added in v0.1.842
ResolveSdlcID returns the effective sdlc ID for a ticket by walking: ticket.SdlcID → parent chain → project.SdlcID.
func SetAgentConfig ¶
func SetChatLimitsConfig ¶
func SetProjectDefaultDraft ¶ added in v0.1.842
SetProjectDefaultDraft sets the default_draft flag on a project.
func SetRegistrationEnabled ¶
func SetUserEnabled ¶
func StoryIDForTicket ¶
func TeamDescendantIDs ¶
func TeamRoleForUser ¶
func TotalTimeForTicket ¶
func UpgradeDatabase ¶ added in v0.1.842
func ValidLifecycle ¶
func ValidStage ¶
func ValidState ¶
Types ¶
type Agent ¶
type Agent = User
Agent is a type alias for User. Agents are users with user_type='agent'.
func AuthenticateAgent ¶
func CreateAgent ¶
func GetAgentByUUID ¶
func ListAgentsPage ¶ added in v0.1.842
func SetAgentEnabled ¶
func TouchAgent ¶
func UpdateAgent ¶
type AgentConfigEntry ¶
type AgentConfigEntry struct {
UserID string `json:"user_id"`
Key string `json:"key"`
Value string `json:"value"`
}
func ListAgentConfig ¶
type AgentStatus ¶
type AgentStatus struct {
Agent Agent `json:"agent"`
TicketKey *string `json:"ticket_key,omitempty"`
ProjectName string `json:"project_name,omitempty"`
SdlcName string `json:"sdlc_name,omitempty"`
RoleTitle string `json:"role_title,omitempty"`
}
AgentStatus holds an agent and its currently assigned ticket (if any).
func ListAgentStatuses ¶
ListAgentStatuses returns all agents with their currently assigned active ticket.
type AgentUpdateParams ¶
type AgentUpdateParams struct {
Password *string
}
type ChatLimits ¶
type ChatLimits struct {
MaxConnections int `json:"chat_max_connections"`
MaxDurationMin int `json:"chat_max_duration_minutes"`
}
func ChatLimitsConfig ¶
type Comment ¶
type Comment struct {
ID int64 `json:"-"`
ItemID string `json:"-"`
UserID string `json:"-"`
Author string `json:"author"`
Comment string `json:"-"`
Text string `json:"text"`
CreatedAt string `json:"date"`
}
func AddComment ¶
type CountSummary ¶
type CountSummary struct {
Users int `json:"users"`
Projects int `json:"projects,omitempty"`
Types []TypeCount `json:"types"`
}
func CountEverything ¶
type Dependency ¶
type Dependency struct {
ID int64 `json:"id"`
ProjectID int64 `json:"project_id"`
TicketID string `json:"ticket_id"`
DependsOn string `json:"depends_on"`
CreatedBy string `json:"created_by"`
CreatedAt string `json:"created_at"`
}
func AddDependency ¶
func ListDependencies ¶
type Goal ¶
type Goal struct {
ID int64 `json:"goal_id"`
ProjectID int64 `json:"project_id"`
Title string `json:"title"`
Description string `json:"description"`
Notes string `json:"notes"`
ETA string `json:"eta"`
Priority int `json:"priority"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
func CreateGoal ¶
type GuidanceMap ¶ added in v0.1.842
type HistoryEvent ¶
type HistoryEvent struct {
ID int64 `json:"id"`
ProjectID int64 `json:"project_id"`
TicketID string `json:"ticket_id"`
TicketKey string `json:"ticket_key,omitempty"`
EventType string `json:"event_type"`
Payload string `json:"payload"`
CreatedBy string `json:"created_by"`
CreatedAt string `json:"created_at"`
}
func ListHistoryEvents ¶
func ListProjectHistory ¶
func ListProjectHistory(ctx context.Context, db *sql.DB, projectID int64, limit int) ([]HistoryEvent, error)
ListProjectHistory returns the most recent history events for all tickets in a project, ordered newest first, limited to limit rows.
func ListProjectHistoryFiltered ¶ added in v0.1.733
func ListProjectHistoryFiltered(ctx context.Context, db *sql.DB, projectID int64, limit int, filter HistoryFilter) ([]HistoryEvent, error)
ListProjectHistoryFiltered returns the most recent history events for all tickets in a project, applying optional actor filters.
type HistoryFilter ¶ added in v0.1.733
type HistoryFilter struct {
UserID string // filter by exact user_id (created_by)
AgentID string // filter by agent user_id (created_by)
TeamID int64 // filter by team membership (team_members)
}
HistoryFilter holds optional filter criteria for history queries.
type Label ¶
type Label struct {
ID int64 `json:"label_id"`
ProjectID int64 `json:"project_id"`
Name string `json:"name"`
Color string `json:"color"`
CreatedAt string `json:"created_at"`
}
func CreateLabel ¶
func CreateLabelWithParams ¶ added in v0.1.842
func ListLabels ¶
type LabelCreateParams ¶ added in v0.1.842
type Project ¶
type Project struct {
ID int64 `json:"project_id"`
Prefix string `json:"prefix"`
Title string `json:"title"`
Description string `json:"description"`
AcceptanceCriteria string `json:"acceptance_criteria"`
DORMap GuidanceMap `json:"dor_map,omitempty"`
DODMap GuidanceMap `json:"dod_map,omitempty"`
ACMap GuidanceMap `json:"ac_map,omitempty"`
GitRepository string `json:"git_repository"`
Notes string `json:"notes"`
Status string `json:"status"`
Visibility string `json:"visibility"`
DefaultDraft bool `json:"default_draft"`
CreatedBy string `json:"created_by"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
SdlcID *int64 `json:"sdlc_id,omitempty"`
}
func CreateProject ¶
func CreateProjectWithParams ¶
func GetProjectByID ¶
func ListProjects ¶
func SetProjectStatus ¶
func UpdateProject ¶
func UpdateProjectWithParams ¶
func (Project) ResolveGuidance ¶ added in v0.1.842
func (p Project) ResolveGuidance(stage string) ResolvedGuidance
type ProjectCreateParams ¶
type ProjectCreateParams struct {
ID *int64
Prefix string
Title string
Description string
AcceptanceCriteria string
DORMap GuidanceMap
DODMap GuidanceMap
ACMap GuidanceMap
GitRepository string
Notes string
Visibility string
CreatedBy string
SdlcID *int64
}
type ProjectMember ¶
type ProjectMember struct {
ProjectID int64 `json:"project_id"`
UserID string `json:"user_id"`
Username string `json:"username"`
Role string `json:"role"`
}
func AddProjectMember ¶
func GetProjectMember ¶
func ListProjectMembers ¶
type ProjectTeamMember ¶
type ProjectTeamMember struct {
ProjectID int64 `json:"project_id"`
TeamID int64 `json:"team_id"`
TeamName string `json:"team_name"`
Role string `json:"role"`
}
func AddProjectTeamMember ¶
func ListProjectTeamMembers ¶
type ProjectUpdateParams ¶
type ProjectUpdateParams struct {
Title string
Description string
AcceptanceCriteria string
DORMap GuidanceMap
DODMap GuidanceMap
ACMap GuidanceMap
GitRepository string
Notes string
Status string
Visibility string
SdlcID *int64
}
type ResolvedGuidance ¶ added in v0.1.842
type Role ¶
type Role struct {
ID int64 `json:"role_id"`
SdlcID *int64 `json:"sdlc_id,omitempty"`
Title string `json:"title"`
Description string `json:"description"`
AcceptanceCriteria string `json:"acceptance_criteria"`
DORMap GuidanceMap `json:"dor_map,omitempty"`
DODMap GuidanceMap `json:"dod_map,omitempty"`
ACMap GuidanceMap `json:"ac_map,omitempty"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
func CreateRole ¶
func CreateRoleWithParams ¶ added in v0.1.842
func GetRoleByTitle ¶
func ListRolesBySdlc ¶ added in v0.1.842
func ListSdlcStageRoles ¶ added in v0.1.842
func UpdateRole ¶
func UpdateRoleWithParams ¶ added in v0.1.842
func (Role) ResolveGuidance ¶ added in v0.1.842
func (r Role) ResolveGuidance(stage string) ResolvedGuidance
type RoleCreateParams ¶ added in v0.1.842
type RoleCreateParams struct {
ID *int64
SdlcID *int64
Title string
Description string
AcceptanceCriteria string
DORMap GuidanceMap
DODMap GuidanceMap
ACMap GuidanceMap
}
type RoleUpdateParams ¶ added in v0.1.842
type RoleUpdateParams struct {
Title string
Description string
AcceptanceCriteria string
DORMap GuidanceMap
DODMap GuidanceMap
ACMap GuidanceMap
}
type SchemaVersionError ¶ added in v0.1.842
func (*SchemaVersionError) Error ¶ added in v0.1.842
func (e *SchemaVersionError) Error() string
type Sdlc ¶ added in v0.1.842
type Sdlc struct {
ID int64 `json:"sdlc_id"`
Name string `json:"name"`
Description string `json:"description"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
func CreateSdlc ¶ added in v0.1.842
func CreateSdlcWithParams ¶ added in v0.1.842
func ImportSdlc ¶ added in v0.1.842
type SdlcExport ¶ added in v0.1.842
type SdlcExport struct {
Name string `json:"name"`
Description string `json:"description"`
Stages []SdlcStageExport `json:"stages"`
}
func ExportSdlc ¶ added in v0.1.842
type SdlcStage ¶ added in v0.1.842
type SdlcStage struct {
ID int64 `json:"sdlc_stage_id"`
SdlcID int64 `json:"sdlc_id"`
StageName string `json:"stage_name"`
Description string `json:"description"`
AcceptanceCriteria string `json:"acceptance_criteria"`
DefinitionOfReady string `json:"definition_of_ready"`
DefinitionOfDone string `json:"definition_of_done"`
SortOrder int `json:"sort_order"`
Roles []Role `json:"roles,omitempty"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
func AddSdlcStage ¶ added in v0.1.842
func AddSdlcStageWithDefinitions ¶ added in v0.1.842
func GetSdlcStage ¶ added in v0.1.842
func ListSdlcStages ¶ added in v0.1.842
func UpdateSdlcStage ¶ added in v0.1.842
type SdlcStageExport ¶ added in v0.1.842
type SdlcWithStages ¶ added in v0.1.842
type SeedFunc ¶ added in v0.1.842
SeedFunc is called during Init to seed the database with SDLCs and roles. It receives the opened database and should create at least one SDLC. The first SDLC found after seeding is assigned to the default project.
type Snapshot ¶
type Snapshot struct {
SchemaVersion string `json:"schema_version"`
ExportedAt string `json:"exported_at"`
Signature string `json:"signature,omitempty"`
Tables map[string]SnapshotTable `json:"tables"`
}
type SnapshotTable ¶
type Story ¶
type Story struct {
ID int64 `json:"story_id"`
ProjectID int64 `json:"project_id"`
Title string `json:"title"`
Description string `json:"description"`
Status string `json:"status"`
CreatedBy string `json:"created_by"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
func CreateStory ¶
func CreateStoryWithParams ¶ added in v0.1.842
func ListStoriesByProject ¶
func UpdateStory ¶
type StoryCreateParams ¶ added in v0.1.842
type Team ¶
type Team struct {
ID int64 `json:"team_id"`
Name string `json:"name"`
ParentTeamID *int64 `json:"parent_team_id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
func CreateTeam ¶
func CreateTeamWithParams ¶ added in v0.1.842
type TeamAgent ¶
type TeamAgent struct {
TeamID int64 `json:"team_id"`
AgentID string `json:"agent_id"`
AgentUUID string `json:"agent_uuid"`
Enabled bool `json:"enabled"`
Status string `json:"status"`
}
func AddTeamAgent ¶
type TeamCreateParams ¶ added in v0.1.842
type TeamMember ¶
type TeamMember struct {
TeamID int64 `json:"team_id"`
UserID string `json:"user_id"`
Username string `json:"username"`
Role string `json:"role"`
JobTitle string `json:"job_title"`
}
func AddTeamMember ¶
func GetTeamMember ¶
func ListTeamMembers ¶
type Ticket ¶
type Ticket struct {
ID string `json:"ticket_id"`
ProjectID int64 `json:"project_id"`
ParentID *string `json:"parent_id,omitempty"`
CloneOf *string `json:"clone_of,omitempty"`
Type string `json:"type"`
Title string `json:"title"`
Description string `json:"description"`
AcceptanceCriteria string `json:"acceptance_criteria"`
DORMap GuidanceMap `json:"dor_map,omitempty"`
DODMap GuidanceMap `json:"dod_map,omitempty"`
ACMap GuidanceMap `json:"ac_map,omitempty"`
GitRepository string `json:"git_repository"`
GitBranch string `json:"git_branch"`
SdlcID *int64 `json:"sdlc_id,omitempty"`
SdlcStageID *int64 `json:"sdlc_stage_id,omitempty"`
RoleID *int64 `json:"role_id,omitempty"`
Stage string `json:"stage"`
State string `json:"state"`
Status string `json:"status"`
Priority int `json:"priority"`
Order int `json:"order"`
EstimateEffort int `json:"estimate_effort"`
EstimateComplete string `json:"estimate_complete,omitempty"`
HealthScore int `json:"health_score"`
Assignee string `json:"assignee"`
Author string `json:"author"`
Comments []Comment `json:"comments,omitempty"`
Draft bool `json:"draft"`
Complete bool `json:"complete"`
Archived bool `json:"archived"`
Deleted bool `json:"deleted"`
PreviousSdlcStageID *int64 `json:"previous_sdlc_stage_id,omitempty"`
PreviousRoleID *int64 `json:"previous_role_id,omitempty"`
CreatedBy string `json:"created_by"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
func CloneTicket ¶
func CreateTicket ¶
func GetTicketByProject ¶
func GetTicketByRef ¶
func ListTicketParents ¶
func ListTickets ¶
func ListTicketsByProject ¶
func NextTicket ¶ added in v0.1.842
func NextTicket(ctx context.Context, db *sql.DB, id string, actorUsername, actorID string) (Ticket, error)
NextTicket advances a ticket to the next role within its stage, or to the first role of the next stage if it's at the last role. Requires state=success.
func PreviousTicket ¶ added in v0.1.842
func PreviousTicket(ctx context.Context, db *sql.DB, id string, actorUsername, actorID string) (Ticket, error)
PreviousTicket moves a ticket back to the previous role or stage. Requires state=fail.
func RequestTicket ¶
func SearchTickets ¶
func SetTicketArchived ¶
func SetTicketComplete ¶ added in v0.1.842
func SetTicketDraft ¶ added in v0.1.842
func SetTicketHealth ¶
func SetTicketSdlc ¶ added in v0.1.842
SetTicketSdlc sets an explicit sdlc on a ticket, resetting the sdlc stage to the first stage of the new sdlc.
func UnsetTicketSdlc ¶ added in v0.1.842
UnsetTicketSdlc clears the explicit sdlc on a ticket, falling back to the inherited sdlc and resetting the stage accordingly.
func UpdateTicket ¶
func (Ticket) ResolveGuidance ¶ added in v0.1.842
func (t Ticket) ResolveGuidance(stage string) ResolvedGuidance
type TicketContext ¶
type TicketContext struct {
Project *Project `json:"project,omitempty"`
Parents []Ticket `json:"parents,omitempty"`
Sdlc *SdlcWithStages `json:"sdlc,omitempty"`
Role *Role `json:"role,omitempty"`
}
TicketContext holds a ticket and all surrounding context needed to work on it.
func EnrichTicketContext ¶
EnrichTicketContext gathers the project, parent chain, sdlc, and current-stage role for a ticket. Missing data is silently skipped.
type TicketCreateParams ¶
type TicketCreateParams struct {
ProjectID int64
ParentID *string
CloneOf *string
SdlcID *int64
Type string
Title string
Description string
AcceptanceCriteria string
DORMap GuidanceMap
DODMap GuidanceMap
ACMap GuidanceMap
GitRepository string
GitBranch string
Priority int
Order int
EstimateEffort int
EstimateComplete string
Assignee string
Author string
State string
CreatedBy string
}
type TicketHistoryEvent ¶
type TicketHistoryEvent = HistoryEvent
type TicketListParams ¶
type TicketRequestParams ¶
type TicketUpdateParams ¶
type TicketUpdateParams struct {
Title string
Description string
AcceptanceCriteria string
DORMap GuidanceMap
DODMap GuidanceMap
ACMap GuidanceMap
GitRepository string
GitBranch string
ParentID *string
Assignee string
Stage string
State string
Priority int
Order int
EstimateEffort int
EstimateComplete string
UpdatedBy string
ActorUsername string
ActorRole string
Type string // if non-empty, update the ticket type
}
type TimeEntry ¶
type TimeEntry struct {
ID int64 `json:"time_entry_id"`
TicketID string `json:"ticket_id"`
UserID string `json:"user_id"`
Minutes int `json:"minutes"`
Note string `json:"note"`
CreatedAt string `json:"created_at"`
}
func ListTimeEntries ¶
type User ¶
type User struct {
ID string `json:"user_id"`
Username string `json:"username"`
Email string `json:"email"`
EmailConfirmedAt string `json:"email_confirmed_at,omitempty"`
Role string `json:"role"`
DisplayName string `json:"display_name"`
Enabled bool `json:"enabled"`
CreatedAt string `json:"created_at"`
UserType string `json:"user_type"`
Description string `json:"description,omitempty"`
Status string `json:"status,omitempty"`
LastSeen string `json:"last_seen,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}