Skip to content

feat: module 01 & 02 — models extraction, bug fixes, tests, custom prompts#15

Open
konradjerrybarrek wants to merge 4 commits intoYvFrey:mainfrom
konradjerrybarrek:feat/01
Open

feat: module 01 & 02 — models extraction, bug fixes, tests, custom prompts#15
konradjerrybarrek wants to merge 4 commits intoYvFrey:mainfrom
konradjerrybarrek:feat/01

Conversation

@konradjerrybarrek
Copy link
Copy Markdown

PR Summary: feat/01main

What changed

app/models.py — new file
Extracted all Pydantic models (TaskStatus, DeveloperTask, ProductivityReport) from main.py into a dedicated models file, satisfying the mandatory coding guideline requiring models to live in app/models.py.

app/main.py — refactored & bug fixes

  • Imports models from app.models instead of defining them inline
  • Fixed bug: generate_productivity_report was counting PENDING tasks as completed — now correctly counts COMPLETE
  • get_status converted to async def with explicit -> dict return type
  • log_task now returns a DeveloperTask model (was returning an f-string), uses model_copy for immutable update, and has response_model on the decorator
  • Added new GET /task/{task_id}/status endpoint

tests/ — new test suite

  • tests/conftest.py: shared async client fixture using httpx.AsyncClient + ASGITransport
  • tests/unit/test_main.py: 8 unit tests covering fetch_all_tasks and generate_productivity_report
  • tests/integration/test_main.py: 10 integration tests covering all endpoints (happy path, validation errors, model validation)

.github/prompts/ — new custom prompt

  • Added logs-audit.prompt.md: reusable /logs-audit prompt for production logging reviews

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