You've already forked agentic-coding-workflow
bugfix
This commit is contained in:
@@ -22,14 +22,14 @@ func (q *Queries) CloseIssue(ctx context.Context, id pgtype.UUID) error {
|
||||
}
|
||||
|
||||
const createIssue = `-- name: CreateIssue :one
|
||||
INSERT INTO issues (id, project_id, requirement_id, number, title, description, assignee_id, created_by, workspace_id)
|
||||
INSERT INTO issues (id, project_id, requirement_id, number, title, description, assignee_id, created_by, workspace_id, parent_id, priority)
|
||||
VALUES (
|
||||
$1, $2, $3,
|
||||
(SELECT COALESCE(MAX(number), 0) + 1 FROM issues WHERE project_id = $2),
|
||||
$4, $5, $6, $7, $8
|
||||
$4, $5, $6, $7, $8, $9, $10
|
||||
)
|
||||
RETURNING id, project_id, requirement_id, number, title, description, status,
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id, parent_id, priority
|
||||
`
|
||||
|
||||
type CreateIssueParams struct {
|
||||
@@ -41,6 +41,8 @@ type CreateIssueParams struct {
|
||||
AssigneeID pgtype.UUID `json:"assignee_id"`
|
||||
CreatedBy pgtype.UUID `json:"created_by"`
|
||||
WorkspaceID pgtype.UUID `json:"workspace_id"`
|
||||
ParentID pgtype.UUID `json:"parent_id"`
|
||||
Priority int32 `json:"priority"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateIssue(ctx context.Context, arg CreateIssueParams) (Issue, error) {
|
||||
@@ -53,6 +55,8 @@ func (q *Queries) CreateIssue(ctx context.Context, arg CreateIssueParams) (Issue
|
||||
arg.AssigneeID,
|
||||
arg.CreatedBy,
|
||||
arg.WorkspaceID,
|
||||
arg.ParentID,
|
||||
arg.Priority,
|
||||
)
|
||||
var i Issue
|
||||
err := row.Scan(
|
||||
@@ -69,13 +73,45 @@ func (q *Queries) CreateIssue(ctx context.Context, arg CreateIssueParams) (Issue
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.WorkspaceID,
|
||||
&i.ParentID,
|
||||
&i.Priority,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const getIssueByID = `-- name: GetIssueByID :one
|
||||
SELECT id, project_id, requirement_id, number, title, description, status,
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id, parent_id, priority
|
||||
FROM issues
|
||||
WHERE id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) GetIssueByID(ctx context.Context, id pgtype.UUID) (Issue, error) {
|
||||
row := q.db.QueryRow(ctx, getIssueByID, id)
|
||||
var i Issue
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.ProjectID,
|
||||
&i.RequirementID,
|
||||
&i.Number,
|
||||
&i.Title,
|
||||
&i.Description,
|
||||
&i.Status,
|
||||
&i.AssigneeID,
|
||||
&i.CreatedBy,
|
||||
&i.ClosedAt,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.WorkspaceID,
|
||||
&i.ParentID,
|
||||
&i.Priority,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const getIssueByNumber = `-- name: GetIssueByNumber :one
|
||||
SELECT id, project_id, requirement_id, number, title, description, status,
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id, parent_id, priority
|
||||
FROM issues
|
||||
WHERE project_id = $1 AND number = $2
|
||||
`
|
||||
@@ -102,13 +138,15 @@ func (q *Queries) GetIssueByNumber(ctx context.Context, arg GetIssueByNumberPara
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.WorkspaceID,
|
||||
&i.ParentID,
|
||||
&i.Priority,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const listIssues = `-- name: ListIssues :many
|
||||
SELECT id, project_id, requirement_id, number, title, description, status,
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id, parent_id, priority
|
||||
FROM issues
|
||||
WHERE project_id = $1
|
||||
AND ($2::text IS NULL OR status = $2)
|
||||
@@ -158,6 +196,8 @@ func (q *Queries) ListIssues(ctx context.Context, arg ListIssuesParams) ([]Issue
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.WorkspaceID,
|
||||
&i.ParentID,
|
||||
&i.Priority,
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -171,7 +211,7 @@ func (q *Queries) ListIssues(ctx context.Context, arg ListIssuesParams) ([]Issue
|
||||
|
||||
const listIssuesByRequirement = `-- name: ListIssuesByRequirement :many
|
||||
SELECT id, project_id, requirement_id, number, title, description, status,
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id, parent_id, priority
|
||||
FROM issues
|
||||
WHERE requirement_id = $1
|
||||
ORDER BY number DESC
|
||||
@@ -200,6 +240,8 @@ func (q *Queries) ListIssuesByRequirement(ctx context.Context, requirementID pgt
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.WorkspaceID,
|
||||
&i.ParentID,
|
||||
&i.Priority,
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -226,7 +268,7 @@ UPDATE issues
|
||||
SET assignee_id = $2, updated_at = now()
|
||||
WHERE id = $1
|
||||
RETURNING id, project_id, requirement_id, number, title, description, status,
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id, parent_id, priority
|
||||
`
|
||||
|
||||
type UpdateIssueAssigneeParams struct {
|
||||
@@ -251,6 +293,8 @@ func (q *Queries) UpdateIssueAssignee(ctx context.Context, arg UpdateIssueAssign
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.WorkspaceID,
|
||||
&i.ParentID,
|
||||
&i.Priority,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
@@ -264,7 +308,7 @@ SET title = $2,
|
||||
updated_at = now()
|
||||
WHERE id = $1
|
||||
RETURNING id, project_id, requirement_id, number, title, description, status,
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id, parent_id, priority
|
||||
`
|
||||
|
||||
type UpdateIssueCoreParams struct {
|
||||
@@ -298,6 +342,44 @@ func (q *Queries) UpdateIssueCore(ctx context.Context, arg UpdateIssueCoreParams
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.WorkspaceID,
|
||||
&i.ParentID,
|
||||
&i.Priority,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const updateIssuePriority = `-- name: UpdateIssuePriority :one
|
||||
UPDATE issues
|
||||
SET priority = $2, updated_at = now()
|
||||
WHERE id = $1
|
||||
RETURNING id, project_id, requirement_id, number, title, description, status,
|
||||
assignee_id, created_by, closed_at, created_at, updated_at, workspace_id, parent_id, priority
|
||||
`
|
||||
|
||||
type UpdateIssuePriorityParams struct {
|
||||
ID pgtype.UUID `json:"id"`
|
||||
Priority int32 `json:"priority"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateIssuePriority(ctx context.Context, arg UpdateIssuePriorityParams) (Issue, error) {
|
||||
row := q.db.QueryRow(ctx, updateIssuePriority, arg.ID, arg.Priority)
|
||||
var i Issue
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.ProjectID,
|
||||
&i.RequirementID,
|
||||
&i.Number,
|
||||
&i.Title,
|
||||
&i.Description,
|
||||
&i.Status,
|
||||
&i.AssigneeID,
|
||||
&i.CreatedBy,
|
||||
&i.ClosedAt,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.WorkspaceID,
|
||||
&i.ParentID,
|
||||
&i.Priority,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user