initial version of endpoint

This commit is contained in:
2025-03-22 21:17:29 +11:00
parent 112ad8da1a
commit a4578fb293
13 changed files with 289 additions and 119 deletions

View File

@@ -10,6 +10,19 @@ import (
"database/sql"
)
const createIncident = `-- name: CreateIncident :one
INSERT INTO incidents (external_id)
VALUES (?)
RETURNING id
`
func (q *Queries) CreateIncident(ctx context.Context, externalID string) (int64, error) {
row := q.db.QueryRowContext(ctx, createIncident, externalID)
var id int64
err := row.Scan(&id)
return id, err
}
const createIncoming = `-- name: CreateIncoming :one
INSERT INTO "Incoming" (
"incident_number", "description", "short_description", "urgency", "impact", "state", "external_id", "work_notes", "assignment_group", "assigned_to", "category", "subcategory", "created_at"