diff --git a/platform/event/event.go b/platform/event/event.go index 6ec94663..08992964 100644 --- a/platform/event/event.go +++ b/platform/event/event.go @@ -88,8 +88,9 @@ const ( TypeNoteAudio TypeNoteImage TypeReviewTask + TypeRMOCompliance TypeRMONuisance - TypeRMOReport + TypeRMOPublicReport TypeRMOWater TypeSession TypeSignal @@ -141,12 +142,14 @@ func resourceString(t ResourceType) string { return "sync:note:image" case TypeReviewTask: return "sync:review-task" + case TypeRMOCompliance: + return "rmo:publicreport.compliance" case TypeRMONuisance: - return "rmo:nuisance" - case TypeRMOReport: - return "rmo:report" + return "rmo:publicreport.nuisance" + case TypeRMOPublicReport: + return "rmo:publicreport" case TypeRMOWater: - return "rmo:water" + return "rmo:publicreport.water" case TypeSession: return "sync:session" case TypeSignal: @@ -165,10 +168,14 @@ func makeURI(t ResourceType, id string) string { return config.MakeURLNidus("/api/note/%s", id) case TypeReviewTask: return config.MakeURLNidus("/api/review/%s", id) + case TypeRMOCompliance: + return config.MakeURLReport("/api/publicreport/compliance/%s", id) case TypeRMONuisance: - return config.MakeURLReport("/api/report/%s", id) + return config.MakeURLReport("/api/publicreport/nuisance/%s", id) + case TypeRMOPublicReport: + return config.MakeURLReport("/api/publicreport/%s", id) case TypeRMOWater: - return config.MakeURLReport("/api/report/%s", id) + return config.MakeURLReport("/api/publicrreport/water/%s", id) case TypeSession: return config.MakeURLReport("/api/session") case TypeSignal: diff --git a/platform/publicreport.go b/platform/publicreport.go index a547813d..ebba8993 100644 --- a/platform/publicreport.go +++ b/platform/publicreport.go @@ -53,7 +53,7 @@ func PublicreportInvalid(ctx context.Context, user User, report_id string) error }) log.Info().Int32("id", report.ID).Msg("Report marked as invalid") - event.Updated(event.TypeRMOReport, user.Organization.ID, report_id) + event.Updated(event.TypeRMOPublicReport, user.Organization.ID, report_id) return nil } @@ -132,7 +132,7 @@ func PublicReportUpdateCompliance(ctx context.Context, report_id string, report_ return publicreport.ByID(ctx, report_id) } func PublicReportReporterUpdated(ctx context.Context, org_id int32, report_id string) { - event.Updated(event.TypeRMOReport, org_id, report_id) + event.Updated(event.TypeRMOPublicReport, org_id, report_id) } func PublicReportsForOrganization(ctx context.Context, org_id int32) ([]*types.PublicReport, error) { return publicreport.ReportsForOrganization(ctx, org_id) @@ -287,7 +287,7 @@ func publicReportCreate(ctx context.Context, setter_report models.PublicreportRe if organization_id != nil { event.Created( - event.TypeRMONuisance, + event.TypeRMOPublicReport, *organization_id, result.PublicID, ) diff --git a/platform/text/send.go b/platform/text/send.go index 569033fc..76dd476a 100644 --- a/platform/text/send.go +++ b/platform/text/send.go @@ -167,7 +167,7 @@ func sendTextComplete(ctx context.Context, txn bob.Executor, job *models.CommsTe if err != nil { return fmt.Errorf("find public report: %w", err) } - event.Updated(event.TypeRMOReport, report.OrganizationID, report.PublicID) + event.Updated(event.TypeRMOPublicReport, report.OrganizationID, report.PublicID) } else { log.Debug().Msg("no report info on text") } diff --git a/platform/text/text.go b/platform/text/text.go index cbc424dd..dcecdd0d 100644 --- a/platform/text/text.go +++ b/platform/text/text.go @@ -143,7 +143,7 @@ func respondText(ctx context.Context, txn bob.Executor, log_id int32) error { Type: omit.From(enums.PublicreportReportlogtypeMessageText), UserID: omitnull.FromPtr[int32](nil), }).One(ctx, txn) - event.Updated(event.TypeRMOReport, report.OrganizationID, report.PublicID) + event.Updated(event.TypeRMOPublicReport, report.OrganizationID, report.PublicID) } // If humans are involved, wait for them. if len(reports) > 0 {