[Backend] Database Models - Add missing Pydantic schemas #14

Merged
shoko merged 1 commits from fix/issue-3 into main 2026-04-08 06:57:46 +02:00
Owner

Summary

This PR addresses issue #3 by adding the missing Pydantic schemas that were identified during the review of the existing implementation against the IMPLEMENTATION_PLAN.md Section 4 schema.

Changes Made

Added to src/backend/app/db/schemas.py:

  • BotConversationCreate - Schema for creating conversation messages
  • BotConversationResponse - Schema for conversation message responses
  • SignalResponse - Schema for trading signal responses

Existing Implementation

The following were already implemented in the codebase (created in PR #13, fix/issue-2):

  • SQLAlchemy Models (app/db/models.py): User, Bot, BotConversation, Backtest, Simulation, Signal
  • Database Indexes: All indexes as specified in IMPLEMENTATION_PLAN.md Section 4.2
  • Core Database Setup (app/core/database.py): SQLite engine with foreign keys pragma

Note

The dependencies issue #2 was already completed and merged (PR #13) before starting this work. The existing models.py already matched the IMPLEMENTATION_PLAN.md Section 4 schema. This PR only adds the missing Pydantic schemas for request/response validation.

Fixes #3

## Summary This PR addresses issue #3 by adding the missing Pydantic schemas that were identified during the review of the existing implementation against the IMPLEMENTATION_PLAN.md Section 4 schema. ### Changes Made Added to `src/backend/app/db/schemas.py`: - `BotConversationCreate` - Schema for creating conversation messages - `BotConversationResponse` - Schema for conversation message responses - `SignalResponse` - Schema for trading signal responses ### Existing Implementation The following were already implemented in the codebase (created in PR #13, fix/issue-2): - **SQLAlchemy Models** (`app/db/models.py`): User, Bot, BotConversation, Backtest, Simulation, Signal - **Database Indexes**: All indexes as specified in IMPLEMENTATION_PLAN.md Section 4.2 - **Core Database Setup** (`app/core/database.py`): SQLite engine with foreign keys pragma ### Note The dependencies issue #2 was already completed and merged (PR #13) before starting this work. The existing models.py already matched the IMPLEMENTATION_PLAN.md Section 4 schema. This PR only adds the missing Pydantic schemas for request/response validation. ## Related Issue Fixes #3
shoko added 1 commit 2026-04-08 06:42:13 +02:00
Based on IMPLEMENTATION_PLAN.md Section 4 schema, the existing schemas.py
was missing schemas for:
- BotConversationCreate/Response (for bot_conversations table)
- SignalResponse (for signals table)

These were identified as gaps during issue #3 review.
han approved these changes 2026-04-08 06:57:04 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko merged commit f59e595ffd into main 2026-04-08 06:57:46 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/randebu#14