Add concern page to mailer compliance flow

This commit is contained in:
Eli Ribble 2026-04-22 21:22:03 +00:00
parent b5923137a7
commit a8819c907e
No known key found for this signature in database
11 changed files with 206 additions and 124 deletions

View file

@ -67,8 +67,8 @@ func PublicreportByIDCompliance(ctx context.Context, report_id string) (*types.P
return nil, fmt.Errorf("compliance report request by public id: %w", err)
}
if crr != nil {
result.Evidence = []*types.EvidenceComplianceReportRequest{
&types.EvidenceComplianceReportRequest{
result.Concerns = []*types.ConcernComplianceReportRequest{
&types.ConcernComplianceReportRequest{
ComplianceReportRequestPublicID: crr.PublicID,
},
}

View file

@ -7,15 +7,15 @@ import (
"github.com/rs/zerolog/log"
)
type Evidence interface {
type Concern interface {
PopulateURL(*mux.Router) error
}
type EvidenceComplianceReportRequest struct {
ComplianceReportRequestPublicID string
URL string
type ConcernComplianceReportRequest struct {
ComplianceReportRequestPublicID string `json:"compliance_report_request_public_id"`
URL string `json:"url"`
}
func (e *EvidenceComplianceReportRequest) PopulateURL(r *mux.Router) error {
func (e *ConcernComplianceReportRequest) PopulateURL(r *mux.Router) error {
route_name := "compliance-request.image.pool.ByIDGet"
handler := r.Get(route_name)
if handler == nil {
@ -27,6 +27,6 @@ func (e *EvidenceComplianceReportRequest) PopulateURL(r *mux.Router) error {
}
uri.Scheme = "https"
e.URL = uri.String()
log.Debug().Str("url", e.URL).Msg("populated evidence URL")
log.Debug().Str("url", e.URL).Msg("populated concern URL")
return nil
}

View file

@ -5,20 +5,20 @@ import (
)
type PublicReport struct {
Address Address `db:"address" json:"address"`
Created time.Time `db:"created" json:"created"`
Evidence []*EvidenceComplianceReportRequest `db:"-" json:"evidence"`
ID int32 `db:"id" json:"-"`
Images []Image `db:"images" json:"images"`
Location *Location `db:"location" json:"location"`
Log []LogEntry `db:"-" json:"log"`
DistrictID *int32 `db:"organization_id" json:"-"`
District *string `db:"-" json:"district"`
PublicID string `db:"public_id" json:"public_id"`
Reporter Contact `db:"reporter" json:"reporter"`
Status string `db:"status" json:"status"`
Type string `db:"report_type" json:"type"`
URI string `db:"-" json:"uri"`
Address Address `db:"address" json:"address"`
Concerns []*ConcernComplianceReportRequest `db:"-" json:"concerns"`
Created time.Time `db:"created" json:"created"`
ID int32 `db:"id" json:"-"`
Images []Image `db:"images" json:"images"`
Location *Location `db:"location" json:"location"`
Log []LogEntry `db:"-" json:"log"`
DistrictID *int32 `db:"organization_id" json:"-"`
District *string `db:"-" json:"district"`
PublicID string `db:"public_id" json:"public_id"`
Reporter Contact `db:"reporter" json:"reporter"`
Status string `db:"status" json:"status"`
Type string `db:"report_type" json:"type"`
URI string `db:"-" json:"uri"`
}
type PublicReportCompliance struct {
PublicReport