diff --git a/prisma/migrations/20260324132106_add_proclamation_subscription_levels/migration.sql b/prisma/migrations/20260324132106_add_proclamation_subscription_levels/migration.sql new file mode 100644 index 0000000..8d6b630 --- /dev/null +++ b/prisma/migrations/20260324132106_add_proclamation_subscription_levels/migration.sql @@ -0,0 +1,17 @@ +-- AlterTable +ALTER TABLE "Proclamation" ADD COLUMN "subscriptionLevelId" INTEGER NOT NULL DEFAULT 1; + +-- CreateTable +CREATE TABLE "SubscriptionLevel" ( + "id" SERIAL NOT NULL, + "name" TEXT NOT NULL, + "description" TEXT, + + CONSTRAINT "SubscriptionLevel_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE INDEX "Proclamation_subscriptionLevelId_idx" ON "Proclamation"("subscriptionLevelId"); + +-- AddForeignKey +ALTER TABLE "Proclamation" ADD CONSTRAINT "Proclamation_subscriptionLevelId_fkey" FOREIGN KEY ("subscriptionLevelId") REFERENCES "SubscriptionLevel"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 8f070b1..523790d 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -120,6 +120,10 @@ model Proclamation { category ProclamationCategory @relation(fields: [categoryId], references: [id]) price Float @default(0.99) userProclamations UserProclamations[] + subscriptionLevelId Int @default(1) + subscriptionLevel SubscriptionLevel @relation(fields: [subscriptionLevelId], references: [id]) + + @@index(subscriptionLevelId) } model UserProclamations { @@ -159,3 +163,10 @@ model LicenseKey { userId String user User @relation(fields: [userId], references: [id]) } + +model SubscriptionLevel { + id Int @id @default(autoincrement()) + name String + description String? + proclamations Proclamation[] +} \ No newline at end of file diff --git a/src/lib/generated/prisma/browser.ts b/src/lib/generated/prisma/browser.ts index 9393ff3..e21658d 100644 --- a/src/lib/generated/prisma/browser.ts +++ b/src/lib/generated/prisma/browser.ts @@ -77,3 +77,8 @@ export type ProclamationCategory = Prisma.ProclamationCategoryModel * */ export type LicenseKey = Prisma.LicenseKeyModel +/** + * Model SubscriptionLevel + * + */ +export type SubscriptionLevel = Prisma.SubscriptionLevelModel diff --git a/src/lib/generated/prisma/client.ts b/src/lib/generated/prisma/client.ts index b9fff2a..f38550c 100644 --- a/src/lib/generated/prisma/client.ts +++ b/src/lib/generated/prisma/client.ts @@ -99,3 +99,8 @@ export type ProclamationCategory = Prisma.ProclamationCategoryModel * */ export type LicenseKey = Prisma.LicenseKeyModel +/** + * Model SubscriptionLevel + * + */ +export type SubscriptionLevel = Prisma.SubscriptionLevelModel diff --git a/src/lib/generated/prisma/internal/class.ts b/src/lib/generated/prisma/internal/class.ts index ec0bc6d..c1ff1f9 100644 --- a/src/lib/generated/prisma/internal/class.ts +++ b/src/lib/generated/prisma/internal/class.ts @@ -20,7 +20,7 @@ const config: runtime.GetPrismaClientConfig = { "clientVersion": "7.2.0", "engineVersion": "0c8ef2ce45c83248ab3df073180d5eda9e8be7a3", "activeProvider": "postgresql", - "inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../src/lib/generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel User {\n id String @id\n name String\n email String\n emailVerified Boolean @default(false)\n image String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n roleId Int?\n role UserRole? @relation(fields: [roleId], references: [id])\n sessions Session[]\n accounts Account[]\n profile Profile?\n licenseKeys LicenseKey[]\n userProclamations UserProclamations[]\n\n @@unique([email])\n @@map(\"user\")\n}\n\n// I chose to create a Profile table here because honestly, I didn't want to waste\n// a bunch of time trying to figure out how to customize the default Better-Auth model. \nmodel Profile {\n id String @id @default(uuid())\n userId String @unique\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n firstName String\n lastName String\n phoneNumber String\n addresses Address[]\n}\n\nmodel Address {\n id String @id @default(uuid())\n profileId String\n profile Profile @relation(fields: [profileId], references: [id], onDelete: Cascade)\n street String\n city String\n state String\n postalCode String\n country String\n}\n\nmodel Session {\n id String @id\n expiresAt DateTime\n token String\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n ipAddress String?\n userAgent String?\n userId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@unique([token])\n @@index([userId])\n @@map(\"session\")\n}\n\nmodel Account {\n id String @id\n accountId String\n providerId String\n userId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n accessToken String?\n refreshToken String?\n idToken String?\n accessTokenExpiresAt DateTime?\n refreshTokenExpiresAt DateTime?\n scope String?\n password String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([userId])\n @@map(\"account\")\n}\n\nmodel UserRole {\n id Int @id @default(autoincrement())\n name String\n users User[]\n}\n\nmodel Verification {\n id String @id\n identifier String\n value String\n expiresAt DateTime\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([identifier])\n @@map(\"verification\")\n}\n\nmodel Proclamation {\n id String @id @default(uuid())\n name String @unique\n content String\n solfeggioFrequencyId Int\n solfeggioFrequency SolfeggioFrequency @relation(fields: [solfeggioFrequencyId], references: [id])\n categoryId Int\n category ProclamationCategory @relation(fields: [categoryId], references: [id])\n price Float @default(0.99)\n userProclamations UserProclamations[]\n}\n\nmodel UserProclamations {\n userId String\n user User @relation(fields: [userId], references: [id])\n proclamationId String\n proclamation Proclamation @relation(fields: [proclamationId], references: [id])\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@id([userId, proclamationId])\n}\n\nmodel SolfeggioFrequency {\n id Int @id @default(autoincrement())\n name String @unique\n value Float @unique\n proclamations Proclamation[]\n}\n\nmodel ProclamationCategory {\n id Int @id @default(autoincrement())\n name String\n parentId Int?\n parent ProclamationCategory? @relation(\"CategoryHierarchy\", fields: [parentId], references: [id])\n children ProclamationCategory[] @relation(\"CategoryHierarchy\")\n proclamations Proclamation[]\n\n @@unique([parentId, name])\n}\n\nmodel LicenseKey {\n id String @id @default(uuid())\n key String @unique\n active Boolean\n level String\n userId String\n user User @relation(fields: [userId], references: [id])\n}\n", + "inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../src/lib/generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel User {\n id String @id\n name String\n email String\n emailVerified Boolean @default(false)\n image String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n roleId Int?\n role UserRole? @relation(fields: [roleId], references: [id])\n sessions Session[]\n accounts Account[]\n profile Profile?\n licenseKeys LicenseKey[]\n userProclamations UserProclamations[]\n\n @@unique([email])\n @@map(\"user\")\n}\n\n// I chose to create a Profile table here because honestly, I didn't want to waste\n// a bunch of time trying to figure out how to customize the default Better-Auth model. \nmodel Profile {\n id String @id @default(uuid())\n userId String @unique\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n firstName String\n lastName String\n phoneNumber String\n addresses Address[]\n}\n\nmodel Address {\n id String @id @default(uuid())\n profileId String\n profile Profile @relation(fields: [profileId], references: [id], onDelete: Cascade)\n street String\n city String\n state String\n postalCode String\n country String\n}\n\nmodel Session {\n id String @id\n expiresAt DateTime\n token String\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n ipAddress String?\n userAgent String?\n userId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@unique([token])\n @@index([userId])\n @@map(\"session\")\n}\n\nmodel Account {\n id String @id\n accountId String\n providerId String\n userId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n accessToken String?\n refreshToken String?\n idToken String?\n accessTokenExpiresAt DateTime?\n refreshTokenExpiresAt DateTime?\n scope String?\n password String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([userId])\n @@map(\"account\")\n}\n\nmodel UserRole {\n id Int @id @default(autoincrement())\n name String\n users User[]\n}\n\nmodel Verification {\n id String @id\n identifier String\n value String\n expiresAt DateTime\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([identifier])\n @@map(\"verification\")\n}\n\nmodel Proclamation {\n id String @id @default(uuid())\n name String @unique\n content String\n solfeggioFrequencyId Int\n solfeggioFrequency SolfeggioFrequency @relation(fields: [solfeggioFrequencyId], references: [id])\n categoryId Int\n category ProclamationCategory @relation(fields: [categoryId], references: [id])\n price Float @default(0.99)\n userProclamations UserProclamations[]\n subscriptionLevelId Int @default(1)\n subscriptionLevel SubscriptionLevel @relation(fields: [subscriptionLevelId], references: [id])\n\n @@index(subscriptionLevelId)\n}\n\nmodel UserProclamations {\n userId String\n user User @relation(fields: [userId], references: [id])\n proclamationId String\n proclamation Proclamation @relation(fields: [proclamationId], references: [id])\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@id([userId, proclamationId])\n}\n\nmodel SolfeggioFrequency {\n id Int @id @default(autoincrement())\n name String @unique\n value Float @unique\n proclamations Proclamation[]\n}\n\nmodel ProclamationCategory {\n id Int @id @default(autoincrement())\n name String\n parentId Int?\n parent ProclamationCategory? @relation(\"CategoryHierarchy\", fields: [parentId], references: [id])\n children ProclamationCategory[] @relation(\"CategoryHierarchy\")\n proclamations Proclamation[]\n\n @@unique([parentId, name])\n}\n\nmodel LicenseKey {\n id String @id @default(uuid())\n key String @unique\n active Boolean\n level String\n userId String\n user User @relation(fields: [userId], references: [id])\n}\n\nmodel SubscriptionLevel {\n id Int @id @default(autoincrement())\n name String\n description String?\n proclamations Proclamation[]\n}\n", "runtimeDataModel": { "models": {}, "enums": {}, @@ -28,7 +28,7 @@ const config: runtime.GetPrismaClientConfig = { } } -config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"emailVerified\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"image\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"roleId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"role\",\"kind\":\"object\",\"type\":\"UserRole\",\"relationName\":\"UserToUserRole\"},{\"name\":\"sessions\",\"kind\":\"object\",\"type\":\"Session\",\"relationName\":\"SessionToUser\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToUser\"},{\"name\":\"profile\",\"kind\":\"object\",\"type\":\"Profile\",\"relationName\":\"ProfileToUser\"},{\"name\":\"licenseKeys\",\"kind\":\"object\",\"type\":\"LicenseKey\",\"relationName\":\"LicenseKeyToUser\"},{\"name\":\"userProclamations\",\"kind\":\"object\",\"type\":\"UserProclamations\",\"relationName\":\"UserToUserProclamations\"}],\"dbName\":\"user\"},\"Profile\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"ProfileToUser\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"phoneNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"addresses\",\"kind\":\"object\",\"type\":\"Address\",\"relationName\":\"AddressToProfile\"}],\"dbName\":null},\"Address\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"profileId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"profile\",\"kind\":\"object\",\"type\":\"Profile\",\"relationName\":\"AddressToProfile\"},{\"name\":\"street\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"city\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"state\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"postalCode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"country\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":null},\"Session\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"token\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userAgent\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"SessionToUser\"}],\"dbName\":\"session\"},\"Account\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accountId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"providerId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"AccountToUser\"},{\"name\":\"accessToken\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"refreshToken\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"idToken\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accessTokenExpiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"refreshTokenExpiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"scope\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"account\"},\"UserRole\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"users\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"UserToUserRole\"}],\"dbName\":null},\"Verification\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"identifier\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"value\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"verification\"},\"Proclamation\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"content\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"solfeggioFrequencyId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"solfeggioFrequency\",\"kind\":\"object\",\"type\":\"SolfeggioFrequency\",\"relationName\":\"ProclamationToSolfeggioFrequency\"},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"ProclamationCategory\",\"relationName\":\"ProclamationToProclamationCategory\"},{\"name\":\"price\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"userProclamations\",\"kind\":\"object\",\"type\":\"UserProclamations\",\"relationName\":\"ProclamationToUserProclamations\"}],\"dbName\":null},\"UserProclamations\":{\"fields\":[{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"UserToUserProclamations\"},{\"name\":\"proclamationId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"proclamation\",\"kind\":\"object\",\"type\":\"Proclamation\",\"relationName\":\"ProclamationToUserProclamations\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"SolfeggioFrequency\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"value\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"proclamations\",\"kind\":\"object\",\"type\":\"Proclamation\",\"relationName\":\"ProclamationToSolfeggioFrequency\"}],\"dbName\":null},\"ProclamationCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"parentId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"parent\",\"kind\":\"object\",\"type\":\"ProclamationCategory\",\"relationName\":\"CategoryHierarchy\"},{\"name\":\"children\",\"kind\":\"object\",\"type\":\"ProclamationCategory\",\"relationName\":\"CategoryHierarchy\"},{\"name\":\"proclamations\",\"kind\":\"object\",\"type\":\"Proclamation\",\"relationName\":\"ProclamationToProclamationCategory\"}],\"dbName\":null},\"LicenseKey\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"key\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"active\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"level\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"LicenseKeyToUser\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"emailVerified\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"image\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"roleId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"role\",\"kind\":\"object\",\"type\":\"UserRole\",\"relationName\":\"UserToUserRole\"},{\"name\":\"sessions\",\"kind\":\"object\",\"type\":\"Session\",\"relationName\":\"SessionToUser\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToUser\"},{\"name\":\"profile\",\"kind\":\"object\",\"type\":\"Profile\",\"relationName\":\"ProfileToUser\"},{\"name\":\"licenseKeys\",\"kind\":\"object\",\"type\":\"LicenseKey\",\"relationName\":\"LicenseKeyToUser\"},{\"name\":\"userProclamations\",\"kind\":\"object\",\"type\":\"UserProclamations\",\"relationName\":\"UserToUserProclamations\"}],\"dbName\":\"user\"},\"Profile\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"ProfileToUser\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"phoneNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"addresses\",\"kind\":\"object\",\"type\":\"Address\",\"relationName\":\"AddressToProfile\"}],\"dbName\":null},\"Address\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"profileId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"profile\",\"kind\":\"object\",\"type\":\"Profile\",\"relationName\":\"AddressToProfile\"},{\"name\":\"street\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"city\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"state\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"postalCode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"country\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":null},\"Session\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"token\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userAgent\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"SessionToUser\"}],\"dbName\":\"session\"},\"Account\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accountId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"providerId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"AccountToUser\"},{\"name\":\"accessToken\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"refreshToken\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"idToken\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accessTokenExpiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"refreshTokenExpiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"scope\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"account\"},\"UserRole\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"users\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"UserToUserRole\"}],\"dbName\":null},\"Verification\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"identifier\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"value\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"verification\"},\"Proclamation\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"content\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"solfeggioFrequencyId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"solfeggioFrequency\",\"kind\":\"object\",\"type\":\"SolfeggioFrequency\",\"relationName\":\"ProclamationToSolfeggioFrequency\"},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"ProclamationCategory\",\"relationName\":\"ProclamationToProclamationCategory\"},{\"name\":\"price\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"userProclamations\",\"kind\":\"object\",\"type\":\"UserProclamations\",\"relationName\":\"ProclamationToUserProclamations\"},{\"name\":\"subscriptionLevelId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"subscriptionLevel\",\"kind\":\"object\",\"type\":\"SubscriptionLevel\",\"relationName\":\"ProclamationToSubscriptionLevel\"}],\"dbName\":null},\"UserProclamations\":{\"fields\":[{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"UserToUserProclamations\"},{\"name\":\"proclamationId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"proclamation\",\"kind\":\"object\",\"type\":\"Proclamation\",\"relationName\":\"ProclamationToUserProclamations\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"SolfeggioFrequency\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"value\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"proclamations\",\"kind\":\"object\",\"type\":\"Proclamation\",\"relationName\":\"ProclamationToSolfeggioFrequency\"}],\"dbName\":null},\"ProclamationCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"parentId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"parent\",\"kind\":\"object\",\"type\":\"ProclamationCategory\",\"relationName\":\"CategoryHierarchy\"},{\"name\":\"children\",\"kind\":\"object\",\"type\":\"ProclamationCategory\",\"relationName\":\"CategoryHierarchy\"},{\"name\":\"proclamations\",\"kind\":\"object\",\"type\":\"Proclamation\",\"relationName\":\"ProclamationToProclamationCategory\"}],\"dbName\":null},\"LicenseKey\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"key\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"active\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"level\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"LicenseKeyToUser\"}],\"dbName\":null},\"SubscriptionLevel\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"proclamations\",\"kind\":\"object\",\"type\":\"Proclamation\",\"relationName\":\"ProclamationToSubscriptionLevel\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") async function decodeBase64AsWasm(wasmBase64: string): Promise { const { Buffer } = await import('node:buffer') @@ -293,6 +293,16 @@ export interface PrismaClient< * ``` */ get licenseKey(): Prisma.LicenseKeyDelegate; + + /** + * `prisma.subscriptionLevel`: Exposes CRUD operations for the **SubscriptionLevel** model. + * Example usage: + * ```ts + * // Fetch zero or more SubscriptionLevels + * const subscriptionLevels = await prisma.subscriptionLevel.findMany() + * ``` + */ + get subscriptionLevel(): Prisma.SubscriptionLevelDelegate; } export function getPrismaClientClass(): PrismaClientConstructor { diff --git a/src/lib/generated/prisma/internal/prismaNamespace.ts b/src/lib/generated/prisma/internal/prismaNamespace.ts index 2d3cb5c..4737b35 100644 --- a/src/lib/generated/prisma/internal/prismaNamespace.ts +++ b/src/lib/generated/prisma/internal/prismaNamespace.ts @@ -395,7 +395,8 @@ export const ModelName = { UserProclamations: 'UserProclamations', SolfeggioFrequency: 'SolfeggioFrequency', ProclamationCategory: 'ProclamationCategory', - LicenseKey: 'LicenseKey' + LicenseKey: 'LicenseKey', + SubscriptionLevel: 'SubscriptionLevel' } as const export type ModelName = (typeof ModelName)[keyof typeof ModelName] @@ -411,7 +412,7 @@ export type TypeMap + fields: Prisma.SubscriptionLevelFieldRefs + operations: { + findUnique: { + args: Prisma.SubscriptionLevelFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.SubscriptionLevelFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.SubscriptionLevelFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.SubscriptionLevelFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.SubscriptionLevelFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.SubscriptionLevelCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.SubscriptionLevelCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.SubscriptionLevelCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.SubscriptionLevelDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.SubscriptionLevelUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.SubscriptionLevelDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.SubscriptionLevelUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.SubscriptionLevelUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.SubscriptionLevelUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.SubscriptionLevelAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.SubscriptionLevelGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.SubscriptionLevelCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } } } & { other: { @@ -1439,7 +1514,8 @@ export const ProclamationScalarFieldEnum = { content: 'content', solfeggioFrequencyId: 'solfeggioFrequencyId', categoryId: 'categoryId', - price: 'price' + price: 'price', + subscriptionLevelId: 'subscriptionLevelId' } as const export type ProclamationScalarFieldEnum = (typeof ProclamationScalarFieldEnum)[keyof typeof ProclamationScalarFieldEnum] @@ -1484,6 +1560,15 @@ export const LicenseKeyScalarFieldEnum = { export type LicenseKeyScalarFieldEnum = (typeof LicenseKeyScalarFieldEnum)[keyof typeof LicenseKeyScalarFieldEnum] +export const SubscriptionLevelScalarFieldEnum = { + id: 'id', + name: 'name', + description: 'description' +} as const + +export type SubscriptionLevelScalarFieldEnum = (typeof SubscriptionLevelScalarFieldEnum)[keyof typeof SubscriptionLevelScalarFieldEnum] + + export const SortOrder = { asc: 'asc', desc: 'desc' @@ -1683,6 +1768,7 @@ export type GlobalOmitConfig = { solfeggioFrequency?: Prisma.SolfeggioFrequencyOmit proclamationCategory?: Prisma.ProclamationCategoryOmit licenseKey?: Prisma.LicenseKeyOmit + subscriptionLevel?: Prisma.SubscriptionLevelOmit } /* Types for Logging */ diff --git a/src/lib/generated/prisma/internal/prismaNamespaceBrowser.ts b/src/lib/generated/prisma/internal/prismaNamespaceBrowser.ts index 7ab0ab2..10955d2 100644 --- a/src/lib/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/src/lib/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -62,7 +62,8 @@ export const ModelName = { UserProclamations: 'UserProclamations', SolfeggioFrequency: 'SolfeggioFrequency', ProclamationCategory: 'ProclamationCategory', - LicenseKey: 'LicenseKey' + LicenseKey: 'LicenseKey', + SubscriptionLevel: 'SubscriptionLevel' } as const export type ModelName = (typeof ModelName)[keyof typeof ModelName] @@ -178,7 +179,8 @@ export const ProclamationScalarFieldEnum = { content: 'content', solfeggioFrequencyId: 'solfeggioFrequencyId', categoryId: 'categoryId', - price: 'price' + price: 'price', + subscriptionLevelId: 'subscriptionLevelId' } as const export type ProclamationScalarFieldEnum = (typeof ProclamationScalarFieldEnum)[keyof typeof ProclamationScalarFieldEnum] @@ -223,6 +225,15 @@ export const LicenseKeyScalarFieldEnum = { export type LicenseKeyScalarFieldEnum = (typeof LicenseKeyScalarFieldEnum)[keyof typeof LicenseKeyScalarFieldEnum] +export const SubscriptionLevelScalarFieldEnum = { + id: 'id', + name: 'name', + description: 'description' +} as const + +export type SubscriptionLevelScalarFieldEnum = (typeof SubscriptionLevelScalarFieldEnum)[keyof typeof SubscriptionLevelScalarFieldEnum] + + export const SortOrder = { asc: 'asc', desc: 'desc' diff --git a/src/lib/generated/prisma/models.ts b/src/lib/generated/prisma/models.ts index 5438547..67ed47c 100644 --- a/src/lib/generated/prisma/models.ts +++ b/src/lib/generated/prisma/models.ts @@ -20,4 +20,5 @@ export type * from './models/UserProclamations.ts' export type * from './models/SolfeggioFrequency.ts' export type * from './models/ProclamationCategory.ts' export type * from './models/LicenseKey.ts' +export type * from './models/SubscriptionLevel.ts' export type * from './commonInputTypes.ts' \ No newline at end of file diff --git a/src/lib/generated/prisma/models/Proclamation.ts b/src/lib/generated/prisma/models/Proclamation.ts index 514bf1f..9106d1f 100644 --- a/src/lib/generated/prisma/models/Proclamation.ts +++ b/src/lib/generated/prisma/models/Proclamation.ts @@ -30,12 +30,14 @@ export type ProclamationAvgAggregateOutputType = { solfeggioFrequencyId: number | null categoryId: number | null price: number | null + subscriptionLevelId: number | null } export type ProclamationSumAggregateOutputType = { solfeggioFrequencyId: number | null categoryId: number | null price: number | null + subscriptionLevelId: number | null } export type ProclamationMinAggregateOutputType = { @@ -45,6 +47,7 @@ export type ProclamationMinAggregateOutputType = { solfeggioFrequencyId: number | null categoryId: number | null price: number | null + subscriptionLevelId: number | null } export type ProclamationMaxAggregateOutputType = { @@ -54,6 +57,7 @@ export type ProclamationMaxAggregateOutputType = { solfeggioFrequencyId: number | null categoryId: number | null price: number | null + subscriptionLevelId: number | null } export type ProclamationCountAggregateOutputType = { @@ -63,6 +67,7 @@ export type ProclamationCountAggregateOutputType = { solfeggioFrequencyId: number categoryId: number price: number + subscriptionLevelId: number _all: number } @@ -71,12 +76,14 @@ export type ProclamationAvgAggregateInputType = { solfeggioFrequencyId?: true categoryId?: true price?: true + subscriptionLevelId?: true } export type ProclamationSumAggregateInputType = { solfeggioFrequencyId?: true categoryId?: true price?: true + subscriptionLevelId?: true } export type ProclamationMinAggregateInputType = { @@ -86,6 +93,7 @@ export type ProclamationMinAggregateInputType = { solfeggioFrequencyId?: true categoryId?: true price?: true + subscriptionLevelId?: true } export type ProclamationMaxAggregateInputType = { @@ -95,6 +103,7 @@ export type ProclamationMaxAggregateInputType = { solfeggioFrequencyId?: true categoryId?: true price?: true + subscriptionLevelId?: true } export type ProclamationCountAggregateInputType = { @@ -104,6 +113,7 @@ export type ProclamationCountAggregateInputType = { solfeggioFrequencyId?: true categoryId?: true price?: true + subscriptionLevelId?: true _all?: true } @@ -200,6 +210,7 @@ export type ProclamationGroupByOutputType = { solfeggioFrequencyId: number categoryId: number price: number + subscriptionLevelId: number _count: ProclamationCountAggregateOutputType | null _avg: ProclamationAvgAggregateOutputType | null _sum: ProclamationSumAggregateOutputType | null @@ -232,9 +243,11 @@ export type ProclamationWhereInput = { solfeggioFrequencyId?: Prisma.IntFilter<"Proclamation"> | number categoryId?: Prisma.IntFilter<"Proclamation"> | number price?: Prisma.FloatFilter<"Proclamation"> | number + subscriptionLevelId?: Prisma.IntFilter<"Proclamation"> | number solfeggioFrequency?: Prisma.XOR category?: Prisma.XOR userProclamations?: Prisma.UserProclamationsListRelationFilter + subscriptionLevel?: Prisma.XOR } export type ProclamationOrderByWithRelationInput = { @@ -244,9 +257,11 @@ export type ProclamationOrderByWithRelationInput = { solfeggioFrequencyId?: Prisma.SortOrder categoryId?: Prisma.SortOrder price?: Prisma.SortOrder + subscriptionLevelId?: Prisma.SortOrder solfeggioFrequency?: Prisma.SolfeggioFrequencyOrderByWithRelationInput category?: Prisma.ProclamationCategoryOrderByWithRelationInput userProclamations?: Prisma.UserProclamationsOrderByRelationAggregateInput + subscriptionLevel?: Prisma.SubscriptionLevelOrderByWithRelationInput } export type ProclamationWhereUniqueInput = Prisma.AtLeast<{ @@ -259,9 +274,11 @@ export type ProclamationWhereUniqueInput = Prisma.AtLeast<{ solfeggioFrequencyId?: Prisma.IntFilter<"Proclamation"> | number categoryId?: Prisma.IntFilter<"Proclamation"> | number price?: Prisma.FloatFilter<"Proclamation"> | number + subscriptionLevelId?: Prisma.IntFilter<"Proclamation"> | number solfeggioFrequency?: Prisma.XOR category?: Prisma.XOR userProclamations?: Prisma.UserProclamationsListRelationFilter + subscriptionLevel?: Prisma.XOR }, "id" | "name"> export type ProclamationOrderByWithAggregationInput = { @@ -271,6 +288,7 @@ export type ProclamationOrderByWithAggregationInput = { solfeggioFrequencyId?: Prisma.SortOrder categoryId?: Prisma.SortOrder price?: Prisma.SortOrder + subscriptionLevelId?: Prisma.SortOrder _count?: Prisma.ProclamationCountOrderByAggregateInput _avg?: Prisma.ProclamationAvgOrderByAggregateInput _max?: Prisma.ProclamationMaxOrderByAggregateInput @@ -288,6 +306,7 @@ export type ProclamationScalarWhereWithAggregatesInput = { solfeggioFrequencyId?: Prisma.IntWithAggregatesFilter<"Proclamation"> | number categoryId?: Prisma.IntWithAggregatesFilter<"Proclamation"> | number price?: Prisma.FloatWithAggregatesFilter<"Proclamation"> | number + subscriptionLevelId?: Prisma.IntWithAggregatesFilter<"Proclamation"> | number } export type ProclamationCreateInput = { @@ -298,6 +317,7 @@ export type ProclamationCreateInput = { solfeggioFrequency: Prisma.SolfeggioFrequencyCreateNestedOneWithoutProclamationsInput category: Prisma.ProclamationCategoryCreateNestedOneWithoutProclamationsInput userProclamations?: Prisma.UserProclamationsCreateNestedManyWithoutProclamationInput + subscriptionLevel?: Prisma.SubscriptionLevelCreateNestedOneWithoutProclamationsInput } export type ProclamationUncheckedCreateInput = { @@ -307,6 +327,7 @@ export type ProclamationUncheckedCreateInput = { solfeggioFrequencyId: number categoryId: number price?: number + subscriptionLevelId?: number userProclamations?: Prisma.UserProclamationsUncheckedCreateNestedManyWithoutProclamationInput } @@ -318,6 +339,7 @@ export type ProclamationUpdateInput = { solfeggioFrequency?: Prisma.SolfeggioFrequencyUpdateOneRequiredWithoutProclamationsNestedInput category?: Prisma.ProclamationCategoryUpdateOneRequiredWithoutProclamationsNestedInput userProclamations?: Prisma.UserProclamationsUpdateManyWithoutProclamationNestedInput + subscriptionLevel?: Prisma.SubscriptionLevelUpdateOneRequiredWithoutProclamationsNestedInput } export type ProclamationUncheckedUpdateInput = { @@ -327,6 +349,7 @@ export type ProclamationUncheckedUpdateInput = { solfeggioFrequencyId?: Prisma.IntFieldUpdateOperationsInput | number categoryId?: Prisma.IntFieldUpdateOperationsInput | number price?: Prisma.FloatFieldUpdateOperationsInput | number + subscriptionLevelId?: Prisma.IntFieldUpdateOperationsInput | number userProclamations?: Prisma.UserProclamationsUncheckedUpdateManyWithoutProclamationNestedInput } @@ -337,6 +360,7 @@ export type ProclamationCreateManyInput = { solfeggioFrequencyId: number categoryId: number price?: number + subscriptionLevelId?: number } export type ProclamationUpdateManyMutationInput = { @@ -353,6 +377,7 @@ export type ProclamationUncheckedUpdateManyInput = { solfeggioFrequencyId?: Prisma.IntFieldUpdateOperationsInput | number categoryId?: Prisma.IntFieldUpdateOperationsInput | number price?: Prisma.FloatFieldUpdateOperationsInput | number + subscriptionLevelId?: Prisma.IntFieldUpdateOperationsInput | number } export type ProclamationCountOrderByAggregateInput = { @@ -362,12 +387,14 @@ export type ProclamationCountOrderByAggregateInput = { solfeggioFrequencyId?: Prisma.SortOrder categoryId?: Prisma.SortOrder price?: Prisma.SortOrder + subscriptionLevelId?: Prisma.SortOrder } export type ProclamationAvgOrderByAggregateInput = { solfeggioFrequencyId?: Prisma.SortOrder categoryId?: Prisma.SortOrder price?: Prisma.SortOrder + subscriptionLevelId?: Prisma.SortOrder } export type ProclamationMaxOrderByAggregateInput = { @@ -377,6 +404,7 @@ export type ProclamationMaxOrderByAggregateInput = { solfeggioFrequencyId?: Prisma.SortOrder categoryId?: Prisma.SortOrder price?: Prisma.SortOrder + subscriptionLevelId?: Prisma.SortOrder } export type ProclamationMinOrderByAggregateInput = { @@ -386,12 +414,14 @@ export type ProclamationMinOrderByAggregateInput = { solfeggioFrequencyId?: Prisma.SortOrder categoryId?: Prisma.SortOrder price?: Prisma.SortOrder + subscriptionLevelId?: Prisma.SortOrder } export type ProclamationSumOrderByAggregateInput = { solfeggioFrequencyId?: Prisma.SortOrder categoryId?: Prisma.SortOrder price?: Prisma.SortOrder + subscriptionLevelId?: Prisma.SortOrder } export type ProclamationScalarRelationFilter = { @@ -515,6 +545,48 @@ export type ProclamationUncheckedUpdateManyWithoutCategoryNestedInput = { deleteMany?: Prisma.ProclamationScalarWhereInput | Prisma.ProclamationScalarWhereInput[] } +export type ProclamationCreateNestedManyWithoutSubscriptionLevelInput = { + create?: Prisma.XOR | Prisma.ProclamationCreateWithoutSubscriptionLevelInput[] | Prisma.ProclamationUncheckedCreateWithoutSubscriptionLevelInput[] + connectOrCreate?: Prisma.ProclamationCreateOrConnectWithoutSubscriptionLevelInput | Prisma.ProclamationCreateOrConnectWithoutSubscriptionLevelInput[] + createMany?: Prisma.ProclamationCreateManySubscriptionLevelInputEnvelope + connect?: Prisma.ProclamationWhereUniqueInput | Prisma.ProclamationWhereUniqueInput[] +} + +export type ProclamationUncheckedCreateNestedManyWithoutSubscriptionLevelInput = { + create?: Prisma.XOR | Prisma.ProclamationCreateWithoutSubscriptionLevelInput[] | Prisma.ProclamationUncheckedCreateWithoutSubscriptionLevelInput[] + connectOrCreate?: Prisma.ProclamationCreateOrConnectWithoutSubscriptionLevelInput | Prisma.ProclamationCreateOrConnectWithoutSubscriptionLevelInput[] + createMany?: Prisma.ProclamationCreateManySubscriptionLevelInputEnvelope + connect?: Prisma.ProclamationWhereUniqueInput | Prisma.ProclamationWhereUniqueInput[] +} + +export type ProclamationUpdateManyWithoutSubscriptionLevelNestedInput = { + create?: Prisma.XOR | Prisma.ProclamationCreateWithoutSubscriptionLevelInput[] | Prisma.ProclamationUncheckedCreateWithoutSubscriptionLevelInput[] + connectOrCreate?: Prisma.ProclamationCreateOrConnectWithoutSubscriptionLevelInput | Prisma.ProclamationCreateOrConnectWithoutSubscriptionLevelInput[] + upsert?: Prisma.ProclamationUpsertWithWhereUniqueWithoutSubscriptionLevelInput | Prisma.ProclamationUpsertWithWhereUniqueWithoutSubscriptionLevelInput[] + createMany?: Prisma.ProclamationCreateManySubscriptionLevelInputEnvelope + set?: Prisma.ProclamationWhereUniqueInput | Prisma.ProclamationWhereUniqueInput[] + disconnect?: Prisma.ProclamationWhereUniqueInput | Prisma.ProclamationWhereUniqueInput[] + delete?: Prisma.ProclamationWhereUniqueInput | Prisma.ProclamationWhereUniqueInput[] + connect?: Prisma.ProclamationWhereUniqueInput | Prisma.ProclamationWhereUniqueInput[] + update?: Prisma.ProclamationUpdateWithWhereUniqueWithoutSubscriptionLevelInput | Prisma.ProclamationUpdateWithWhereUniqueWithoutSubscriptionLevelInput[] + updateMany?: Prisma.ProclamationUpdateManyWithWhereWithoutSubscriptionLevelInput | Prisma.ProclamationUpdateManyWithWhereWithoutSubscriptionLevelInput[] + deleteMany?: Prisma.ProclamationScalarWhereInput | Prisma.ProclamationScalarWhereInput[] +} + +export type ProclamationUncheckedUpdateManyWithoutSubscriptionLevelNestedInput = { + create?: Prisma.XOR | Prisma.ProclamationCreateWithoutSubscriptionLevelInput[] | Prisma.ProclamationUncheckedCreateWithoutSubscriptionLevelInput[] + connectOrCreate?: Prisma.ProclamationCreateOrConnectWithoutSubscriptionLevelInput | Prisma.ProclamationCreateOrConnectWithoutSubscriptionLevelInput[] + upsert?: Prisma.ProclamationUpsertWithWhereUniqueWithoutSubscriptionLevelInput | Prisma.ProclamationUpsertWithWhereUniqueWithoutSubscriptionLevelInput[] + createMany?: Prisma.ProclamationCreateManySubscriptionLevelInputEnvelope + set?: Prisma.ProclamationWhereUniqueInput | Prisma.ProclamationWhereUniqueInput[] + disconnect?: Prisma.ProclamationWhereUniqueInput | Prisma.ProclamationWhereUniqueInput[] + delete?: Prisma.ProclamationWhereUniqueInput | Prisma.ProclamationWhereUniqueInput[] + connect?: Prisma.ProclamationWhereUniqueInput | Prisma.ProclamationWhereUniqueInput[] + update?: Prisma.ProclamationUpdateWithWhereUniqueWithoutSubscriptionLevelInput | Prisma.ProclamationUpdateWithWhereUniqueWithoutSubscriptionLevelInput[] + updateMany?: Prisma.ProclamationUpdateManyWithWhereWithoutSubscriptionLevelInput | Prisma.ProclamationUpdateManyWithWhereWithoutSubscriptionLevelInput[] + deleteMany?: Prisma.ProclamationScalarWhereInput | Prisma.ProclamationScalarWhereInput[] +} + export type ProclamationCreateWithoutUserProclamationsInput = { id?: string name: string @@ -522,6 +594,7 @@ export type ProclamationCreateWithoutUserProclamationsInput = { price?: number solfeggioFrequency: Prisma.SolfeggioFrequencyCreateNestedOneWithoutProclamationsInput category: Prisma.ProclamationCategoryCreateNestedOneWithoutProclamationsInput + subscriptionLevel?: Prisma.SubscriptionLevelCreateNestedOneWithoutProclamationsInput } export type ProclamationUncheckedCreateWithoutUserProclamationsInput = { @@ -531,6 +604,7 @@ export type ProclamationUncheckedCreateWithoutUserProclamationsInput = { solfeggioFrequencyId: number categoryId: number price?: number + subscriptionLevelId?: number } export type ProclamationCreateOrConnectWithoutUserProclamationsInput = { @@ -556,6 +630,7 @@ export type ProclamationUpdateWithoutUserProclamationsInput = { price?: Prisma.FloatFieldUpdateOperationsInput | number solfeggioFrequency?: Prisma.SolfeggioFrequencyUpdateOneRequiredWithoutProclamationsNestedInput category?: Prisma.ProclamationCategoryUpdateOneRequiredWithoutProclamationsNestedInput + subscriptionLevel?: Prisma.SubscriptionLevelUpdateOneRequiredWithoutProclamationsNestedInput } export type ProclamationUncheckedUpdateWithoutUserProclamationsInput = { @@ -565,6 +640,7 @@ export type ProclamationUncheckedUpdateWithoutUserProclamationsInput = { solfeggioFrequencyId?: Prisma.IntFieldUpdateOperationsInput | number categoryId?: Prisma.IntFieldUpdateOperationsInput | number price?: Prisma.FloatFieldUpdateOperationsInput | number + subscriptionLevelId?: Prisma.IntFieldUpdateOperationsInput | number } export type ProclamationCreateWithoutSolfeggioFrequencyInput = { @@ -574,6 +650,7 @@ export type ProclamationCreateWithoutSolfeggioFrequencyInput = { price?: number category: Prisma.ProclamationCategoryCreateNestedOneWithoutProclamationsInput userProclamations?: Prisma.UserProclamationsCreateNestedManyWithoutProclamationInput + subscriptionLevel?: Prisma.SubscriptionLevelCreateNestedOneWithoutProclamationsInput } export type ProclamationUncheckedCreateWithoutSolfeggioFrequencyInput = { @@ -582,6 +659,7 @@ export type ProclamationUncheckedCreateWithoutSolfeggioFrequencyInput = { content: string categoryId: number price?: number + subscriptionLevelId?: number userProclamations?: Prisma.UserProclamationsUncheckedCreateNestedManyWithoutProclamationInput } @@ -621,6 +699,7 @@ export type ProclamationScalarWhereInput = { solfeggioFrequencyId?: Prisma.IntFilter<"Proclamation"> | number categoryId?: Prisma.IntFilter<"Proclamation"> | number price?: Prisma.FloatFilter<"Proclamation"> | number + subscriptionLevelId?: Prisma.IntFilter<"Proclamation"> | number } export type ProclamationCreateWithoutCategoryInput = { @@ -630,6 +709,7 @@ export type ProclamationCreateWithoutCategoryInput = { price?: number solfeggioFrequency: Prisma.SolfeggioFrequencyCreateNestedOneWithoutProclamationsInput userProclamations?: Prisma.UserProclamationsCreateNestedManyWithoutProclamationInput + subscriptionLevel?: Prisma.SubscriptionLevelCreateNestedOneWithoutProclamationsInput } export type ProclamationUncheckedCreateWithoutCategoryInput = { @@ -638,6 +718,7 @@ export type ProclamationUncheckedCreateWithoutCategoryInput = { content: string solfeggioFrequencyId: number price?: number + subscriptionLevelId?: number userProclamations?: Prisma.UserProclamationsUncheckedCreateNestedManyWithoutProclamationInput } @@ -667,12 +748,59 @@ export type ProclamationUpdateManyWithWhereWithoutCategoryInput = { data: Prisma.XOR } +export type ProclamationCreateWithoutSubscriptionLevelInput = { + id?: string + name: string + content: string + price?: number + solfeggioFrequency: Prisma.SolfeggioFrequencyCreateNestedOneWithoutProclamationsInput + category: Prisma.ProclamationCategoryCreateNestedOneWithoutProclamationsInput + userProclamations?: Prisma.UserProclamationsCreateNestedManyWithoutProclamationInput +} + +export type ProclamationUncheckedCreateWithoutSubscriptionLevelInput = { + id?: string + name: string + content: string + solfeggioFrequencyId: number + categoryId: number + price?: number + userProclamations?: Prisma.UserProclamationsUncheckedCreateNestedManyWithoutProclamationInput +} + +export type ProclamationCreateOrConnectWithoutSubscriptionLevelInput = { + where: Prisma.ProclamationWhereUniqueInput + create: Prisma.XOR +} + +export type ProclamationCreateManySubscriptionLevelInputEnvelope = { + data: Prisma.ProclamationCreateManySubscriptionLevelInput | Prisma.ProclamationCreateManySubscriptionLevelInput[] + skipDuplicates?: boolean +} + +export type ProclamationUpsertWithWhereUniqueWithoutSubscriptionLevelInput = { + where: Prisma.ProclamationWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type ProclamationUpdateWithWhereUniqueWithoutSubscriptionLevelInput = { + where: Prisma.ProclamationWhereUniqueInput + data: Prisma.XOR +} + +export type ProclamationUpdateManyWithWhereWithoutSubscriptionLevelInput = { + where: Prisma.ProclamationScalarWhereInput + data: Prisma.XOR +} + export type ProclamationCreateManySolfeggioFrequencyInput = { id?: string name: string content: string categoryId: number price?: number + subscriptionLevelId?: number } export type ProclamationUpdateWithoutSolfeggioFrequencyInput = { @@ -682,6 +810,7 @@ export type ProclamationUpdateWithoutSolfeggioFrequencyInput = { price?: Prisma.FloatFieldUpdateOperationsInput | number category?: Prisma.ProclamationCategoryUpdateOneRequiredWithoutProclamationsNestedInput userProclamations?: Prisma.UserProclamationsUpdateManyWithoutProclamationNestedInput + subscriptionLevel?: Prisma.SubscriptionLevelUpdateOneRequiredWithoutProclamationsNestedInput } export type ProclamationUncheckedUpdateWithoutSolfeggioFrequencyInput = { @@ -690,6 +819,7 @@ export type ProclamationUncheckedUpdateWithoutSolfeggioFrequencyInput = { content?: Prisma.StringFieldUpdateOperationsInput | string categoryId?: Prisma.IntFieldUpdateOperationsInput | number price?: Prisma.FloatFieldUpdateOperationsInput | number + subscriptionLevelId?: Prisma.IntFieldUpdateOperationsInput | number userProclamations?: Prisma.UserProclamationsUncheckedUpdateManyWithoutProclamationNestedInput } @@ -699,6 +829,7 @@ export type ProclamationUncheckedUpdateManyWithoutSolfeggioFrequencyInput = { content?: Prisma.StringFieldUpdateOperationsInput | string categoryId?: Prisma.IntFieldUpdateOperationsInput | number price?: Prisma.FloatFieldUpdateOperationsInput | number + subscriptionLevelId?: Prisma.IntFieldUpdateOperationsInput | number } export type ProclamationCreateManyCategoryInput = { @@ -707,6 +838,7 @@ export type ProclamationCreateManyCategoryInput = { content: string solfeggioFrequencyId: number price?: number + subscriptionLevelId?: number } export type ProclamationUpdateWithoutCategoryInput = { @@ -716,6 +848,7 @@ export type ProclamationUpdateWithoutCategoryInput = { price?: Prisma.FloatFieldUpdateOperationsInput | number solfeggioFrequency?: Prisma.SolfeggioFrequencyUpdateOneRequiredWithoutProclamationsNestedInput userProclamations?: Prisma.UserProclamationsUpdateManyWithoutProclamationNestedInput + subscriptionLevel?: Prisma.SubscriptionLevelUpdateOneRequiredWithoutProclamationsNestedInput } export type ProclamationUncheckedUpdateWithoutCategoryInput = { @@ -724,6 +857,7 @@ export type ProclamationUncheckedUpdateWithoutCategoryInput = { content?: Prisma.StringFieldUpdateOperationsInput | string solfeggioFrequencyId?: Prisma.IntFieldUpdateOperationsInput | number price?: Prisma.FloatFieldUpdateOperationsInput | number + subscriptionLevelId?: Prisma.IntFieldUpdateOperationsInput | number userProclamations?: Prisma.UserProclamationsUncheckedUpdateManyWithoutProclamationNestedInput } @@ -733,6 +867,45 @@ export type ProclamationUncheckedUpdateManyWithoutCategoryInput = { content?: Prisma.StringFieldUpdateOperationsInput | string solfeggioFrequencyId?: Prisma.IntFieldUpdateOperationsInput | number price?: Prisma.FloatFieldUpdateOperationsInput | number + subscriptionLevelId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type ProclamationCreateManySubscriptionLevelInput = { + id?: string + name: string + content: string + solfeggioFrequencyId: number + categoryId: number + price?: number +} + +export type ProclamationUpdateWithoutSubscriptionLevelInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.StringFieldUpdateOperationsInput | string + price?: Prisma.FloatFieldUpdateOperationsInput | number + solfeggioFrequency?: Prisma.SolfeggioFrequencyUpdateOneRequiredWithoutProclamationsNestedInput + category?: Prisma.ProclamationCategoryUpdateOneRequiredWithoutProclamationsNestedInput + userProclamations?: Prisma.UserProclamationsUpdateManyWithoutProclamationNestedInput +} + +export type ProclamationUncheckedUpdateWithoutSubscriptionLevelInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.StringFieldUpdateOperationsInput | string + solfeggioFrequencyId?: Prisma.IntFieldUpdateOperationsInput | number + categoryId?: Prisma.IntFieldUpdateOperationsInput | number + price?: Prisma.FloatFieldUpdateOperationsInput | number + userProclamations?: Prisma.UserProclamationsUncheckedUpdateManyWithoutProclamationNestedInput +} + +export type ProclamationUncheckedUpdateManyWithoutSubscriptionLevelInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.StringFieldUpdateOperationsInput | string + solfeggioFrequencyId?: Prisma.IntFieldUpdateOperationsInput | number + categoryId?: Prisma.IntFieldUpdateOperationsInput | number + price?: Prisma.FloatFieldUpdateOperationsInput | number } @@ -773,9 +946,11 @@ export type ProclamationSelect category?: boolean | Prisma.ProclamationCategoryDefaultArgs userProclamations?: boolean | Prisma.Proclamation$userProclamationsArgs + subscriptionLevel?: boolean | Prisma.SubscriptionLevelDefaultArgs _count?: boolean | Prisma.ProclamationCountOutputTypeDefaultArgs }, ExtArgs["result"]["proclamation"]> @@ -786,8 +961,10 @@ export type ProclamationSelectCreateManyAndReturn category?: boolean | Prisma.ProclamationCategoryDefaultArgs + subscriptionLevel?: boolean | Prisma.SubscriptionLevelDefaultArgs }, ExtArgs["result"]["proclamation"]> export type ProclamationSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ @@ -797,8 +974,10 @@ export type ProclamationSelectUpdateManyAndReturn category?: boolean | Prisma.ProclamationCategoryDefaultArgs + subscriptionLevel?: boolean | Prisma.SubscriptionLevelDefaultArgs }, ExtArgs["result"]["proclamation"]> export type ProclamationSelectScalar = { @@ -808,22 +987,26 @@ export type ProclamationSelectScalar = { solfeggioFrequencyId?: boolean categoryId?: boolean price?: boolean + subscriptionLevelId?: boolean } -export type ProclamationOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "content" | "solfeggioFrequencyId" | "categoryId" | "price", ExtArgs["result"]["proclamation"]> +export type ProclamationOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "content" | "solfeggioFrequencyId" | "categoryId" | "price" | "subscriptionLevelId", ExtArgs["result"]["proclamation"]> export type ProclamationInclude = { solfeggioFrequency?: boolean | Prisma.SolfeggioFrequencyDefaultArgs category?: boolean | Prisma.ProclamationCategoryDefaultArgs userProclamations?: boolean | Prisma.Proclamation$userProclamationsArgs + subscriptionLevel?: boolean | Prisma.SubscriptionLevelDefaultArgs _count?: boolean | Prisma.ProclamationCountOutputTypeDefaultArgs } export type ProclamationIncludeCreateManyAndReturn = { solfeggioFrequency?: boolean | Prisma.SolfeggioFrequencyDefaultArgs category?: boolean | Prisma.ProclamationCategoryDefaultArgs + subscriptionLevel?: boolean | Prisma.SubscriptionLevelDefaultArgs } export type ProclamationIncludeUpdateManyAndReturn = { solfeggioFrequency?: boolean | Prisma.SolfeggioFrequencyDefaultArgs category?: boolean | Prisma.ProclamationCategoryDefaultArgs + subscriptionLevel?: boolean | Prisma.SubscriptionLevelDefaultArgs } export type $ProclamationPayload = { @@ -832,6 +1015,7 @@ export type $ProclamationPayload category: Prisma.$ProclamationCategoryPayload userProclamations: Prisma.$UserProclamationsPayload[] + subscriptionLevel: Prisma.$SubscriptionLevelPayload } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: string @@ -840,6 +1024,7 @@ export type $ProclamationPayload composites: {} } @@ -1237,6 +1422,7 @@ export interface Prisma__ProclamationClient = {}>(args?: Prisma.Subset>): Prisma.Prisma__SolfeggioFrequencyClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> category = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProclamationCategoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> userProclamations = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + subscriptionLevel = {}>(args?: Prisma.Subset>): Prisma.Prisma__SubscriptionLevelClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -1272,6 +1458,7 @@ export interface ProclamationFieldRefs { readonly solfeggioFrequencyId: Prisma.FieldRef<"Proclamation", 'Int'> readonly categoryId: Prisma.FieldRef<"Proclamation", 'Int'> readonly price: Prisma.FieldRef<"Proclamation", 'Float'> + readonly subscriptionLevelId: Prisma.FieldRef<"Proclamation", 'Int'> } diff --git a/src/lib/generated/prisma/models/SubscriptionLevel.ts b/src/lib/generated/prisma/models/SubscriptionLevel.ts new file mode 100644 index 0000000..fc4f014 --- /dev/null +++ b/src/lib/generated/prisma/models/SubscriptionLevel.ts @@ -0,0 +1,1297 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `SubscriptionLevel` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.ts" +import type * as Prisma from "../internal/prismaNamespace.ts" + +/** + * Model SubscriptionLevel + * + */ +export type SubscriptionLevelModel = runtime.Types.Result.DefaultSelection + +export type AggregateSubscriptionLevel = { + _count: SubscriptionLevelCountAggregateOutputType | null + _avg: SubscriptionLevelAvgAggregateOutputType | null + _sum: SubscriptionLevelSumAggregateOutputType | null + _min: SubscriptionLevelMinAggregateOutputType | null + _max: SubscriptionLevelMaxAggregateOutputType | null +} + +export type SubscriptionLevelAvgAggregateOutputType = { + id: number | null +} + +export type SubscriptionLevelSumAggregateOutputType = { + id: number | null +} + +export type SubscriptionLevelMinAggregateOutputType = { + id: number | null + name: string | null + description: string | null +} + +export type SubscriptionLevelMaxAggregateOutputType = { + id: number | null + name: string | null + description: string | null +} + +export type SubscriptionLevelCountAggregateOutputType = { + id: number + name: number + description: number + _all: number +} + + +export type SubscriptionLevelAvgAggregateInputType = { + id?: true +} + +export type SubscriptionLevelSumAggregateInputType = { + id?: true +} + +export type SubscriptionLevelMinAggregateInputType = { + id?: true + name?: true + description?: true +} + +export type SubscriptionLevelMaxAggregateInputType = { + id?: true + name?: true + description?: true +} + +export type SubscriptionLevelCountAggregateInputType = { + id?: true + name?: true + description?: true + _all?: true +} + +export type SubscriptionLevelAggregateArgs = { + /** + * Filter which SubscriptionLevel to aggregate. + */ + where?: Prisma.SubscriptionLevelWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SubscriptionLevels to fetch. + */ + orderBy?: Prisma.SubscriptionLevelOrderByWithRelationInput | Prisma.SubscriptionLevelOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.SubscriptionLevelWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SubscriptionLevels from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` SubscriptionLevels. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned SubscriptionLevels + **/ + _count?: true | SubscriptionLevelCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: SubscriptionLevelAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: SubscriptionLevelSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: SubscriptionLevelMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: SubscriptionLevelMaxAggregateInputType +} + +export type GetSubscriptionLevelAggregateType = { + [P in keyof T & keyof AggregateSubscriptionLevel]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type SubscriptionLevelGroupByArgs = { + where?: Prisma.SubscriptionLevelWhereInput + orderBy?: Prisma.SubscriptionLevelOrderByWithAggregationInput | Prisma.SubscriptionLevelOrderByWithAggregationInput[] + by: Prisma.SubscriptionLevelScalarFieldEnum[] | Prisma.SubscriptionLevelScalarFieldEnum + having?: Prisma.SubscriptionLevelScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: SubscriptionLevelCountAggregateInputType | true + _avg?: SubscriptionLevelAvgAggregateInputType + _sum?: SubscriptionLevelSumAggregateInputType + _min?: SubscriptionLevelMinAggregateInputType + _max?: SubscriptionLevelMaxAggregateInputType +} + +export type SubscriptionLevelGroupByOutputType = { + id: number + name: string + description: string | null + _count: SubscriptionLevelCountAggregateOutputType | null + _avg: SubscriptionLevelAvgAggregateOutputType | null + _sum: SubscriptionLevelSumAggregateOutputType | null + _min: SubscriptionLevelMinAggregateOutputType | null + _max: SubscriptionLevelMaxAggregateOutputType | null +} + +type GetSubscriptionLevelGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof SubscriptionLevelGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type SubscriptionLevelWhereInput = { + AND?: Prisma.SubscriptionLevelWhereInput | Prisma.SubscriptionLevelWhereInput[] + OR?: Prisma.SubscriptionLevelWhereInput[] + NOT?: Prisma.SubscriptionLevelWhereInput | Prisma.SubscriptionLevelWhereInput[] + id?: Prisma.IntFilter<"SubscriptionLevel"> | number + name?: Prisma.StringFilter<"SubscriptionLevel"> | string + description?: Prisma.StringNullableFilter<"SubscriptionLevel"> | string | null + proclamations?: Prisma.ProclamationListRelationFilter +} + +export type SubscriptionLevelOrderByWithRelationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + description?: Prisma.SortOrderInput | Prisma.SortOrder + proclamations?: Prisma.ProclamationOrderByRelationAggregateInput +} + +export type SubscriptionLevelWhereUniqueInput = Prisma.AtLeast<{ + id?: number + AND?: Prisma.SubscriptionLevelWhereInput | Prisma.SubscriptionLevelWhereInput[] + OR?: Prisma.SubscriptionLevelWhereInput[] + NOT?: Prisma.SubscriptionLevelWhereInput | Prisma.SubscriptionLevelWhereInput[] + name?: Prisma.StringFilter<"SubscriptionLevel"> | string + description?: Prisma.StringNullableFilter<"SubscriptionLevel"> | string | null + proclamations?: Prisma.ProclamationListRelationFilter +}, "id"> + +export type SubscriptionLevelOrderByWithAggregationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + description?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.SubscriptionLevelCountOrderByAggregateInput + _avg?: Prisma.SubscriptionLevelAvgOrderByAggregateInput + _max?: Prisma.SubscriptionLevelMaxOrderByAggregateInput + _min?: Prisma.SubscriptionLevelMinOrderByAggregateInput + _sum?: Prisma.SubscriptionLevelSumOrderByAggregateInput +} + +export type SubscriptionLevelScalarWhereWithAggregatesInput = { + AND?: Prisma.SubscriptionLevelScalarWhereWithAggregatesInput | Prisma.SubscriptionLevelScalarWhereWithAggregatesInput[] + OR?: Prisma.SubscriptionLevelScalarWhereWithAggregatesInput[] + NOT?: Prisma.SubscriptionLevelScalarWhereWithAggregatesInput | Prisma.SubscriptionLevelScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"SubscriptionLevel"> | number + name?: Prisma.StringWithAggregatesFilter<"SubscriptionLevel"> | string + description?: Prisma.StringNullableWithAggregatesFilter<"SubscriptionLevel"> | string | null +} + +export type SubscriptionLevelCreateInput = { + name: string + description?: string | null + proclamations?: Prisma.ProclamationCreateNestedManyWithoutSubscriptionLevelInput +} + +export type SubscriptionLevelUncheckedCreateInput = { + id?: number + name: string + description?: string | null + proclamations?: Prisma.ProclamationUncheckedCreateNestedManyWithoutSubscriptionLevelInput +} + +export type SubscriptionLevelUpdateInput = { + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + proclamations?: Prisma.ProclamationUpdateManyWithoutSubscriptionLevelNestedInput +} + +export type SubscriptionLevelUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + proclamations?: Prisma.ProclamationUncheckedUpdateManyWithoutSubscriptionLevelNestedInput +} + +export type SubscriptionLevelCreateManyInput = { + id?: number + name: string + description?: string | null +} + +export type SubscriptionLevelUpdateManyMutationInput = { + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type SubscriptionLevelUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type SubscriptionLevelScalarRelationFilter = { + is?: Prisma.SubscriptionLevelWhereInput + isNot?: Prisma.SubscriptionLevelWhereInput +} + +export type SubscriptionLevelCountOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + description?: Prisma.SortOrder +} + +export type SubscriptionLevelAvgOrderByAggregateInput = { + id?: Prisma.SortOrder +} + +export type SubscriptionLevelMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + description?: Prisma.SortOrder +} + +export type SubscriptionLevelMinOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + description?: Prisma.SortOrder +} + +export type SubscriptionLevelSumOrderByAggregateInput = { + id?: Prisma.SortOrder +} + +export type SubscriptionLevelCreateNestedOneWithoutProclamationsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SubscriptionLevelCreateOrConnectWithoutProclamationsInput + connect?: Prisma.SubscriptionLevelWhereUniqueInput +} + +export type SubscriptionLevelUpdateOneRequiredWithoutProclamationsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SubscriptionLevelCreateOrConnectWithoutProclamationsInput + upsert?: Prisma.SubscriptionLevelUpsertWithoutProclamationsInput + connect?: Prisma.SubscriptionLevelWhereUniqueInput + update?: Prisma.XOR, Prisma.SubscriptionLevelUncheckedUpdateWithoutProclamationsInput> +} + +export type SubscriptionLevelCreateWithoutProclamationsInput = { + name: string + description?: string | null +} + +export type SubscriptionLevelUncheckedCreateWithoutProclamationsInput = { + id?: number + name: string + description?: string | null +} + +export type SubscriptionLevelCreateOrConnectWithoutProclamationsInput = { + where: Prisma.SubscriptionLevelWhereUniqueInput + create: Prisma.XOR +} + +export type SubscriptionLevelUpsertWithoutProclamationsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.SubscriptionLevelWhereInput +} + +export type SubscriptionLevelUpdateToOneWithWhereWithoutProclamationsInput = { + where?: Prisma.SubscriptionLevelWhereInput + data: Prisma.XOR +} + +export type SubscriptionLevelUpdateWithoutProclamationsInput = { + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type SubscriptionLevelUncheckedUpdateWithoutProclamationsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + + +/** + * Count Type SubscriptionLevelCountOutputType + */ + +export type SubscriptionLevelCountOutputType = { + proclamations: number +} + +export type SubscriptionLevelCountOutputTypeSelect = { + proclamations?: boolean | SubscriptionLevelCountOutputTypeCountProclamationsArgs +} + +/** + * SubscriptionLevelCountOutputType without action + */ +export type SubscriptionLevelCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the SubscriptionLevelCountOutputType + */ + select?: Prisma.SubscriptionLevelCountOutputTypeSelect | null +} + +/** + * SubscriptionLevelCountOutputType without action + */ +export type SubscriptionLevelCountOutputTypeCountProclamationsArgs = { + where?: Prisma.ProclamationWhereInput +} + + +export type SubscriptionLevelSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + description?: boolean + proclamations?: boolean | Prisma.SubscriptionLevel$proclamationsArgs + _count?: boolean | Prisma.SubscriptionLevelCountOutputTypeDefaultArgs +}, ExtArgs["result"]["subscriptionLevel"]> + +export type SubscriptionLevelSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + description?: boolean +}, ExtArgs["result"]["subscriptionLevel"]> + +export type SubscriptionLevelSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + description?: boolean +}, ExtArgs["result"]["subscriptionLevel"]> + +export type SubscriptionLevelSelectScalar = { + id?: boolean + name?: boolean + description?: boolean +} + +export type SubscriptionLevelOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description", ExtArgs["result"]["subscriptionLevel"]> +export type SubscriptionLevelInclude = { + proclamations?: boolean | Prisma.SubscriptionLevel$proclamationsArgs + _count?: boolean | Prisma.SubscriptionLevelCountOutputTypeDefaultArgs +} +export type SubscriptionLevelIncludeCreateManyAndReturn = {} +export type SubscriptionLevelIncludeUpdateManyAndReturn = {} + +export type $SubscriptionLevelPayload = { + name: "SubscriptionLevel" + objects: { + proclamations: Prisma.$ProclamationPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + name: string + description: string | null + }, ExtArgs["result"]["subscriptionLevel"]> + composites: {} +} + +export type SubscriptionLevelGetPayload = runtime.Types.Result.GetResult + +export type SubscriptionLevelCountArgs = + Omit & { + select?: SubscriptionLevelCountAggregateInputType | true + } + +export interface SubscriptionLevelDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['SubscriptionLevel'], meta: { name: 'SubscriptionLevel' } } + /** + * Find zero or one SubscriptionLevel that matches the filter. + * @param {SubscriptionLevelFindUniqueArgs} args - Arguments to find a SubscriptionLevel + * @example + * // Get one SubscriptionLevel + * const subscriptionLevel = await prisma.subscriptionLevel.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__SubscriptionLevelClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one SubscriptionLevel that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {SubscriptionLevelFindUniqueOrThrowArgs} args - Arguments to find a SubscriptionLevel + * @example + * // Get one SubscriptionLevel + * const subscriptionLevel = await prisma.subscriptionLevel.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__SubscriptionLevelClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first SubscriptionLevel that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SubscriptionLevelFindFirstArgs} args - Arguments to find a SubscriptionLevel + * @example + * // Get one SubscriptionLevel + * const subscriptionLevel = await prisma.subscriptionLevel.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__SubscriptionLevelClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first SubscriptionLevel that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SubscriptionLevelFindFirstOrThrowArgs} args - Arguments to find a SubscriptionLevel + * @example + * // Get one SubscriptionLevel + * const subscriptionLevel = await prisma.subscriptionLevel.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__SubscriptionLevelClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more SubscriptionLevels that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SubscriptionLevelFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all SubscriptionLevels + * const subscriptionLevels = await prisma.subscriptionLevel.findMany() + * + * // Get first 10 SubscriptionLevels + * const subscriptionLevels = await prisma.subscriptionLevel.findMany({ take: 10 }) + * + * // Only select the `id` + * const subscriptionLevelWithIdOnly = await prisma.subscriptionLevel.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a SubscriptionLevel. + * @param {SubscriptionLevelCreateArgs} args - Arguments to create a SubscriptionLevel. + * @example + * // Create one SubscriptionLevel + * const SubscriptionLevel = await prisma.subscriptionLevel.create({ + * data: { + * // ... data to create a SubscriptionLevel + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__SubscriptionLevelClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many SubscriptionLevels. + * @param {SubscriptionLevelCreateManyArgs} args - Arguments to create many SubscriptionLevels. + * @example + * // Create many SubscriptionLevels + * const subscriptionLevel = await prisma.subscriptionLevel.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many SubscriptionLevels and returns the data saved in the database. + * @param {SubscriptionLevelCreateManyAndReturnArgs} args - Arguments to create many SubscriptionLevels. + * @example + * // Create many SubscriptionLevels + * const subscriptionLevel = await prisma.subscriptionLevel.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many SubscriptionLevels and only return the `id` + * const subscriptionLevelWithIdOnly = await prisma.subscriptionLevel.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a SubscriptionLevel. + * @param {SubscriptionLevelDeleteArgs} args - Arguments to delete one SubscriptionLevel. + * @example + * // Delete one SubscriptionLevel + * const SubscriptionLevel = await prisma.subscriptionLevel.delete({ + * where: { + * // ... filter to delete one SubscriptionLevel + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__SubscriptionLevelClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one SubscriptionLevel. + * @param {SubscriptionLevelUpdateArgs} args - Arguments to update one SubscriptionLevel. + * @example + * // Update one SubscriptionLevel + * const subscriptionLevel = await prisma.subscriptionLevel.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__SubscriptionLevelClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more SubscriptionLevels. + * @param {SubscriptionLevelDeleteManyArgs} args - Arguments to filter SubscriptionLevels to delete. + * @example + * // Delete a few SubscriptionLevels + * const { count } = await prisma.subscriptionLevel.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more SubscriptionLevels. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SubscriptionLevelUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many SubscriptionLevels + * const subscriptionLevel = await prisma.subscriptionLevel.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more SubscriptionLevels and returns the data updated in the database. + * @param {SubscriptionLevelUpdateManyAndReturnArgs} args - Arguments to update many SubscriptionLevels. + * @example + * // Update many SubscriptionLevels + * const subscriptionLevel = await prisma.subscriptionLevel.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more SubscriptionLevels and only return the `id` + * const subscriptionLevelWithIdOnly = await prisma.subscriptionLevel.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one SubscriptionLevel. + * @param {SubscriptionLevelUpsertArgs} args - Arguments to update or create a SubscriptionLevel. + * @example + * // Update or create a SubscriptionLevel + * const subscriptionLevel = await prisma.subscriptionLevel.upsert({ + * create: { + * // ... data to create a SubscriptionLevel + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the SubscriptionLevel we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__SubscriptionLevelClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of SubscriptionLevels. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SubscriptionLevelCountArgs} args - Arguments to filter SubscriptionLevels to count. + * @example + * // Count the number of SubscriptionLevels + * const count = await prisma.subscriptionLevel.count({ + * where: { + * // ... the filter for the SubscriptionLevels we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a SubscriptionLevel. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SubscriptionLevelAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by SubscriptionLevel. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SubscriptionLevelGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends SubscriptionLevelGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: SubscriptionLevelGroupByArgs['orderBy'] } + : { orderBy?: SubscriptionLevelGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetSubscriptionLevelGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the SubscriptionLevel model + */ +readonly fields: SubscriptionLevelFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for SubscriptionLevel. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__SubscriptionLevelClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + proclamations = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the SubscriptionLevel model + */ +export interface SubscriptionLevelFieldRefs { + readonly id: Prisma.FieldRef<"SubscriptionLevel", 'Int'> + readonly name: Prisma.FieldRef<"SubscriptionLevel", 'String'> + readonly description: Prisma.FieldRef<"SubscriptionLevel", 'String'> +} + + +// Custom InputTypes +/** + * SubscriptionLevel findUnique + */ +export type SubscriptionLevelFindUniqueArgs = { + /** + * Select specific fields to fetch from the SubscriptionLevel + */ + select?: Prisma.SubscriptionLevelSelect | null + /** + * Omit specific fields from the SubscriptionLevel + */ + omit?: Prisma.SubscriptionLevelOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SubscriptionLevelInclude | null + /** + * Filter, which SubscriptionLevel to fetch. + */ + where: Prisma.SubscriptionLevelWhereUniqueInput +} + +/** + * SubscriptionLevel findUniqueOrThrow + */ +export type SubscriptionLevelFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the SubscriptionLevel + */ + select?: Prisma.SubscriptionLevelSelect | null + /** + * Omit specific fields from the SubscriptionLevel + */ + omit?: Prisma.SubscriptionLevelOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SubscriptionLevelInclude | null + /** + * Filter, which SubscriptionLevel to fetch. + */ + where: Prisma.SubscriptionLevelWhereUniqueInput +} + +/** + * SubscriptionLevel findFirst + */ +export type SubscriptionLevelFindFirstArgs = { + /** + * Select specific fields to fetch from the SubscriptionLevel + */ + select?: Prisma.SubscriptionLevelSelect | null + /** + * Omit specific fields from the SubscriptionLevel + */ + omit?: Prisma.SubscriptionLevelOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SubscriptionLevelInclude | null + /** + * Filter, which SubscriptionLevel to fetch. + */ + where?: Prisma.SubscriptionLevelWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SubscriptionLevels to fetch. + */ + orderBy?: Prisma.SubscriptionLevelOrderByWithRelationInput | Prisma.SubscriptionLevelOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for SubscriptionLevels. + */ + cursor?: Prisma.SubscriptionLevelWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SubscriptionLevels from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` SubscriptionLevels. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of SubscriptionLevels. + */ + distinct?: Prisma.SubscriptionLevelScalarFieldEnum | Prisma.SubscriptionLevelScalarFieldEnum[] +} + +/** + * SubscriptionLevel findFirstOrThrow + */ +export type SubscriptionLevelFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the SubscriptionLevel + */ + select?: Prisma.SubscriptionLevelSelect | null + /** + * Omit specific fields from the SubscriptionLevel + */ + omit?: Prisma.SubscriptionLevelOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SubscriptionLevelInclude | null + /** + * Filter, which SubscriptionLevel to fetch. + */ + where?: Prisma.SubscriptionLevelWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SubscriptionLevels to fetch. + */ + orderBy?: Prisma.SubscriptionLevelOrderByWithRelationInput | Prisma.SubscriptionLevelOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for SubscriptionLevels. + */ + cursor?: Prisma.SubscriptionLevelWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SubscriptionLevels from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` SubscriptionLevels. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of SubscriptionLevels. + */ + distinct?: Prisma.SubscriptionLevelScalarFieldEnum | Prisma.SubscriptionLevelScalarFieldEnum[] +} + +/** + * SubscriptionLevel findMany + */ +export type SubscriptionLevelFindManyArgs = { + /** + * Select specific fields to fetch from the SubscriptionLevel + */ + select?: Prisma.SubscriptionLevelSelect | null + /** + * Omit specific fields from the SubscriptionLevel + */ + omit?: Prisma.SubscriptionLevelOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SubscriptionLevelInclude | null + /** + * Filter, which SubscriptionLevels to fetch. + */ + where?: Prisma.SubscriptionLevelWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SubscriptionLevels to fetch. + */ + orderBy?: Prisma.SubscriptionLevelOrderByWithRelationInput | Prisma.SubscriptionLevelOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing SubscriptionLevels. + */ + cursor?: Prisma.SubscriptionLevelWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SubscriptionLevels from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` SubscriptionLevels. + */ + skip?: number + distinct?: Prisma.SubscriptionLevelScalarFieldEnum | Prisma.SubscriptionLevelScalarFieldEnum[] +} + +/** + * SubscriptionLevel create + */ +export type SubscriptionLevelCreateArgs = { + /** + * Select specific fields to fetch from the SubscriptionLevel + */ + select?: Prisma.SubscriptionLevelSelect | null + /** + * Omit specific fields from the SubscriptionLevel + */ + omit?: Prisma.SubscriptionLevelOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SubscriptionLevelInclude | null + /** + * The data needed to create a SubscriptionLevel. + */ + data: Prisma.XOR +} + +/** + * SubscriptionLevel createMany + */ +export type SubscriptionLevelCreateManyArgs = { + /** + * The data used to create many SubscriptionLevels. + */ + data: Prisma.SubscriptionLevelCreateManyInput | Prisma.SubscriptionLevelCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * SubscriptionLevel createManyAndReturn + */ +export type SubscriptionLevelCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the SubscriptionLevel + */ + select?: Prisma.SubscriptionLevelSelectCreateManyAndReturn | null + /** + * Omit specific fields from the SubscriptionLevel + */ + omit?: Prisma.SubscriptionLevelOmit | null + /** + * The data used to create many SubscriptionLevels. + */ + data: Prisma.SubscriptionLevelCreateManyInput | Prisma.SubscriptionLevelCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * SubscriptionLevel update + */ +export type SubscriptionLevelUpdateArgs = { + /** + * Select specific fields to fetch from the SubscriptionLevel + */ + select?: Prisma.SubscriptionLevelSelect | null + /** + * Omit specific fields from the SubscriptionLevel + */ + omit?: Prisma.SubscriptionLevelOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SubscriptionLevelInclude | null + /** + * The data needed to update a SubscriptionLevel. + */ + data: Prisma.XOR + /** + * Choose, which SubscriptionLevel to update. + */ + where: Prisma.SubscriptionLevelWhereUniqueInput +} + +/** + * SubscriptionLevel updateMany + */ +export type SubscriptionLevelUpdateManyArgs = { + /** + * The data used to update SubscriptionLevels. + */ + data: Prisma.XOR + /** + * Filter which SubscriptionLevels to update + */ + where?: Prisma.SubscriptionLevelWhereInput + /** + * Limit how many SubscriptionLevels to update. + */ + limit?: number +} + +/** + * SubscriptionLevel updateManyAndReturn + */ +export type SubscriptionLevelUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the SubscriptionLevel + */ + select?: Prisma.SubscriptionLevelSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the SubscriptionLevel + */ + omit?: Prisma.SubscriptionLevelOmit | null + /** + * The data used to update SubscriptionLevels. + */ + data: Prisma.XOR + /** + * Filter which SubscriptionLevels to update + */ + where?: Prisma.SubscriptionLevelWhereInput + /** + * Limit how many SubscriptionLevels to update. + */ + limit?: number +} + +/** + * SubscriptionLevel upsert + */ +export type SubscriptionLevelUpsertArgs = { + /** + * Select specific fields to fetch from the SubscriptionLevel + */ + select?: Prisma.SubscriptionLevelSelect | null + /** + * Omit specific fields from the SubscriptionLevel + */ + omit?: Prisma.SubscriptionLevelOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SubscriptionLevelInclude | null + /** + * The filter to search for the SubscriptionLevel to update in case it exists. + */ + where: Prisma.SubscriptionLevelWhereUniqueInput + /** + * In case the SubscriptionLevel found by the `where` argument doesn't exist, create a new SubscriptionLevel with this data. + */ + create: Prisma.XOR + /** + * In case the SubscriptionLevel was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * SubscriptionLevel delete + */ +export type SubscriptionLevelDeleteArgs = { + /** + * Select specific fields to fetch from the SubscriptionLevel + */ + select?: Prisma.SubscriptionLevelSelect | null + /** + * Omit specific fields from the SubscriptionLevel + */ + omit?: Prisma.SubscriptionLevelOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SubscriptionLevelInclude | null + /** + * Filter which SubscriptionLevel to delete. + */ + where: Prisma.SubscriptionLevelWhereUniqueInput +} + +/** + * SubscriptionLevel deleteMany + */ +export type SubscriptionLevelDeleteManyArgs = { + /** + * Filter which SubscriptionLevels to delete + */ + where?: Prisma.SubscriptionLevelWhereInput + /** + * Limit how many SubscriptionLevels to delete. + */ + limit?: number +} + +/** + * SubscriptionLevel.proclamations + */ +export type SubscriptionLevel$proclamationsArgs = { + /** + * Select specific fields to fetch from the Proclamation + */ + select?: Prisma.ProclamationSelect | null + /** + * Omit specific fields from the Proclamation + */ + omit?: Prisma.ProclamationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProclamationInclude | null + where?: Prisma.ProclamationWhereInput + orderBy?: Prisma.ProclamationOrderByWithRelationInput | Prisma.ProclamationOrderByWithRelationInput[] + cursor?: Prisma.ProclamationWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.ProclamationScalarFieldEnum | Prisma.ProclamationScalarFieldEnum[] +} + +/** + * SubscriptionLevel without action + */ +export type SubscriptionLevelDefaultArgs = { + /** + * Select specific fields to fetch from the SubscriptionLevel + */ + select?: Prisma.SubscriptionLevelSelect | null + /** + * Omit specific fields from the SubscriptionLevel + */ + omit?: Prisma.SubscriptionLevelOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SubscriptionLevelInclude | null +} diff --git a/src/routes/api/v1/categories/+server.ts b/src/routes/api/v1/categories/+server.ts new file mode 100644 index 0000000..dac7b09 --- /dev/null +++ b/src/routes/api/v1/categories/+server.ts @@ -0,0 +1,7 @@ +import type { RequestHandler } from './$types'; +import { prisma } from '$lib/db'; + +export const GET: RequestHandler = async () => { + const categories = await prisma.proclamationCategory.findMany() + return new Response(JSON.stringify(categories)) +} \ No newline at end of file diff --git a/src/routes/api/v1/proclamations/+server.ts b/src/routes/api/v1/proclamations/+server.ts index 3406667..0558d9f 100644 --- a/src/routes/api/v1/proclamations/+server.ts +++ b/src/routes/api/v1/proclamations/+server.ts @@ -17,11 +17,7 @@ export const GET: RequestHandler = async ({ url }) => { throw error(500, 'unable to fetch proclamations'); } - return new Response( - JSON.stringify({ - proclamations - }) - ); + return new Response(JSON.stringify(proclamations)); } // Check that the key exists