- Created TradingService with basic CRUD operations
- Created storage.py for database session management
- Updated main.py to include database initialization and trading endpoints:
- GET /v1/trading/requests
- GET /v1/trading/requests/{request_id}
- POST /v1/trading/requests
- GET /v1/trading/matches
- POST /v1/trading/matches
- GET /v1/trading/agreements
- POST /v1/trading/agreements
- GET /v1/trading/analytics
- Created database setup script for aitbc_trading database
This completes Phase 4.5c: Extract trading services and Phase 4.5d: Setup separate database for trading service
20 lines
373 B
SQL
20 lines
373 B
SQL
-- Setup database for Trading service
|
|
|
|
-- Create database
|
|
CREATE DATABASE aitbc_trading;
|
|
|
|
-- Create user
|
|
CREATE USER aitbc_trading WITH PASSWORD 'password';
|
|
|
|
-- Grant privileges
|
|
GRANT ALL PRIVILEGES ON DATABASE aitbc_trading TO aitbc_trading;
|
|
|
|
-- Connect to the database
|
|
\c aitbc_trading
|
|
|
|
-- Grant schema privileges
|
|
GRANT ALL ON SCHEMA public TO aitbc_trading;
|
|
|
|
-- Exit
|
|
\q
|