Skip to content

Refactor moderation dashboard to use repository-backed data - #68

Open
beriman wants to merge 1 commit into
mainfrom
codex/create-moderation-repository-layer
Open

Refactor moderation dashboard to use repository-backed data#68
beriman wants to merge 1 commit into
mainfrom
codex/create-moderation-repository-layer

Conversation

@beriman

@beriman beriman commented Oct 3, 2025

Copy link
Copy Markdown
Owner

Summary

  • add a dedicated moderation dashboard repository that builds persona, metrics, and other domain structures from existing services and documentation
  • refactor the moderation dashboard service and FastAPI setup to consume the repository through dependency injection
  • extend moderation dashboard tests to use mocks and verify dynamic data propagation, and add a unit test for the service

Testing

  • pytest tests/test_moderation_dashboard.py tests/test_moderation_dashboard_service.py

https://chatgpt.com/codex/tasks/task_e_68df1d3985508327bbb8d5bb3f5c1914

@vercel

vercel Bot commented Oct 3, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
codexswi Ready Ready Preview Comment Oct 3, 2025 1:02am

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines +150 to +153
def _load_recent_sales(self) -> List[SalesRecord]:
today = date.today()
start = today - timedelta(days=6)
return self._sales_source.get_sales_report(start, today)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Recent sales window excludes seed data

The repository builds its snapshot using _load_recent_sales() which queries only the last 7 days (date.today() - timedelta(days=6)). However, SalesReportService is seeded exclusively with records from early April 2024, so once the current date moves past that range the query returns an empty list. As a result the dashboard’s KPIs, tickets, insights, heatmap, and violation statistics become empty even though demo data exists, making the moderation dashboard effectively blank. Consider using the available seed range or providing deterministic demo dates instead of date.today().

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant