Phase 2.1-2.3: Add exchange endpoints

Add exchange trading endpoints:
- POST /api/exchange: Create exchange trade
  - Validates slot, price staleness, EUR amount limits
  - Calculates sats from EUR and agreed price
  - Direction-specific premium (buy=+5%, sell=-5%)

- GET /api/trades: List user's exchanges
- POST /api/trades/{id}/cancel: Cancel user's exchange

Add schemas:
- ExchangeRequest, ExchangeResponse
- ExchangeUserContact, AdminExchangeResponse (for Phase 2.4)
- PaginatedExchanges, PaginatedAdminExchanges
This commit is contained in:
counterweight 2025-12-22 18:28:56 +01:00
parent d88d69cf9f
commit ce9159c5b0
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
3 changed files with 382 additions and 15 deletions

View file

@ -41,7 +41,6 @@ app.add_middleware(
# Include routers - modules with single router
app.include_router(auth_routes.router)
app.include_router(audit_routes.router)
app.include_router(exchange_routes.router)
app.include_router(profile_routes.router)
app.include_router(availability_routes.router)
app.include_router(meta_routes.router)
@ -51,3 +50,5 @@ for r in invites_routes.routers:
app.include_router(r)
for r in booking_routes.routers:
app.include_router(r)
for r in exchange_routes.routers:
app.include_router(r)