feat: add Twilio SMS/call integration with settings, templates, and conversation history

This commit is contained in:
Gitead
2026-05-02 20:18:58 -04:00
parent b73b8c97c6
commit 5689269690
17 changed files with 770 additions and 196 deletions

View File

@@ -0,0 +1,12 @@
CREATE TABLE "twilio_settings" (
"id" SERIAL NOT NULL,
"userId" INTEGER NOT NULL,
"accountSid" TEXT NOT NULL,
"authToken" TEXT NOT NULL,
"phoneNumber" TEXT NOT NULL,
CONSTRAINT "twilio_settings_pkey" PRIMARY KEY ("id")
);
ALTER TABLE "twilio_settings" ADD CONSTRAINT "twilio_settings_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
CREATE UNIQUE INDEX "twilio_settings_userId_key" ON "twilio_settings"("userId");

View File

@@ -0,0 +1 @@
ALTER TABLE "twilio_settings" ADD COLUMN IF NOT EXISTS "greetingMessage" TEXT;

View File

@@ -0,0 +1 @@
ALTER TABLE "twilio_settings" ADD COLUMN IF NOT EXISTS "templates" JSONB;

View File

@@ -37,6 +37,7 @@ model User {
cloudFolders CloudFolder[]
cloudFiles CloudFile[]
communications Communication[]
twilioSettings TwilioSettings?
}
model Patient {
@@ -544,3 +545,17 @@ model PatientDocument {
@@index([patientId])
@@index([uploadedAt])
}
model TwilioSettings {
id Int @id @default(autoincrement())
userId Int @unique
accountSid String
authToken String
phoneNumber String
greetingMessage String?
templates Json?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@map("twilio_settings")
}