Skip to content

feat(engagement): add post_engagement_metrics view + tests (#180)#232

Merged
Azfe merged 2 commits into
developfrom
task/n04-03-01-engagement-metrics
Jul 11, 2026
Merged

feat(engagement): add post_engagement_metrics view + tests (#180)#232
Azfe merged 2 commits into
developfrom
task/n04-03-01-engagement-metrics

Conversation

@Azfe

@Azfe Azfe commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Per-post dashboard metrics with link_clicked as the axis (unique_readers, unique_clicks, click_rate, avg_rating, total_reactions), the derived engaged_users, and the optional ADR-0006 signals. Sources are pre-aggregated per CTE to avoid fan-out; the view is based on posts so zero-session posts show zeros and click_rate is NULL instead of dividing by zero. Access is enforced with security_invoker + an is_manager() guard. Add fixed-dataset pgTAP covering the metrics, the zero case and RBAC.

Closes #180

@Azfe
Azfe merged commit ff6a6d3 into develop Jul 11, 2026
6 checks passed
@Azfe
Azfe deleted the task/n04-03-01-engagement-metrics branch July 11, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant