generator client { provider = "prisma-client-js" } datasource db { provider = "sqlite" url = env("DATABASE_URL") } model Job { id String @id @default(cuid()) title String company String source String? url String? applyUrl String? payMin Float? payMax Float? payCurrency String? // USD, PHP payPeriod String? // hour, month, year location String? remoteType String? // remote, hybrid, onsite phEligibility String @default("unclear") // yes, unclear, no description String? requirements String? tags String? // comma-separated status String @default("prospect") // prospect, reviewing, tailoring, ready, applied, interviewing, offer, rejected, dead notes String? createdAt DateTime @default(now()) updatedAt DateTime @updatedAt resumes Resume[] coverLetters CoverLetter[] applications Application[] } model Resume { id String @id @default(cuid()) name String kind String @default("tailored") // base, tailored markdown String htmlRendered String? version Int @default(1) jobId String? job Job? @relation(fields: [jobId], references: [id], onDelete: SetNull) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } model CoverLetter { id String @id @default(cuid()) markdown String version Int @default(1) jobId String job Job @relation(fields: [jobId], references: [id], onDelete: Cascade) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } model Application { id String @id @default(cuid()) jobId String job Job @relation(fields: [jobId], references: [id], onDelete: Cascade) method String @default("manual") // manual, semi, auto submittedAt DateTime? confirmation String? answers String? // JSON: [{question, answer}] log String? createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } model Profile { id String @id @default("main") fullName String email String? phone String? location String? linkedin String? github String? portfolio String? headline String? summary String? skills String? // JSON array workHistory String? // JSON array of {position, company, unit, start, end, supervisor, bullets[]} updatedAt DateTime @updatedAt } model AiRun { id String @id @default(cuid()) type String // parse, tailor, cover, answers model String? inputSummary String? resultRef String? // id of created entity ok Boolean @default(true) error String? createdAt DateTime @default(now()) }