Initial commit: Cat Sitting Planner with PWA, SQLite, and Webhook Notifications

This commit is contained in:
2026-01-12 20:48:23 +01:00
commit 3121ef223d
52 changed files with 13722 additions and 0 deletions

BIN
prisma/dev.db Normal file

Binary file not shown.

View File

@@ -0,0 +1,23 @@
-- CreateTable
CREATE TABLE "Plan" (
"id" TEXT NOT NULL PRIMARY KEY,
"password" TEXT NOT NULL,
"startDate" DATETIME NOT NULL,
"endDate" DATETIME NOT NULL,
"instructions" TEXT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "Booking" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"planId" TEXT NOT NULL,
"date" DATETIME NOT NULL,
"sitterName" TEXT,
"type" TEXT NOT NULL DEFAULT 'SITTER',
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "Booking_planId_fkey" FOREIGN KEY ("planId") REFERENCES "Plan" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- CreateIndex
CREATE UNIQUE INDEX "Booking_planId_date_sitterName_key" ON "Booking"("planId", "date", "sitterName");

View File

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Plan" ADD COLUMN "webhookUrl" TEXT;

View File

@@ -0,0 +1,18 @@
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Plan" (
"id" TEXT NOT NULL PRIMARY KEY,
"password" TEXT NOT NULL,
"startDate" DATETIME NOT NULL,
"endDate" DATETIME NOT NULL,
"instructions" TEXT,
"webhookUrl" TEXT,
"notifyAll" BOOLEAN NOT NULL DEFAULT true,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_Plan" ("createdAt", "endDate", "id", "instructions", "password", "startDate", "webhookUrl") SELECT "createdAt", "endDate", "id", "instructions", "password", "startDate", "webhookUrl" FROM "Plan";
DROP TABLE "Plan";
ALTER TABLE "new_Plan" RENAME TO "Plan";
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;

View File

@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (e.g., Git)
provider = "sqlite"

32
prisma/schema.prisma Normal file
View File

@@ -0,0 +1,32 @@
datasource db {
provider = "sqlite"
url = "file:./dev.db"
}
generator client {
provider = "prisma-client-js"
}
model Plan {
id String @id @default(cuid())
password String
startDate DateTime
endDate DateTime
instructions String?
webhookUrl String?
notifyAll Boolean @default(true)
createdAt DateTime @default(now())
bookings Booking[]
}
model Booking {
id Int @id @default(autoincrement())
planId String
plan Plan @relation(fields: [planId], references: [id])
date DateTime
sitterName String?
type String @default("SITTER") // "SITTER" or "OWNER_HOME"
createdAt DateTime @default(now())
@@unique([planId, date, sitterName])
}