From 28714b06b8563b4511ffe2836a440a03d0b3de16 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Wed, 18 Mar 2026 19:25:52 +0000 Subject: [PATCH] Fix tracking report type through the system --- api/communication.go | 2 +- platform/event/event.go | 2 ++ platform/publicreport/report.go | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api/communication.go b/api/communication.go index 29c77dc9..e2ceaead 100644 --- a/api/communication.go +++ b/api/communication.go @@ -36,7 +36,7 @@ func listCommunication(ctx context.Context, r *http.Request, user platform.User, Created: report.Created, ID: report.PublicID, PublicReport: report, - Type: "nuisance", + Type: "publicreport." + string(report.Type), } } _by_created := func(a, b communication) int { diff --git a/platform/event/event.go b/platform/event/event.go index 6467db13..35101de1 100644 --- a/platform/event/event.go +++ b/platform/event/event.go @@ -106,6 +106,8 @@ func resourceString(t ResourceType) string { switch t { case TypeRMONuisance: return "rmo:nuisance" + case TypeRMOReport: + return "rmo:report" case TypeRMOWater: return "rmo:water" default: diff --git a/platform/publicreport/report.go b/platform/publicreport/report.go index c584e24c..f3d50988 100644 --- a/platform/publicreport/report.go +++ b/platform/publicreport/report.go @@ -29,6 +29,7 @@ type Report struct { PublicID string `db:"public_id" json:"public_id"` Reporter types.Contact `db:"reporter" json:"reporter"` Status string `db:"status" json:"status"` + Type string `db:"report_type" json:"type"` Water *Water `db:"water" json:"water"` } @@ -47,6 +48,7 @@ func ReportsForOrganization(ctx context.Context, org_id int32) ([]*Report, error "ST_Y(location::geometry::geometry(point, 4326)) AS \"location.latitude\"", "ST_X(location::geometry::geometry(point, 4326)) AS \"location.longitude\"", "public_id", + "report_type", "reporter_email AS \"reporter.email\"", "reporter_name AS \"reporter.name\"", "reporter_phone AS \"reporter.phone\"",