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

@@ -3,6 +3,7 @@
import { useState, useEffect } from 'react';
import Link from 'next/link';
import FilmStripSlider from '@/components/FilmStripSlider';
import PromoPreference from '@/components/PromoPreference';
import { HeroBanner, HeroBannerSettings } from '@/types';
import { heroBannersApi } from '@/lib/api';
import { useTranslation } from '@/lib/i18n';
@@ -45,13 +46,23 @@ export default function Home() {
{/* Film Strip Slider */}
<FilmStripSlider banners={banners} settings={bannerSettings} />
<div className="container mx-auto px-4 py-4 sm:py-8 text-center">
<Link
href="/vehicle-request"
className="inline-block bg-yellow-500 text-white font-semibold px-6 py-2.5 sm:px-8 sm:py-3 rounded-lg hover:bg-yellow-600 transition shadow-lg text-sm sm:text-base"
>
{t.requestVehicle}
</Link>
<div className="container mx-auto px-4 py-4 sm:py-8">
<div className="flex flex-col lg:flex-row items-center justify-center gap-4 lg:gap-8">
{/* Request Vehicle Button */}
<Link
href="/vehicle-request"
className="inline-block bg-yellow-500 text-white font-semibold px-6 py-2.5 sm:px-8 sm:py-3 rounded-lg hover:bg-yellow-600 transition shadow-lg text-sm sm:text-base"
>
{t.requestVehicle}
</Link>
{/* Divider */}
<div className="hidden lg:block w-px h-24 bg-white/30"></div>
<div className="lg:hidden w-32 h-px bg-white/30"></div>
{/* Promo Preference */}
<PromoPreference />
</div>
</div>
</section>