Changeset 0.27.1 (#167)

This commit is contained in:
2026-03-10 17:43:29 +00:00
parent 7e4f1581f2
commit 41be9d6081
16 changed files with 780 additions and 57 deletions

View File

@@ -221,23 +221,27 @@ func CreateWorkflowStageNote(ctx context.Context, stores store.Stores, channelID
}
// CreateWorkflowAssignment creates an unassigned workflow assignment entry.
func CreateWorkflowAssignment(ctx context.Context, channelID string, stage int, teamID string) {
// Returns the assignment ID (for round-robin auto-assignment).
func CreateWorkflowAssignment(ctx context.Context, channelID string, stage int, teamID string) string {
id := store.NewID()
if database.IsSQLite() {
id := store.NewID()
_, err := database.DB.ExecContext(ctx, `
INSERT INTO workflow_assignments (id, channel_id, stage, team_id)
VALUES (?, ?, ?, ?)
`, id, channelID, stage, teamID)
if err != nil {
log.Printf("⚠️ Failed to create workflow assignment: %v", err)
return ""
}
return
return id
}
_, err := database.DB.ExecContext(ctx, `
INSERT INTO workflow_assignments (channel_id, stage, team_id)
VALUES ($1, $2, $3)
`, channelID, stage, teamID)
INSERT INTO workflow_assignments (id, channel_id, stage, team_id)
VALUES ($1, $2, $3, $4)
`, id, channelID, stage, teamID)
if err != nil {
log.Printf("⚠️ Failed to create workflow assignment: %v", err)
return ""
}
return id
}