Step 3: Add admin API endpoints for pricing configuration

- Add PricingConfigResponse and PricingConfigUpdate schemas
- Create PricingService with validation logic
- Add GET and PUT endpoints in routes/pricing.py
- Add MANAGE_PRICING permission to admin role
- Register pricing router in main.py
- Add comprehensive API tests for permissions and validation
This commit is contained in:
counterweight 2025-12-26 20:13:24 +01:00
parent 74b934135a
commit 4d0dad8e2b
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
8 changed files with 534 additions and 0 deletions

View file

@ -22,6 +22,7 @@ class Permission(str, PyEnum):
# Availability/Exchange permissions (admin)
MANAGE_AVAILABILITY = "manage_availability"
MANAGE_PRICING = "manage_pricing"
VIEW_ALL_EXCHANGES = "view_all_exchanges"
CANCEL_ANY_EXCHANGE = "cancel_any_exchange"
COMPLETE_EXCHANGE = "complete_exchange"

View file

@ -14,6 +14,7 @@ ROLE_DEFINITIONS: dict[str, RoleConfig] = {
Permission.FETCH_PRICE,
Permission.MANAGE_INVITES,
Permission.MANAGE_AVAILABILITY,
Permission.MANAGE_PRICING,
Permission.VIEW_ALL_EXCHANGES,
Permission.CANCEL_ANY_EXCHANGE,
Permission.COMPLETE_EXCHANGE,