feat: Puente Mayúscula-Minúscula + TTS SpeechSynthesis + E2E fixes

This commit is contained in:
renato97
2026-07-21 15:31:46 -03:00
commit fa8e0c58ce
120 changed files with 16013 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
import { NextRequest, NextResponse } from "next/server"
import { prisma } from "@/lib/db"
import { buildFsrsCard, getRetrievability } from "@/lib/fsrs"
export async function GET(request: NextRequest) {
const childId = request.nextUrl.searchParams.get("childId")
if (!childId) {
return NextResponse.json({ error: "childId required" }, { status: 400 })
}
const dueCard = await prisma.fsrsCard.findFirst({
where: {
childId,
dueAt: { lte: new Date() },
},
orderBy: { dueAt: "asc" },
})
if (dueCard) {
const card = buildFsrsCard({
stability: dueCard.stability,
difficulty: dueCard.difficulty,
reps: dueCard.reps,
lapses: dueCard.lapses,
due: dueCard.dueAt,
})
return NextResponse.json({
...dueCard,
cardId: dueCard.id,
retrievability: getRetrievability(card),
})
}
return NextResponse.json({ skillCode: null })
}