From db5e6e7ad845ecee84db49c935c25b5ed1008001 Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Tue, 7 Jan 2025 20:47:59 -0500 Subject: [PATCH] Incident highlight backend --- pkg/database/calls.sql.go | 12 ++++++------ sql/postgres/queries/calls.sql | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/database/calls.sql.go b/pkg/database/calls.sql.go index 3ea749f..22da55b 100644 --- a/pkg/database/calls.sql.go +++ b/pkg/database/calls.sql.go @@ -255,8 +255,8 @@ SELECT c.id, c.call_date, c.duration, -c.system, -c.talkgroup, +c.system system_id, +c.talkgroup tgid, COUNT(ic.incident_id) incidents FROM calls c JOIN talkgroups tgs ON c.talkgroup = tgs.tgid AND c.system = tgs.system_id @@ -303,8 +303,8 @@ type ListCallsPRow struct { ID uuid.UUID `json:"id"` CallDate pgtype.Timestamptz `json:"call_date"` Duration *int32 `json:"duration"` - System int `json:"system"` - Talkgroup int `json:"talkgroup"` + SystemID int `json:"system_id"` + TGID int `json:"tgid"` Incidents int64 `json:"incidents"` } @@ -331,8 +331,8 @@ func (q *Queries) ListCallsP(ctx context.Context, arg ListCallsPParams) ([]ListC &i.ID, &i.CallDate, &i.Duration, - &i.System, - &i.Talkgroup, + &i.SystemID, + &i.TGID, &i.Incidents, ); err != nil { return nil, err diff --git a/sql/postgres/queries/calls.sql b/sql/postgres/queries/calls.sql index edc7b76..998566a 100644 --- a/sql/postgres/queries/calls.sql +++ b/sql/postgres/queries/calls.sql @@ -101,8 +101,8 @@ SELECT c.id, c.call_date, c.duration, -c.system, -c.talkgroup, +c.system system_id, +c.talkgroup tgid, COUNT(ic.incident_id) incidents FROM calls c JOIN talkgroups tgs ON c.talkgroup = tgs.tgid AND c.system = tgs.system_id