Add configurable CC cost for banner vehicle PDF/description view
- Add cc_per_banner_view setting to system_settings (default 0.1 CC) - Update car detail page to use dynamic CC value from settings - Add CC per Banner View field in admin settings page - Replace hardcoded 0.1 CC with configurable value 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -146,7 +146,12 @@ def check_car_view(
|
||||
}
|
||||
|
||||
|
||||
PERFORMANCE_CHECK_COST = 0.1 # 0.1 CC for performance check view
|
||||
def get_performance_check_cost(db: Session) -> float:
|
||||
"""Get performance check cost from system settings"""
|
||||
system_settings = db.query(SystemSettings).first()
|
||||
if system_settings and system_settings.cc_per_banner_view is not None:
|
||||
return system_settings.cc_per_banner_view
|
||||
return 0.1 # Default fallback
|
||||
|
||||
|
||||
@router.post("/purchase-performance-check")
|
||||
@@ -155,8 +160,9 @@ async def purchase_performance_check_view(
|
||||
current_user: User = Depends(get_current_user),
|
||||
db: Session = Depends(get_db)
|
||||
):
|
||||
"""Purchase access to view performance check (costs 0.1 CC)"""
|
||||
"""Purchase access to view performance check (costs CC based on system settings)"""
|
||||
car_id = request.car_id
|
||||
PERFORMANCE_CHECK_COST = get_performance_check_cost(db)
|
||||
|
||||
# Check if car exists
|
||||
car = db.query(Car).filter(Car.id == car_id).first()
|
||||
|
||||
Reference in New Issue
Block a user