1 Commits
Author SHA1 Message Date
adminsandClaude Opus 5.5 981ea3a893 Витрина: телефон в заказе обязателен, предзаполнен из профиля
payment-router с 20261111 требует телефон (слово владельца: писать
покупателю в Telegram, если оплата не прошла). Поле видимое, обязательное,
подставляется User.phone, если есть.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:22:10 +05:00
3 changed files with 32 additions and 4 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ export default async function StudentDashboard() {
const dbUser = await prisma.user.findUnique({ const dbUser = await prisma.user.findUnique({
where: { id: session.user.id }, where: { id: session.user.id },
select: { archetype: true }, select: { archetype: true, phone: true },
}); });
const enrollments = await prisma.courseEnrollment.findMany({ const enrollments = await prisma.courseEnrollment.findMany({
@@ -168,7 +168,7 @@ export default async function StudentDashboard() {
{locked.length > 0 && ( {locked.length > 0 && (
<StoreShowcase <StoreShowcase
courses={locked} courses={locked}
buyer={{ name: session.user.name, email: session.user.email }} buyer={{ name: session.user.name, email: session.user.email, phone: dbUser?.phone }}
/> />
)} )}
@@ -30,7 +30,7 @@ interface PayMethod {
interface Props { interface Props {
course: LockedCourse; course: LockedCourse;
entry: StoreCatalogEntry; entry: StoreCatalogEntry;
buyer: { name: string; email: string }; buyer: { name: string; email: string; phone?: string | null };
onClose: () => void; onClose: () => void;
} }
@@ -257,6 +257,34 @@ export function StoreCheckoutModal({ course, entry, buyer, onClose }: Props) {
</div> </div>
)} )}
{/* Phone — required by payment-router since 20261111 (owner messages buyers in Telegram) */}
<div className="mb-4">
<label
className={labelClass}
style={{ color: "var(--muted-foreground)" }}
htmlFor={`${titleId}-phone`}
>
Телефон
</label>
<input
id={`${titleId}-phone`}
type="tel"
name="phone"
required
maxLength={30}
autoComplete="tel"
inputMode="tel"
defaultValue={buyer.phone ?? ""}
placeholder="+7 900 000-00-00"
style={inputStyle}
onFocus={(e) => (e.currentTarget.style.borderColor = "var(--foreground)")}
onBlur={(e) => (e.currentTarget.style.borderColor = "var(--border)")}
/>
<p className="text-xs mt-1" style={{ color: "var(--muted-foreground)" }}>
Напишу в Telegram, если с оплатой что-то пойдёт не так.
</p>
</div>
{/* Promo code */} {/* Promo code */}
<div className="mb-4"> <div className="mb-4">
<label <label
+1 -1
View File
@@ -6,7 +6,7 @@ import { StoreCheckoutModal, type LockedCourse } from "./store-checkout-modal";
interface Props { interface Props {
courses: LockedCourse[]; courses: LockedCourse[];
buyer: { name: string; email: string }; buyer: { name: string; email: string; phone?: string | null };
} }
// Blurred card body shared by both the modal-trigger button and the // Blurred card body shared by both the modal-trigger button and the