- Add Profile enum (ISABELLA, FRANCESCA, SEBASTIAN) to Child model - Add ?profile= query param override to /api/curriculum/next - Pass profile prop from profile-specific pages to ExerciseSession - Fix curriculum import paths (engine uses @/curriculum/ alias) - Clear stale curriculumCache on dev reload - Fix self-referential prerequisites in Francesca etapa-1 - Fix prerequisite chains in Francesca etapa-2,3,4 and Sebastian etapa-2,3 - Add Francesca curriculum: 2-3 digit sums, subtractions, multiplications, short readings - Add Sebastian curriculum: 2-3 digit sums, interactive exercises, Argentine history, flags - All 44 E2E tests pass, TypeScript compiles cleanly
188 lines
4.4 KiB
Plaintext
188 lines
4.4 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
enum Profile {
|
|
ISABELLA
|
|
FRANCESCA
|
|
SEBASTIAN
|
|
}
|
|
|
|
model Parent {
|
|
id String @id @default(cuid())
|
|
email String @unique
|
|
name String?
|
|
emailVerified Boolean @default(false)
|
|
image String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
familyId String?
|
|
family Family? @relation(fields: [familyId], references: [id])
|
|
|
|
sessions Session[]
|
|
accounts Account[]
|
|
}
|
|
|
|
model Session {
|
|
id String @id @default(cuid())
|
|
email String?
|
|
userId String?
|
|
parentId String?
|
|
parent Parent? @relation(fields: [parentId], references: [id])
|
|
token String @unique
|
|
expiresAt DateTime
|
|
ipAddress String?
|
|
userAgent String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Account {
|
|
id String @id @default(cuid())
|
|
accountId String
|
|
providerId String
|
|
userId String
|
|
user Parent @relation(fields: [userId], references: [id])
|
|
accessToken String?
|
|
refreshToken String?
|
|
idToken String?
|
|
accessTokenExpiresAt DateTime?
|
|
scope String?
|
|
password String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Verification {
|
|
id String @id @default(cuid())
|
|
identifier String
|
|
value String
|
|
expiresAt DateTime
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Family {
|
|
id String @id @default(cuid())
|
|
name String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
parents Parent[]
|
|
children Child[]
|
|
}
|
|
|
|
model Child {
|
|
id String @id @default(cuid())
|
|
name String?
|
|
profile Profile @default(ISABELLA)
|
|
avatar String?
|
|
birthdate DateTime?
|
|
profileNotes String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
familyId String
|
|
family Family @relation(fields: [familyId], references: [id])
|
|
|
|
devices Device[]
|
|
sessions SessionLog[]
|
|
fsrsCards FsrsCard[]
|
|
milestones Milestone[]
|
|
curriculumProgress CurriculumProgress[]
|
|
}
|
|
|
|
model Device {
|
|
id String @id @default(cuid())
|
|
deviceFingerprint String
|
|
pairedAt DateTime @default(now())
|
|
lastSeen DateTime @updatedAt
|
|
role String @default("child")
|
|
createdAt DateTime @default(now())
|
|
|
|
childId String
|
|
child Child @relation(fields: [childId], references: [id])
|
|
}
|
|
|
|
model SessionLog {
|
|
id String @id @default(cuid())
|
|
startedAt DateTime @default(now())
|
|
endedAt DateTime?
|
|
durationSec Int?
|
|
skillsPracticed String?
|
|
|
|
childId String
|
|
child Child @relation(fields: [childId], references: [id])
|
|
|
|
skillAttempts SkillAttempt[]
|
|
}
|
|
|
|
model SkillAttempt {
|
|
id String @id @default(cuid())
|
|
skillCode String
|
|
promptLevel Int @default(0)
|
|
correct Boolean
|
|
responseMs Int?
|
|
errorType String?
|
|
exerciseId String?
|
|
stage Int?
|
|
createdAt DateTime @default(now())
|
|
|
|
sessionLogId String
|
|
sessionLog SessionLog @relation(fields: [sessionLogId], references: [id])
|
|
}
|
|
|
|
model CurriculumProgress {
|
|
id String @id @default(cuid())
|
|
topic String
|
|
stage Int
|
|
unlockedAt DateTime @default(now())
|
|
completedAt DateTime?
|
|
|
|
childId String
|
|
child Child @relation(fields: [childId], references: [id])
|
|
|
|
@@unique([childId, topic, stage])
|
|
}
|
|
|
|
model FsrsCard {
|
|
id String @id @default(cuid())
|
|
skillCode String
|
|
dueAt DateTime @default(now())
|
|
stability Float @default(0)
|
|
difficulty Float @default(0)
|
|
reps Int @default(0)
|
|
lapses Int @default(0)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
childId String
|
|
child Child @relation(fields: [childId], references: [id])
|
|
}
|
|
|
|
model Milestone {
|
|
id String @id @default(cuid())
|
|
skillCode String
|
|
reachedAt DateTime @default(now())
|
|
|
|
childId String
|
|
child Child @relation(fields: [childId], references: [id])
|
|
|
|
@@unique([childId, skillCode])
|
|
}
|
|
|
|
model PendingPairing {
|
|
id String @id @default(cuid())
|
|
code String @unique
|
|
deviceFingerprint String?
|
|
childId String?
|
|
createdAt DateTime @default(now())
|
|
expiresAt DateTime
|
|
}
|