This commit is contained in:
Marcel Arndt
2026-01-19 12:21:48 +01:00
parent 62e663d053
commit d448ca6516
290 changed files with 50594 additions and 51540 deletions
@@ -0,0 +1,50 @@
/*
Warnings:
- A unique constraint covering the columns `[tourId,ticketId]` on the table `TourFile` will be added. If there are existing duplicate values, this will fail.
- Added the required column `approvalRequirement` to the `Ticket` table without a default value. This is not possible if the table is not empty.
- Added the required column `approvalStatus` to the `Ticket` table without a default value. This is not possible if the table is not empty.
- Added the required column `stage` to the `Ticket` table without a default value. This is not possible if the table is not empty.
*/
-- DropIndex
DROP INDEX "TourFile_tourId_ticketId_idx";
-- AlterTable
ALTER TABLE "Patient" ADD COLUMN "insuranceNo" TEXT;
-- AlterTable
ALTER TABLE "PatientSource" ADD COLUMN "stammVersNr" TEXT;
-- AlterTable
ALTER TABLE "PatientStaging" ADD COLUMN "insuranceNo" TEXT;
-- AlterTable
ALTER TABLE "Ticket" ADD COLUMN "approvalFullRequestMessageId" TEXT,
ADD COLUMN "approvalIsOverriden" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN "approvalLastInteractionAt" TIMESTAMP(3),
ADD COLUMN "approvalPreInquiryMessageId" TEXT,
ADD COLUMN "approvalRecipient" TEXT,
ADD COLUMN "approvalReminderCount" INTEGER NOT NULL DEFAULT 0,
ADD COLUMN "approvalRequestedAt" TIMESTAMP(3),
ADD COLUMN "approvalRequirement" TEXT NOT NULL,
ADD COLUMN "approvalStatus" TEXT NOT NULL,
ADD COLUMN "hasDigitalTransportDocument" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN "hasPhysicalTransportDocument" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN "patientId" UUID,
ADD COLUMN "stage" TEXT NOT NULL,
ADD COLUMN "updatedAt" TIMESTAMP(3),
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "currentState" DROP NOT NULL;
-- AlterTable
ALTER TABLE "Tour" ADD COLUMN "insuranceNo" TEXT;
-- AlterTable
ALTER TABLE "TourSource" ADD COLUMN "stammVersNr" TEXT;
-- AlterTable
ALTER TABLE "TourStaging" ADD COLUMN "insuranceNo" TEXT;
-- CreateIndex
CREATE UNIQUE INDEX "TourFile_tourId_ticketId_key" ON "TourFile"("tourId", "ticketId");
@@ -59,6 +59,7 @@ model TourSource {
itName String?
kkId String?
krankenkasse String?
stammVersNr String?
patId String?
patName String?
patSurname String?
@@ -196,6 +197,7 @@ model PatientSource {
birthday String?
kkId String?
krankenkasse String?
stammVersNr String?
pflegestufe String?
behinderung1 String?
behinderung2 String?
@@ -223,6 +225,7 @@ model TourStaging {
patientCity String?
healthInsurance String?
healthInsuranceNumber String?
insuranceNo String?
type String?
category String?
@@ -282,6 +285,7 @@ model PatientStaging {
birthday DateTime?
healthinsuranceId String?
healthinsurance String?
insuranceNo String?
careDegree String?
disabilityMark1 String?
disabilityMark2 String?
@@ -371,6 +375,7 @@ model Tour {
patientCity String?
healthInsurance String?
healthInsuranceNumber String?
insuranceNo String?
type String?
category String?
@@ -435,7 +440,7 @@ model TourFile {
createdAt DateTime? @default(now())
@@index([tourId, ticketId])
@@unique([tourId, ticketId])
}
model Patient {
@@ -449,6 +454,7 @@ model Patient {
birthday DateTime?
healthinsuranceId String?
healthinsurance String?
insuranceNo String?
careDegree String?
disabilityMark1 String?
disabilityMark2 String?
@@ -480,17 +486,35 @@ enum ApprovalState {
}
model Ticket {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
id String @id @db.Uuid
patientId String? @db.Uuid
stage String
approvalRequirement String
approvalStatus String
approvalRequestedAt DateTime?
approvalLastInteractionAt DateTime?
approvalReminderCount Int @default(0)
approvalRecipient String?
approvalPreInquiryMessageId String?
approvalFullRequestMessageId String?
approvalIsOverriden Boolean @default(false)
hasPhysicalTransportDocument Boolean @default(false)
hasDigitalTransportDocument Boolean @default(false)
updatedAt DateTime? @updatedAt
createdAt DateTime @default(now())
tours Tour[]
state TicketStateHistory[]
currentState TicketValidationState
currentState TicketValidationState?
notes String[]
errors String[]
isUrgent Boolean @default(false)
urgency DateTime @default("2099-12-31T23:59:59.999Z")
isUrgent Boolean @default(false)
urgency DateTime @default("2099-12-31T23:59:59.999Z")
approvalState ApprovalState?
documentInfo Json? @default("{\"approval\": {\"isNeeded\": null, \"whoRequested\": \"\",\"answeredFrom\": \"\"},\"tdLocation\": \"\"}")
createdAt DateTime @default(now())
documentInfo Json? @default("{\"approval\": {\"isNeeded\": null, \"whoRequested\": \"\",\"answeredFrom\": \"\"},\"tdLocation\": \"\"}")
}
model TicketStateHistory {