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:
AutonetSellCar Deploy
2026-01-01 09:41:18 +09:00
parent 0d807eccc6
commit 7f45de7a89
6 changed files with 40 additions and 9 deletions

View File

@@ -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()

View File

@@ -26,6 +26,7 @@ def get_or_create_settings(db: Session) -> SystemSettings:
cc_per_usdc=1, # 1 USD = 1 CC
cc_per_view=1, # 차량 상세 조회 시 1 CC
cars_per_cc=3, # 1 CC = 3 recommended vehicles per request
cc_per_banner_view=0.1, # 배너 차량 PDF/상세 보기 비용
cc_signup_bonus=3, # 3 CC free on signup
cache_ttl_hours=2,
container_logistics_usd=3600,