Remove deadcode

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-13 16:50:35 +01:00
parent 7fd4221199
commit ef76a8d2e1
76 changed files with 137 additions and 4424 deletions

View File

@@ -385,44 +385,6 @@ WHERE
return nil
}
func (a *Audits) CountByControlID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
controlID gid.GID,
) (int, error) {
q := `
WITH audits_by_control AS (
SELECT
a.id,
a.tenant_id
FROM
audits a
INNER JOIN
controls_audits ca ON a.id = ca.audit_id
WHERE
ca.control_id = @control_id
)
SELECT
COUNT(id)
FROM
audits_by_control
WHERE %s
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{"control_id": controlID}
maps.Copy(args, scope.SQLArguments())
row := conn.QueryRow(ctx, q, args)
var count int
if err := row.Scan(&count); err != nil {
return 0, fmt.Errorf("cannot scan count: %w", err)
}
return count, nil
}
func (a *Audits) LoadByControlID(
ctx context.Context,