feat: add tbank tokens

This commit is contained in:
2026-08-13 19:31:43 +03:00
parent 4cbfc2621c
commit 31cbba8654
25 changed files with 3592 additions and 24 deletions
@@ -0,0 +1,10 @@
-- CreateTable
CREATE TABLE "TbankConnection" (
"userId" TEXT NOT NULL,
"encryptedToken" TEXT NOT NULL,
"connectedAt" DATETIME NOT NULL,
CONSTRAINT "TbankConnection_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
-- CreateIndex
CREATE UNIQUE INDEX "TbankConnection_userId_key" ON "TbankConnection"("userId");
+14 -6
View File
@@ -9,12 +9,20 @@ datasource db {
}
model User {
id String @id
email String @unique
passwordHash String
sessions Session[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
id String @id
email String @unique
passwordHash String
sessions Session[]
tbankConnection TbankConnection?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model TbankConnection {
userId String @unique
encryptedToken String
connectedAt DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}
model Session {