enhance implementation
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-03-24 15:50:03 +11:00
parent ebf1d2aef3
commit 49e60f7843
23 changed files with 620 additions and 197 deletions

View File

@@ -2,7 +2,6 @@
SELECT * FROM "Incoming"
ORDER BY "id";
-- 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"
@@ -12,6 +11,49 @@ INSERT INTO "Incoming" (
RETURNING *;
-- name: CreateIncident :one
INSERT INTO incidents (external_id)
VALUES (?)
RETURNING id;
INSERT INTO incidents (
"description", "short_description", "urgency", "impact", "state", "external_id", "assignment_group", "assigned_to", "category", "subcategory", "created_at", "sys_id"
) VALUES(
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
)
RETURNING *;
-- name: UpdateIncidentNumber :exec
UPDATE incidents
SET incident_number = sqlc.arg('incidentNumber')
WHERE external_id = sqlc.arg('externalId');
-- name: UpdateIncidentState :exec
UPDATE incidents
SET state = sqlc.arg('state')
WHERE incident_number = sqlc.arg('incidentNumber');
-- name: UpdateIncident :exec
UPDATE incidents
SET
external_id = ?,
description = ?,
short_description = ?,
urgency = ?,
impact = ?,
state = ?,
assignment_group = ?,
assigned_to = ?,
category = ?,
subcategory = ?
WHERE incident_number = ?;
-- name: GetIncident :one
SELECT * from incidents
WHERE incident_number = sqlc.arg('incidentNumber');
-- name: ListIncidents :many
SELECT * FROM incidents;
-- name: CreateWorkNote :one
INSERT into worknotes (
"incident_number", "note"
) VALUES(
?, ?
)
RETURNING *;