Documentation
¶
Index ¶
- Variables
- type SkillLearningProposal
- func ApproveSkillLearningProposal(ctx context.Context, db *sql.DB, p SkillLearningProposalReviewParams) (SkillLearningProposal, error)
- func GetSkillLearningProposal(ctx context.Context, db *sql.DB, proposalID string) (SkillLearningProposal, error)
- func RejectSkillLearningProposal(ctx context.Context, db *sql.DB, p SkillLearningProposalReviewParams) (SkillLearningProposal, error)
- type SkillLearningProposalCreateParams
- type SkillLearningProposalList
- type SkillLearningProposalQuery
- type SkillLearningProposalRef
- type SkillLearningProposalReviewParams
- type SkillLearningProposalStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var DDL = []string{
`CREATE TABLE IF NOT EXISTS goncho_skill_learning_proposals (
id INTEGER PRIMARY KEY AUTOINCREMENT,
proposal_id TEXT NOT NULL UNIQUE,
workspace_id TEXT NOT NULL DEFAULT '',
skill_name TEXT NOT NULL,
source_task TEXT NOT NULL,
draft_body TEXT NOT NULL,
evidence_json TEXT NOT NULL DEFAULT '{}',
status TEXT NOT NULL DEFAULT 'pending' CHECK(status IN ('pending','approved','rejected')),
created_by TEXT NOT NULL,
reviewed_by TEXT NOT NULL DEFAULT '',
reviewed_at INTEGER,
review_reason TEXT NOT NULL DEFAULT '',
created_at INTEGER NOT NULL
)`,
`CREATE INDEX IF NOT EXISTS idx_goncho_skill_learning_workspace_status ON goncho_skill_learning_proposals(workspace_id, status, created_at DESC)`,
`CREATE INDEX IF NOT EXISTS idx_goncho_skill_learning_skill_status ON goncho_skill_learning_proposals(skill_name, status, created_at DESC)`,
`CREATE INDEX IF NOT EXISTS idx_goncho_skill_learning_created_at ON goncho_skill_learning_proposals(created_at DESC)`,
}
Functions ¶
This section is empty.
Types ¶
type SkillLearningProposal ¶
type SkillLearningProposal struct {
ID int64 `json:"id"`
ProposalID string `json:"proposal_id"`
WorkspaceID string `json:"workspace_id"`
SkillName string `json:"skill_name"`
SourceTask string `json:"source_task"`
DraftBody string `json:"draft_body"`
EvidenceJSON json.RawMessage `json:"evidence_json"`
Status SkillLearningProposalStatus `json:"status"`
CreatedBy string `json:"created_by"`
ReviewedBy string `json:"reviewed_by,omitempty"`
ReviewedAt *time.Time `json:"reviewed_at,omitempty"`
ReviewReason string `json:"review_reason,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
func ApproveSkillLearningProposal ¶
func ApproveSkillLearningProposal(ctx context.Context, db *sql.DB, p SkillLearningProposalReviewParams) (SkillLearningProposal, error)
func RejectSkillLearningProposal ¶
func RejectSkillLearningProposal(ctx context.Context, db *sql.DB, p SkillLearningProposalReviewParams) (SkillLearningProposal, error)
type SkillLearningProposalCreateParams ¶
type SkillLearningProposalCreateParams struct {
WorkspaceID string `json:"workspace_id,omitempty"`
SkillName string `json:"skill_name"`
SourceTask string `json:"source_task"`
DraftBody string `json:"draft_body"`
CreatedBy string `json:"created_by"`
Evidence any `json:"evidence,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}
type SkillLearningProposalList ¶
type SkillLearningProposalList struct {
Items []SkillLearningProposal `json:"items"`
Count int `json:"count"`
}
func ListSkillLearningProposals ¶
func ListSkillLearningProposals(ctx context.Context, db *sql.DB, q SkillLearningProposalQuery) (SkillLearningProposalList, error)
type SkillLearningProposalQuery ¶
type SkillLearningProposalQuery struct {
WorkspaceID string `json:"workspace_id,omitempty"`
Status SkillLearningProposalStatus `json:"status,omitempty"`
Limit int `json:"limit,omitempty"`
}
type SkillLearningProposalRef ¶
type SkillLearningProposalRef struct {
ProposalID string `json:"proposal_id"`
WorkspaceID string `json:"workspace_id"`
SkillName string `json:"skill_name"`
Status SkillLearningProposalStatus `json:"status"`
}
func SubmitSkillLearningProposal ¶
func SubmitSkillLearningProposal(ctx context.Context, db *sql.DB, p SkillLearningProposalCreateParams) (SkillLearningProposalRef, error)
type SkillLearningProposalStatus ¶
type SkillLearningProposalStatus string
const ( SkillLearningProposalPending SkillLearningProposalStatus = "pending" SkillLearningProposalApproved SkillLearningProposalStatus = "approved" SkillLearningProposalRejected SkillLearningProposalStatus = "rejected" )
Click to show internal directories.
Click to hide internal directories.