From 5db4c055443ec039fe5456cb500cd3ec6170b49e Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Mon, 13 Apr 2026 16:42:29 +0000 Subject: [PATCH] Add proper compliance report type Can't believe I missed this. --- db/enums/enums.bob.go | 9 ++++++--- .../00132_publicreport_reporttype_compliance.sql | 2 ++ resource/publicreport_compliance.go | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 db/migrations/00132_publicreport_reporttype_compliance.sql diff --git a/db/enums/enums.bob.go b/db/enums/enums.bob.go index c99b91c7..6fb2a61d 100644 --- a/db/enums/enums.bob.go +++ b/db/enums/enums.bob.go @@ -2147,14 +2147,16 @@ func (e *PublicreportReportstatustype) Scan(value any) error { // Enum values for PublicreportReporttype const ( - PublicreportReporttypeNuisance PublicreportReporttype = "nuisance" - PublicreportReporttypeWater PublicreportReporttype = "water" + PublicreportReporttypeNuisance PublicreportReporttype = "nuisance" + PublicreportReporttypeWater PublicreportReporttype = "water" + PublicreportReporttypeCompliance PublicreportReporttype = "compliance" ) func AllPublicreportReporttype() []PublicreportReporttype { return []PublicreportReporttype{ PublicreportReporttypeNuisance, PublicreportReporttypeWater, + PublicreportReporttypeCompliance, } } @@ -2167,7 +2169,8 @@ func (e PublicreportReporttype) String() string { func (e PublicreportReporttype) Valid() bool { switch e { case PublicreportReporttypeNuisance, - PublicreportReporttypeWater: + PublicreportReporttypeWater, + PublicreportReporttypeCompliance: return true default: return false diff --git a/db/migrations/00132_publicreport_reporttype_compliance.sql b/db/migrations/00132_publicreport_reporttype_compliance.sql new file mode 100644 index 00000000..ba2afdf4 --- /dev/null +++ b/db/migrations/00132_publicreport_reporttype_compliance.sql @@ -0,0 +1,2 @@ +-- +goose Up +ALTER TYPE publicreport.ReportType ADD VALUE 'compliance' AFTER 'water'; diff --git a/resource/publicreport_compliance.go b/resource/publicreport_compliance.go index f718fa19..aba15e56 100644 --- a/resource/publicreport_compliance.go +++ b/resource/publicreport_compliance.go @@ -63,7 +63,7 @@ func (res *complianceR) Create(ctx context.Context, r *http.Request, n publicrep ReporterEmail: omit.From(""), ReporterName: omit.From(""), ReporterPhone: omit.From(""), - ReportType: omit.From(enums.PublicreportReporttypeNuisance), + ReportType: omit.From(enums.PublicreportReporttypeCompliance), Status: omit.From(enums.PublicreportReportstatustypeReported), } setter_compliance := models.PublicreportComplianceSetter{