feat: Add promo preference survey on main page

- Add promo preference fields to User model (promo_preferred_maker,
  promo_preferred_model, promo_email_enabled)
- Create API endpoints for getting/updating promo preferences
- Create PromoPreference component with maker/model selection
- Show login prompt for non-logged-in users when interacting
- Add promo notification service to send emails when matching vehicles
  are added to promotion
- Add multi-language translations (en, mn, ru, ko)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
AutonetSellCar Deploy
2026-01-12 23:37:31 +09:00
parent 2378392f95
commit 2720689515
10 changed files with 618 additions and 11 deletions

View File

@@ -10,6 +10,7 @@ from ..database import get_db
from ..models import User, SystemSettings, ReferralReward
from ..models.user import generate_referral_code
from ..schemas import UserCreate, UserUpdate, UserResponse, Token
from ..schemas.user import PromoPreferenceUpdate, PromoPreferenceResponse
from ..config import get_settings
router = APIRouter(prefix="/auth", tags=["auth"])
@@ -277,6 +278,28 @@ def update_me(
return current_user
@router.get("/me/promo-preference", response_model=PromoPreferenceResponse)
def get_promo_preference(current_user: User = Depends(get_current_user)):
"""프로모션 선호 차종 조회"""
return current_user
@router.put("/me/promo-preference", response_model=PromoPreferenceResponse)
def update_promo_preference(
promo_update: PromoPreferenceUpdate,
current_user: User = Depends(get_current_user),
db: Session = Depends(get_db)
):
"""프로모션 선호 차종 설정"""
current_user.promo_preferred_maker = promo_update.promo_preferred_maker
current_user.promo_preferred_model = promo_update.promo_preferred_model
current_user.promo_email_enabled = promo_update.promo_email_enabled
db.commit()
db.refresh(current_user)
return current_user
# Admin User Management Endpoints
@router.get("/admin/users")
def admin_get_users(