Alter report submission page to request reporter name and consent
This also adds the new mechanism for handling notifications on reports
This commit is contained in:
parent
9328e7a2f8
commit
57191fa222
45 changed files with 10337 additions and 573 deletions
|
|
@ -22,7 +22,7 @@ import (
|
|||
//go:embed publicreport_image_with_json_by_nuisance_id.bob.sql
|
||||
var formattedQueries_publicreport_image_with_json_by_nuisance_id string
|
||||
|
||||
var publicreportImageWithJSONByNuisanceIDSQL = formattedQueries_publicreport_image_with_json_by_nuisance_id[175:983]
|
||||
var publicreportImageWithJSONByNuisanceIDSQL = formattedQueries_publicreport_image_with_json_by_nuisance_id[175:999]
|
||||
|
||||
type PublicreportImageWithJSONByNuisanceIDQuery = orm.ModQuery[*dialect.SelectQuery, publicreportImageWithJSONByNuisanceID, PublicreportImageWithJSONByNuisanceIDRow, []PublicreportImageWithJSONByNuisanceIDRow, publicreportImageWithJSONByNuisanceIDTransformer]
|
||||
|
||||
|
|
@ -60,9 +60,9 @@ func PublicreportImageWithJSONByNuisanceID(NuisanceID int32) *PublicreportImageW
|
|||
},
|
||||
},
|
||||
Mod: bob.ModFunc[*dialect.SelectQuery](func(q *dialect.SelectQuery) {
|
||||
q.AppendSelect(expressionTypArgs.subExpr(9, 549))
|
||||
q.SetTable(expressionTypArgs.subExpr(555, 751))
|
||||
q.AppendWhere(expressionTypArgs.subExpr(759, 807))
|
||||
q.AppendSelect(expressionTypArgs.subExpr(9, 565))
|
||||
q.SetTable(expressionTypArgs.subExpr(571, 767))
|
||||
q.AppendWhere(expressionTypArgs.subExpr(775, 823))
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
|
@ -90,8 +90,8 @@ func (o publicreportImageWithJSONByNuisanceID) args() iter.Seq[orm.ArgWithPositi
|
|||
return func(yield func(arg orm.ArgWithPosition) bool) {
|
||||
if !yield(orm.ArgWithPosition{
|
||||
Name: "nuisanceID",
|
||||
Start: 805,
|
||||
Stop: 807,
|
||||
Start: 821,
|
||||
Stop: 823,
|
||||
Expression: o.NuisanceID,
|
||||
}) {
|
||||
return
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import (
|
|||
//go:embed publicreport_publicid_table.bob.sql
|
||||
var formattedQueries_publicreport_publicid_table string
|
||||
|
||||
var publicreportIDTableSQL = formattedQueries_publicreport_publicid_table[157:624]
|
||||
var publicreportIDTableSQL = formattedQueries_publicreport_publicid_table[157:638]
|
||||
|
||||
type PublicreportIDTableQuery = orm.ModQuery[*dialect.SelectQuery, publicreportIDTable, PublicreportIDTableRow, []PublicreportIDTableRow, publicreportIDTableTransformer]
|
||||
|
||||
|
|
@ -43,6 +43,7 @@ func PublicreportIDTable(PublicID string) *PublicreportIDTableQuery {
|
|||
var t PublicreportIDTableRow
|
||||
row.ScheduleScanByIndex(0, &t.ExistsSomewhere)
|
||||
row.ScheduleScanByIndex(1, &t.FoundInTables)
|
||||
row.ScheduleScanByIndex(2, &t.ReportIds)
|
||||
return &t, nil
|
||||
}, func(v any) (PublicreportIDTableRow, error) {
|
||||
return *(v.(*PublicreportIDTableRow)), nil
|
||||
|
|
@ -50,9 +51,9 @@ func PublicreportIDTable(PublicID string) *PublicreportIDTableQuery {
|
|||
},
|
||||
},
|
||||
Mod: bob.ModFunc[*dialect.SelectQuery](func(q *dialect.SelectQuery) {
|
||||
q.AppendCTE(expressionTypArgs.subExpr(5, 335))
|
||||
q.AppendSelect(expressionTypArgs.subExpr(348, 449))
|
||||
q.SetTable(expressionTypArgs.subExpr(455, 467))
|
||||
q.AppendCTE(expressionTypArgs.subExpr(5, 325))
|
||||
q.AppendSelect(expressionTypArgs.subExpr(335, 463))
|
||||
q.SetTable(expressionTypArgs.subExpr(469, 481))
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
|
@ -60,6 +61,7 @@ func PublicreportIDTable(PublicID string) *PublicreportIDTableQuery {
|
|||
type PublicreportIDTableRow = struct {
|
||||
ExistsSomewhere bool `db:"exists_somewhere"`
|
||||
FoundInTables pq.StringArray `db:"found_in_tables"`
|
||||
ReportIds pq.StringArray `db:"report_ids"`
|
||||
}
|
||||
|
||||
type publicreportIDTableTransformer = bob.SliceTransformer[PublicreportIDTableRow, []PublicreportIDTableRow]
|
||||
|
|
@ -81,8 +83,8 @@ func (o publicreportIDTable) args() iter.Seq[orm.ArgWithPosition] {
|
|||
|
||||
if !yield(orm.ArgWithPosition{
|
||||
Name: "publicID",
|
||||
Start: 221,
|
||||
Stop: 223,
|
||||
Start: 217,
|
||||
Stop: 219,
|
||||
Expression: o.PublicID,
|
||||
}) {
|
||||
return
|
||||
|
|
@ -90,8 +92,8 @@ func (o publicreportIDTable) args() iter.Seq[orm.ArgWithPosition] {
|
|||
|
||||
if !yield(orm.ArgWithPosition{
|
||||
Name: "publicID",
|
||||
Start: 331,
|
||||
Stop: 333,
|
||||
Start: 321,
|
||||
Stop: 323,
|
||||
Expression: o.PublicID,
|
||||
}) {
|
||||
return
|
||||
|
|
|
|||
|
|
@ -3,23 +3,29 @@
|
|||
|
||||
-- PublicreportIDTable
|
||||
WITH found_tables AS (
|
||||
SELECT 'nuisance' as table_name
|
||||
FROM publicreport.nuisance
|
||||
WHERE public_id = $1
|
||||
SELECT
|
||||
'nuisance' as table_name,
|
||||
id
|
||||
FROM publicreport.nuisance
|
||||
WHERE public_id = $1
|
||||
|
||||
UNION ALL
|
||||
UNION ALL
|
||||
|
||||
SELECT 'pool' as table_name
|
||||
FROM publicreport.pool
|
||||
WHERE public_id = $2
|
||||
SELECT
|
||||
'pool' as table_name,
|
||||
id
|
||||
FROM publicreport.pool
|
||||
WHERE public_id = $2
|
||||
|
||||
UNION ALL
|
||||
UNION ALL
|
||||
|
||||
SELECT 'quick' as table_name
|
||||
FROM publicreport.quick
|
||||
WHERE public_id = $3
|
||||
SELECT 'quick' as table_name,
|
||||
id
|
||||
FROM publicreport.quick
|
||||
WHERE public_id = $3
|
||||
)
|
||||
SELECT
|
||||
EXISTS (SELECT 1 FROM found_tables) as exists_somewhere,
|
||||
array_agg(table_name) as found_in_tables
|
||||
EXISTS (SELECT 1 FROM found_tables) as exists_somewhere,
|
||||
array_agg(table_name) as found_in_tables,
|
||||
array_agg(id) as report_ids
|
||||
FROM found_tables;
|
||||
|
|
|
|||
|
|
@ -1,22 +1,28 @@
|
|||
-- PublicreportIDTable
|
||||
WITH found_tables AS (
|
||||
SELECT 'nuisance' as table_name
|
||||
FROM publicreport.nuisance
|
||||
WHERE public_id = $1
|
||||
SELECT
|
||||
'nuisance' as table_name,
|
||||
id
|
||||
FROM publicreport.nuisance
|
||||
WHERE public_id = $1
|
||||
|
||||
UNION ALL
|
||||
UNION ALL
|
||||
|
||||
SELECT 'pool' as table_name
|
||||
FROM publicreport.pool
|
||||
WHERE public_id = $1
|
||||
SELECT
|
||||
'pool' as table_name,
|
||||
id
|
||||
FROM publicreport.pool
|
||||
WHERE public_id = $1
|
||||
|
||||
UNION ALL
|
||||
UNION ALL
|
||||
|
||||
SELECT 'quick' as table_name
|
||||
FROM publicreport.quick
|
||||
WHERE public_id = $1
|
||||
SELECT 'quick' as table_name,
|
||||
id
|
||||
FROM publicreport.quick
|
||||
WHERE public_id = $1
|
||||
)
|
||||
SELECT
|
||||
EXISTS (SELECT 1 FROM found_tables) as exists_somewhere,
|
||||
array_agg(table_name) as found_in_tables
|
||||
EXISTS (SELECT 1 FROM found_tables) as exists_somewhere,
|
||||
array_agg(table_name) as found_in_tables,
|
||||
array_agg(id) as report_ids
|
||||
FROM found_tables;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue