Fix measure count queries missing category column

CountByRiskID and CountByControlID CTEs did not include m.category in their SELECT
lists, causing "column category does not exist" errors when MeasureFilter applied
category constraints. Added m.category to both CTEs.

Also add comprehensive e2e tests for measure filtering by category at organization,
risk, and control levels.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-19 12:11:03 +01:00
parent d6b9280038
commit 2b08dea600
2 changed files with 210 additions and 2 deletions

View File

@@ -84,7 +84,8 @@ WITH msrs AS (
m.id,
m.tenant_id,
m.search_vector,
m.state
m.state,
m.category
FROM
measures m
INNER JOIN
@@ -195,7 +196,8 @@ WITH mtgtns AS (
m.id,
m.tenant_id,
m.search_vector,
m.state
m.state,
m.category
FROM
measures m
INNER JOIN