feat:add candidate apis

This commit is contained in:
ARJUN S THAMPI
2026-03-13 16:26:06 +05:30
parent 7955465be4
commit 9faa512c0b
5 changed files with 267 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
-- CreateTable
CREATE TABLE "Candidate" (
"id" SERIAL NOT NULL,
"fullName" TEXT NOT NULL,
"mobile" TEXT NOT NULL,
"email" TEXT NOT NULL,
"subject" TEXT NOT NULL,
"coverLetter" TEXT NOT NULL,
"careerId" INTEGER NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "Candidate_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "Candidate" ADD CONSTRAINT "Candidate_careerId_fkey" FOREIGN KEY ("careerId") REFERENCES "Career"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@@ -27,6 +27,7 @@ model Doctor {
qualification String?
departments DoctorDepartment[]
appointments Appointment[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@ -45,6 +46,7 @@ model Department {
services String?
doctors DoctorDepartment[]
appointments Appointment[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@ -109,6 +111,42 @@ model Career {
number String?
status String @default("new")
candidates Candidate[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Candidate {
id Int @id @default(autoincrement())
fullName String
mobile String
email String
subject String
coverLetter String
careerId Int
career Career @relation(fields: [careerId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Appointment {
id Int @id @default(autoincrement())
name String
mobileNumber String
email String?
message String?
date DateTime
doctorId Int
departmentId Int
doctor Doctor @relation(fields: [doctorId], references: [id])
department Department @relation(fields: [departmentId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}