diff --git a/prisma/migrations/20260224033323_change_name/migration.sql b/prisma/migrations/20260224033323_change_name/migration.sql new file mode 100644 index 0000000..04b82e9 --- /dev/null +++ b/prisma/migrations/20260224033323_change_name/migration.sql @@ -0,0 +1,36 @@ +/* + Warnings: + + - You are about to drop the `organization` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- DropForeignKey +ALTER TABLE "invitation" DROP CONSTRAINT "invitation_organizationId_fkey"; + +-- DropForeignKey +ALTER TABLE "member" DROP CONSTRAINT "member_organizationId_fkey"; + +-- DropTable +DROP TABLE "organization"; + +-- CreateTable +CREATE TABLE "house" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "slug" TEXT NOT NULL, + "logo" TEXT, + "createdAt" TIMESTAMPTZ NOT NULL, + "metadata" TEXT, + "color" TEXT DEFAULT '#000000', + + CONSTRAINT "house_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "house_slug_key" ON "house"("slug"); + +-- AddForeignKey +ALTER TABLE "member" ADD CONSTRAINT "member_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "house"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "invitation" ADD CONSTRAINT "invitation_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "house"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index a88dabb..05d0747 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -9,44 +9,44 @@ datasource db { } model User { - id String @id @default(uuid()) - name String - email String - emailVerified Boolean @default(false) - image String? - createdAt DateTime @default(now()) @db.Timestamptz - updatedAt DateTime @updatedAt @db.Timestamptz - sessions Session[] - accounts Account[] - audit Audit[] - notification Notification[] + id String @id @default(uuid()) + name String + email String + emailVerified Boolean @default(false) + image String? + createdAt DateTime @default(now()) @db.Timestamptz + updatedAt DateTime @updatedAt @db.Timestamptz + sessions Session[] + accounts Account[] + audit Audit[] + notification Notification[] - role String? - banned Boolean? @default(false) - banReason String? - banExpires DateTime? + role String? + banned Boolean? @default(false) + banReason String? + banExpires DateTime? - members Member[] - invitations Invitation[] + members Member[] + invitations Invitation[] @@unique([email]) @@map("user") } model Session { - id String @id @default(uuid()) - expiresAt DateTime @db.Timestamptz - token String - createdAt DateTime @default(now()) @db.Timestamptz - updatedAt DateTime @updatedAt @db.Timestamptz - ipAddress String? - userAgent String? - userId String - user User @relation(fields: [userId], references: [id], onDelete: Cascade) + id String @id @default(uuid()) + expiresAt DateTime @db.Timestamptz + token String + createdAt DateTime @default(now()) @db.Timestamptz + updatedAt DateTime @updatedAt @db.Timestamptz + ipAddress String? + userAgent String? + userId String + user User @relation(fields: [userId], references: [id], onDelete: Cascade) - impersonatedBy String? + impersonatedBy String? - activeOrganizationId String? + activeOrganizationId String? @@unique([token]) @@index([userId]) @@ -54,61 +54,60 @@ model Session { } model Account { - id String @id @default(uuid()) - accountId String - providerId String - userId String - user User @relation(fields: [userId], references: [id], onDelete: Cascade) - accessToken String? - refreshToken String? - idToken String? - accessTokenExpiresAt DateTime? - refreshTokenExpiresAt DateTime? - scope String? - password String? - createdAt DateTime @default(now()) @db.Timestamptz - updatedAt DateTime @updatedAt @db.Timestamptz + id String @id @default(uuid()) + accountId String + providerId String + userId String + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + accessToken String? + refreshToken String? + idToken String? + accessTokenExpiresAt DateTime? + refreshTokenExpiresAt DateTime? + scope String? + password String? + createdAt DateTime @default(now()) @db.Timestamptz + updatedAt DateTime @updatedAt @db.Timestamptz @@index([userId]) @@map("account") } model Verification { - id String @id @default(uuid()) - identifier String - value String - expiresAt DateTime - createdAt DateTime @default(now()) @db.Timestamptz - updatedAt DateTime @updatedAt @db.Timestamptz + id String @id @default(uuid()) + identifier String + value String + expiresAt DateTime + createdAt DateTime @default(now()) @db.Timestamptz + updatedAt DateTime @updatedAt @db.Timestamptz @@index([identifier]) @@map("verification") } -model Organization { - id String @id @default(uuid()) - name String - slug String - logo String? - createdAt DateTime @db.Timestamptz - metadata String? - members Member[] - invitations Invitation[] - - color String? @default("#000000") +model House { + id String @id @default(uuid()) + name String + slug String + logo String? + createdAt DateTime @db.Timestamptz + metadata String? + color String? @default("#000000") + members Member[] + invitations Invitation[] @@unique([slug]) - @@map("organization") + @@map("house") } model Member { - id String @id @default(uuid()) - organizationId String - organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade) - userId String - user User @relation(fields: [userId], references: [id], onDelete: Cascade) - role String @default("member") - createdAt DateTime @db.Timestamptz + id String @id @default(uuid()) + organizationId String + house House @relation(fields: [organizationId], references: [id], onDelete: Cascade) + userId String + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + role String @default("member") + createdAt DateTime @db.Timestamptz @@index([organizationId]) @@index([userId]) @@ -116,16 +115,16 @@ model Member { } model Invitation { - id String @id @default(uuid()) - organizationId String - organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade) - email String - role String? - status String @default("pending") - expiresAt DateTime @db.Timestamptz - createdAt DateTime @default(now()) @db.Timestamptz - inviterId String - user User @relation(fields: [inviterId], references: [id], onDelete: Cascade) + id String @id @default(uuid()) + organizationId String + house House @relation(fields: [organizationId], references: [id], onDelete: Cascade) + email String + role String? + status String @default("pending") + expiresAt DateTime @db.Timestamptz + createdAt DateTime @default(now()) @db.Timestamptz + inviterId String + user User @relation(fields: [inviterId], references: [id], onDelete: Cascade) @@index([organizationId]) @@index([email]) @@ -133,48 +132,47 @@ model Invitation { } model Setting { - id String @id @default(uuid()) - key String @unique - value String - description String - relation String @default("admin") + id String @id @default(uuid()) + key String @unique + value String + description String + relation String @default("admin") - createdAt DateTime @default(now()) @db.Timestamptz - updatedAt DateTime @updatedAt @db.Timestamptz + createdAt DateTime @default(now()) @db.Timestamptz + updatedAt DateTime @updatedAt @db.Timestamptz @@map("setting") } model Audit { - id String @id @default(uuid()) - userId String - action String - tableName String - recordId String - oldValue String? - newValue String? - createdAt DateTime @default(now()) @db.Timestamptz - - user User @relation(fields: [userId], references: [id], onDelete: Cascade) + id String @id @default(uuid()) + userId String + action String + tableName String + recordId String + oldValue String? + newValue String? + createdAt DateTime @default(now()) @db.Timestamptz + user User @relation(fields: [userId], references: [id], onDelete: Cascade) @@map("audit") } model Notification { - id String @id @default(uuid()) - userId String + id String @id @default(uuid()) + userId String - title String - message String - type String @default("system") + title String + message String + type String @default("system") - link String? - metadata String? + link String? + metadata String? - createdAt DateTime @default(now()) @db.Timestamptz - readAt DateTime? @db.Timestamptz + createdAt DateTime @default(now()) @db.Timestamptz + readAt DateTime? @db.Timestamptz - user User @relation(fields: [userId], references: [id], onDelete: Cascade) + user User @relation(fields: [userId], references: [id], onDelete: Cascade) @@index([userId, readAt]) @@index([readAt]) diff --git a/src/generated/prisma/browser.ts b/src/generated/prisma/browser.ts index ea251ed..def033a 100644 --- a/src/generated/prisma/browser.ts +++ b/src/generated/prisma/browser.ts @@ -38,10 +38,10 @@ export type Account = Prisma.AccountModel */ export type Verification = Prisma.VerificationModel /** - * Model Organization + * Model House * */ -export type Organization = Prisma.OrganizationModel +export type House = Prisma.HouseModel /** * Model Member * diff --git a/src/generated/prisma/client.ts b/src/generated/prisma/client.ts index afc81bd..7c38742 100644 --- a/src/generated/prisma/client.ts +++ b/src/generated/prisma/client.ts @@ -60,10 +60,10 @@ export type Account = Prisma.AccountModel */ export type Verification = Prisma.VerificationModel /** - * Model Organization + * Model House * */ -export type Organization = Prisma.OrganizationModel +export type House = Prisma.HouseModel /** * Model Member * diff --git a/src/generated/prisma/internal/class.ts b/src/generated/prisma/internal/class.ts index 33d3480..b6face5 100644 --- a/src/generated/prisma/internal/class.ts +++ b/src/generated/prisma/internal/class.ts @@ -20,7 +20,7 @@ const config: runtime.GetPrismaClientConfig = { "clientVersion": "7.3.0", "engineVersion": "9d6ad21cbbceab97458517b147a6a09ff43aa735", "activeProvider": "postgresql", - "inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../src/generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel User {\n id String @id @default(uuid())\n name String\n email String\n emailVerified Boolean @default(false)\n image String?\n createdAt DateTime @default(now()) @db.Timestamptz\n updatedAt DateTime @updatedAt @db.Timestamptz\n sessions Session[]\n accounts Account[]\n audit Audit[]\n notification Notification[]\n\n role String?\n banned Boolean? @default(false)\n banReason String?\n banExpires DateTime?\n\n members Member[]\n invitations Invitation[]\n\n @@unique([email])\n @@map(\"user\")\n}\n\nmodel Session {\n id String @id @default(uuid())\n expiresAt DateTime @db.Timestamptz\n token String\n createdAt DateTime @default(now()) @db.Timestamptz\n updatedAt DateTime @updatedAt @db.Timestamptz\n ipAddress String?\n userAgent String?\n userId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n impersonatedBy String?\n\n activeOrganizationId String?\n\n @@unique([token])\n @@index([userId])\n @@map(\"session\")\n}\n\nmodel Account {\n id String @id @default(uuid())\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()) @db.Timestamptz\n updatedAt DateTime @updatedAt @db.Timestamptz\n\n @@index([userId])\n @@map(\"account\")\n}\n\nmodel Verification {\n id String @id @default(uuid())\n identifier String\n value String\n expiresAt DateTime\n createdAt DateTime @default(now()) @db.Timestamptz\n updatedAt DateTime @updatedAt @db.Timestamptz\n\n @@index([identifier])\n @@map(\"verification\")\n}\n\nmodel Organization {\n id String @id @default(uuid())\n name String\n slug String\n logo String?\n createdAt DateTime @db.Timestamptz\n metadata String?\n members Member[]\n invitations Invitation[]\n\n color String? @default(\"#000000\")\n\n @@unique([slug])\n @@map(\"organization\")\n}\n\nmodel Member {\n id String @id @default(uuid())\n organizationId String\n organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)\n userId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n role String @default(\"member\")\n createdAt DateTime @db.Timestamptz\n\n @@index([organizationId])\n @@index([userId])\n @@map(\"member\")\n}\n\nmodel Invitation {\n id String @id @default(uuid())\n organizationId String\n organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)\n email String\n role String?\n status String @default(\"pending\")\n expiresAt DateTime @db.Timestamptz\n createdAt DateTime @default(now()) @db.Timestamptz\n inviterId String\n user User @relation(fields: [inviterId], references: [id], onDelete: Cascade)\n\n @@index([organizationId])\n @@index([email])\n @@map(\"invitation\")\n}\n\nmodel Setting {\n id String @id @default(uuid())\n key String @unique\n value String\n description String\n relation String @default(\"admin\")\n\n createdAt DateTime @default(now()) @db.Timestamptz\n updatedAt DateTime @updatedAt @db.Timestamptz\n\n @@map(\"setting\")\n}\n\nmodel Audit {\n id String @id @default(uuid())\n userId String\n action String\n tableName String\n recordId String\n oldValue String?\n newValue String?\n createdAt DateTime @default(now()) @db.Timestamptz\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"audit\")\n}\n\nmodel Notification {\n id String @id @default(uuid())\n userId String\n\n title String\n message String\n type String @default(\"system\")\n\n link String?\n metadata String?\n\n createdAt DateTime @default(now()) @db.Timestamptz\n readAt DateTime? @db.Timestamptz\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@index([userId, readAt])\n @@index([readAt])\n @@map(\"notification\")\n}\n", + "inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../src/generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel User {\n id String @id @default(uuid())\n name String\n email String\n emailVerified Boolean @default(false)\n image String?\n createdAt DateTime @default(now()) @db.Timestamptz\n updatedAt DateTime @updatedAt @db.Timestamptz\n sessions Session[]\n accounts Account[]\n audit Audit[]\n notification Notification[]\n\n role String?\n banned Boolean? @default(false)\n banReason String?\n banExpires DateTime?\n\n members Member[]\n invitations Invitation[]\n\n @@unique([email])\n @@map(\"user\")\n}\n\nmodel Session {\n id String @id @default(uuid())\n expiresAt DateTime @db.Timestamptz\n token String\n createdAt DateTime @default(now()) @db.Timestamptz\n updatedAt DateTime @updatedAt @db.Timestamptz\n ipAddress String?\n userAgent String?\n userId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n impersonatedBy String?\n\n activeOrganizationId String?\n\n @@unique([token])\n @@index([userId])\n @@map(\"session\")\n}\n\nmodel Account {\n id String @id @default(uuid())\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()) @db.Timestamptz\n updatedAt DateTime @updatedAt @db.Timestamptz\n\n @@index([userId])\n @@map(\"account\")\n}\n\nmodel Verification {\n id String @id @default(uuid())\n identifier String\n value String\n expiresAt DateTime\n createdAt DateTime @default(now()) @db.Timestamptz\n updatedAt DateTime @updatedAt @db.Timestamptz\n\n @@index([identifier])\n @@map(\"verification\")\n}\n\nmodel House {\n id String @id @default(uuid())\n name String\n slug String\n logo String?\n createdAt DateTime @db.Timestamptz\n metadata String?\n color String? @default(\"#000000\")\n members Member[]\n invitations Invitation[]\n\n @@unique([slug])\n @@map(\"house\")\n}\n\nmodel Member {\n id String @id @default(uuid())\n organizationId String\n house House @relation(fields: [organizationId], references: [id], onDelete: Cascade)\n userId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n role String @default(\"member\")\n createdAt DateTime @db.Timestamptz\n\n @@index([organizationId])\n @@index([userId])\n @@map(\"member\")\n}\n\nmodel Invitation {\n id String @id @default(uuid())\n organizationId String\n house House @relation(fields: [organizationId], references: [id], onDelete: Cascade)\n email String\n role String?\n status String @default(\"pending\")\n expiresAt DateTime @db.Timestamptz\n createdAt DateTime @default(now()) @db.Timestamptz\n inviterId String\n user User @relation(fields: [inviterId], references: [id], onDelete: Cascade)\n\n @@index([organizationId])\n @@index([email])\n @@map(\"invitation\")\n}\n\nmodel Setting {\n id String @id @default(uuid())\n key String @unique\n value String\n description String\n relation String @default(\"admin\")\n\n createdAt DateTime @default(now()) @db.Timestamptz\n updatedAt DateTime @updatedAt @db.Timestamptz\n\n @@map(\"setting\")\n}\n\nmodel Audit {\n id String @id @default(uuid())\n userId String\n action String\n tableName String\n recordId String\n oldValue String?\n newValue String?\n createdAt DateTime @default(now()) @db.Timestamptz\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@map(\"audit\")\n}\n\nmodel Notification {\n id String @id @default(uuid())\n userId String\n\n title String\n message String\n type String @default(\"system\")\n\n link String?\n metadata String?\n\n createdAt DateTime @default(now()) @db.Timestamptz\n readAt DateTime? @db.Timestamptz\n\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@index([userId, readAt])\n @@index([readAt])\n @@map(\"notification\")\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\":\"sessions\",\"kind\":\"object\",\"type\":\"Session\",\"relationName\":\"SessionToUser\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToUser\"},{\"name\":\"audit\",\"kind\":\"object\",\"type\":\"Audit\",\"relationName\":\"AuditToUser\"},{\"name\":\"notification\",\"kind\":\"object\",\"type\":\"Notification\",\"relationName\":\"NotificationToUser\"},{\"name\":\"role\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"banned\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"banReason\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"banExpires\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"members\",\"kind\":\"object\",\"type\":\"Member\",\"relationName\":\"MemberToUser\"},{\"name\":\"invitations\",\"kind\":\"object\",\"type\":\"Invitation\",\"relationName\":\"InvitationToUser\"}],\"dbName\":\"user\"},\"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\"},{\"name\":\"impersonatedBy\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"activeOrganizationId\",\"kind\":\"scalar\",\"type\":\"String\"}],\"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\"},\"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\"},\"Organization\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"slug\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"logo\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"metadata\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"members\",\"kind\":\"object\",\"type\":\"Member\",\"relationName\":\"MemberToOrganization\"},{\"name\":\"invitations\",\"kind\":\"object\",\"type\":\"Invitation\",\"relationName\":\"InvitationToOrganization\"},{\"name\":\"color\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"organization\"},\"Member\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"organization\",\"kind\":\"object\",\"type\":\"Organization\",\"relationName\":\"MemberToOrganization\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"MemberToUser\"},{\"name\":\"role\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"member\"},\"Invitation\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"organization\",\"kind\":\"object\",\"type\":\"Organization\",\"relationName\":\"InvitationToOrganization\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"inviterId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"InvitationToUser\"}],\"dbName\":\"invitation\"},\"Setting\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"key\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"value\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"relation\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"setting\"},\"Audit\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"action\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"tableName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"recordId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"oldValue\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"newValue\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"AuditToUser\"}],\"dbName\":\"audit\"},\"Notification\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"message\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"type\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"link\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"metadata\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"readAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"NotificationToUser\"}],\"dbName\":\"notification\"}},\"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\":\"sessions\",\"kind\":\"object\",\"type\":\"Session\",\"relationName\":\"SessionToUser\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToUser\"},{\"name\":\"audit\",\"kind\":\"object\",\"type\":\"Audit\",\"relationName\":\"AuditToUser\"},{\"name\":\"notification\",\"kind\":\"object\",\"type\":\"Notification\",\"relationName\":\"NotificationToUser\"},{\"name\":\"role\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"banned\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"banReason\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"banExpires\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"members\",\"kind\":\"object\",\"type\":\"Member\",\"relationName\":\"MemberToUser\"},{\"name\":\"invitations\",\"kind\":\"object\",\"type\":\"Invitation\",\"relationName\":\"InvitationToUser\"}],\"dbName\":\"user\"},\"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\"},{\"name\":\"impersonatedBy\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"activeOrganizationId\",\"kind\":\"scalar\",\"type\":\"String\"}],\"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\"},\"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\"},\"House\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"slug\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"logo\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"metadata\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"color\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"members\",\"kind\":\"object\",\"type\":\"Member\",\"relationName\":\"HouseToMember\"},{\"name\":\"invitations\",\"kind\":\"object\",\"type\":\"Invitation\",\"relationName\":\"HouseToInvitation\"}],\"dbName\":\"house\"},\"Member\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"house\",\"kind\":\"object\",\"type\":\"House\",\"relationName\":\"HouseToMember\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"MemberToUser\"},{\"name\":\"role\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"member\"},\"Invitation\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"organizationId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"house\",\"kind\":\"object\",\"type\":\"House\",\"relationName\":\"HouseToInvitation\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"inviterId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"InvitationToUser\"}],\"dbName\":\"invitation\"},\"Setting\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"key\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"value\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"relation\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"setting\"},\"Audit\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"action\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"tableName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"recordId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"oldValue\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"newValue\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"AuditToUser\"}],\"dbName\":\"audit\"},\"Notification\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"message\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"type\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"link\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"metadata\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"readAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"NotificationToUser\"}],\"dbName\":\"notification\"}},\"enums\":{},\"types\":{}}") async function decodeBase64AsWasm(wasmBase64: string): Promise { const { Buffer } = await import('node:buffer') @@ -217,14 +217,14 @@ export interface PrismaClient< get verification(): Prisma.VerificationDelegate; /** - * `prisma.organization`: Exposes CRUD operations for the **Organization** model. + * `prisma.house`: Exposes CRUD operations for the **House** model. * Example usage: * ```ts - * // Fetch zero or more Organizations - * const organizations = await prisma.organization.findMany() + * // Fetch zero or more Houses + * const houses = await prisma.house.findMany() * ``` */ - get organization(): Prisma.OrganizationDelegate; + get house(): Prisma.HouseDelegate; /** * `prisma.member`: Exposes CRUD operations for the **Member** model. diff --git a/src/generated/prisma/internal/prismaNamespace.ts b/src/generated/prisma/internal/prismaNamespace.ts index 7afbfe4..bb3c808 100644 --- a/src/generated/prisma/internal/prismaNamespace.ts +++ b/src/generated/prisma/internal/prismaNamespace.ts @@ -388,7 +388,7 @@ export const ModelName = { Session: 'Session', Account: 'Account', Verification: 'Verification', - Organization: 'Organization', + House: 'House', Member: 'Member', Invitation: 'Invitation', Setting: 'Setting', @@ -409,7 +409,7 @@ export type TypeMap - fields: Prisma.OrganizationFieldRefs + House: { + payload: Prisma.$HousePayload + fields: Prisma.HouseFieldRefs operations: { findUnique: { - args: Prisma.OrganizationFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null + args: Prisma.HouseFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null } findUniqueOrThrow: { - args: Prisma.OrganizationFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult + args: Prisma.HouseFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult } findFirst: { - args: Prisma.OrganizationFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null + args: Prisma.HouseFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null } findFirstOrThrow: { - args: Prisma.OrganizationFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult + args: Prisma.HouseFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult } findMany: { - args: Prisma.OrganizationFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] + args: Prisma.HouseFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] } create: { - args: Prisma.OrganizationCreateArgs - result: runtime.Types.Utils.PayloadToResult + args: Prisma.HouseCreateArgs + result: runtime.Types.Utils.PayloadToResult } createMany: { - args: Prisma.OrganizationCreateManyArgs + args: Prisma.HouseCreateManyArgs result: BatchPayload } createManyAndReturn: { - args: Prisma.OrganizationCreateManyAndReturnArgs - result: runtime.Types.Utils.PayloadToResult[] + args: Prisma.HouseCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] } delete: { - args: Prisma.OrganizationDeleteArgs - result: runtime.Types.Utils.PayloadToResult + args: Prisma.HouseDeleteArgs + result: runtime.Types.Utils.PayloadToResult } update: { - args: Prisma.OrganizationUpdateArgs - result: runtime.Types.Utils.PayloadToResult + args: Prisma.HouseUpdateArgs + result: runtime.Types.Utils.PayloadToResult } deleteMany: { - args: Prisma.OrganizationDeleteManyArgs + args: Prisma.HouseDeleteManyArgs result: BatchPayload } updateMany: { - args: Prisma.OrganizationUpdateManyArgs + args: Prisma.HouseUpdateManyArgs result: BatchPayload } updateManyAndReturn: { - args: Prisma.OrganizationUpdateManyAndReturnArgs - result: runtime.Types.Utils.PayloadToResult[] + args: Prisma.HouseUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] } upsert: { - args: Prisma.OrganizationUpsertArgs - result: runtime.Types.Utils.PayloadToResult + args: Prisma.HouseUpsertArgs + result: runtime.Types.Utils.PayloadToResult } aggregate: { - args: Prisma.OrganizationAggregateArgs - result: runtime.Types.Utils.Optional + args: Prisma.HouseAggregateArgs + result: runtime.Types.Utils.Optional } groupBy: { - args: Prisma.OrganizationGroupByArgs - result: runtime.Types.Utils.Optional[] + args: Prisma.HouseGroupByArgs + result: runtime.Types.Utils.Optional[] } count: { - args: Prisma.OrganizationCountArgs - result: runtime.Types.Utils.Optional | number + args: Prisma.HouseCountArgs + result: runtime.Types.Utils.Optional | number } } } @@ -1256,7 +1256,7 @@ export const VerificationScalarFieldEnum = { export type VerificationScalarFieldEnum = (typeof VerificationScalarFieldEnum)[keyof typeof VerificationScalarFieldEnum] -export const OrganizationScalarFieldEnum = { +export const HouseScalarFieldEnum = { id: 'id', name: 'name', slug: 'slug', @@ -1266,7 +1266,7 @@ export const OrganizationScalarFieldEnum = { color: 'color' } as const -export type OrganizationScalarFieldEnum = (typeof OrganizationScalarFieldEnum)[keyof typeof OrganizationScalarFieldEnum] +export type HouseScalarFieldEnum = (typeof HouseScalarFieldEnum)[keyof typeof HouseScalarFieldEnum] export const MemberScalarFieldEnum = { @@ -1513,7 +1513,7 @@ export type GlobalOmitConfig = { session?: Prisma.SessionOmit account?: Prisma.AccountOmit verification?: Prisma.VerificationOmit - organization?: Prisma.OrganizationOmit + house?: Prisma.HouseOmit member?: Prisma.MemberOmit invitation?: Prisma.InvitationOmit setting?: Prisma.SettingOmit diff --git a/src/generated/prisma/internal/prismaNamespaceBrowser.ts b/src/generated/prisma/internal/prismaNamespaceBrowser.ts index e1dc876..37cf0e2 100644 --- a/src/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/src/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -55,7 +55,7 @@ export const ModelName = { Session: 'Session', Account: 'Account', Verification: 'Verification', - Organization: 'Organization', + House: 'House', Member: 'Member', Invitation: 'Invitation', Setting: 'Setting', @@ -143,7 +143,7 @@ export const VerificationScalarFieldEnum = { export type VerificationScalarFieldEnum = (typeof VerificationScalarFieldEnum)[keyof typeof VerificationScalarFieldEnum] -export const OrganizationScalarFieldEnum = { +export const HouseScalarFieldEnum = { id: 'id', name: 'name', slug: 'slug', @@ -153,7 +153,7 @@ export const OrganizationScalarFieldEnum = { color: 'color' } as const -export type OrganizationScalarFieldEnum = (typeof OrganizationScalarFieldEnum)[keyof typeof OrganizationScalarFieldEnum] +export type HouseScalarFieldEnum = (typeof HouseScalarFieldEnum)[keyof typeof HouseScalarFieldEnum] export const MemberScalarFieldEnum = { diff --git a/src/generated/prisma/models.ts b/src/generated/prisma/models.ts index 1bdae43..f03ae92 100644 --- a/src/generated/prisma/models.ts +++ b/src/generated/prisma/models.ts @@ -12,7 +12,7 @@ export type * from './models/User.ts' export type * from './models/Session.ts' export type * from './models/Account.ts' export type * from './models/Verification.ts' -export type * from './models/Organization.ts' +export type * from './models/House.ts' export type * from './models/Member.ts' export type * from './models/Invitation.ts' export type * from './models/Setting.ts' diff --git a/src/generated/prisma/models/House.ts b/src/generated/prisma/models/House.ts new file mode 100644 index 0000000..70af367 --- /dev/null +++ b/src/generated/prisma/models/House.ts @@ -0,0 +1,1508 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `House` 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 House + * + */ +export type HouseModel = runtime.Types.Result.DefaultSelection + +export type AggregateHouse = { + _count: HouseCountAggregateOutputType | null + _min: HouseMinAggregateOutputType | null + _max: HouseMaxAggregateOutputType | null +} + +export type HouseMinAggregateOutputType = { + id: string | null + name: string | null + slug: string | null + logo: string | null + createdAt: Date | null + metadata: string | null + color: string | null +} + +export type HouseMaxAggregateOutputType = { + id: string | null + name: string | null + slug: string | null + logo: string | null + createdAt: Date | null + metadata: string | null + color: string | null +} + +export type HouseCountAggregateOutputType = { + id: number + name: number + slug: number + logo: number + createdAt: number + metadata: number + color: number + _all: number +} + + +export type HouseMinAggregateInputType = { + id?: true + name?: true + slug?: true + logo?: true + createdAt?: true + metadata?: true + color?: true +} + +export type HouseMaxAggregateInputType = { + id?: true + name?: true + slug?: true + logo?: true + createdAt?: true + metadata?: true + color?: true +} + +export type HouseCountAggregateInputType = { + id?: true + name?: true + slug?: true + logo?: true + createdAt?: true + metadata?: true + color?: true + _all?: true +} + +export type HouseAggregateArgs = { + /** + * Filter which House to aggregate. + */ + where?: Prisma.HouseWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Houses to fetch. + */ + orderBy?: Prisma.HouseOrderByWithRelationInput | Prisma.HouseOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.HouseWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Houses 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` Houses. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Houses + **/ + _count?: true | HouseCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: HouseMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: HouseMaxAggregateInputType +} + +export type GetHouseAggregateType = { + [P in keyof T & keyof AggregateHouse]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type HouseGroupByArgs = { + where?: Prisma.HouseWhereInput + orderBy?: Prisma.HouseOrderByWithAggregationInput | Prisma.HouseOrderByWithAggregationInput[] + by: Prisma.HouseScalarFieldEnum[] | Prisma.HouseScalarFieldEnum + having?: Prisma.HouseScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: HouseCountAggregateInputType | true + _min?: HouseMinAggregateInputType + _max?: HouseMaxAggregateInputType +} + +export type HouseGroupByOutputType = { + id: string + name: string + slug: string + logo: string | null + createdAt: Date + metadata: string | null + color: string | null + _count: HouseCountAggregateOutputType | null + _min: HouseMinAggregateOutputType | null + _max: HouseMaxAggregateOutputType | null +} + +type GetHouseGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof HouseGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type HouseWhereInput = { + AND?: Prisma.HouseWhereInput | Prisma.HouseWhereInput[] + OR?: Prisma.HouseWhereInput[] + NOT?: Prisma.HouseWhereInput | Prisma.HouseWhereInput[] + id?: Prisma.StringFilter<"House"> | string + name?: Prisma.StringFilter<"House"> | string + slug?: Prisma.StringFilter<"House"> | string + logo?: Prisma.StringNullableFilter<"House"> | string | null + createdAt?: Prisma.DateTimeFilter<"House"> | Date | string + metadata?: Prisma.StringNullableFilter<"House"> | string | null + color?: Prisma.StringNullableFilter<"House"> | string | null + members?: Prisma.MemberListRelationFilter + invitations?: Prisma.InvitationListRelationFilter +} + +export type HouseOrderByWithRelationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + slug?: Prisma.SortOrder + logo?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + metadata?: Prisma.SortOrderInput | Prisma.SortOrder + color?: Prisma.SortOrderInput | Prisma.SortOrder + members?: Prisma.MemberOrderByRelationAggregateInput + invitations?: Prisma.InvitationOrderByRelationAggregateInput +} + +export type HouseWhereUniqueInput = Prisma.AtLeast<{ + id?: string + slug?: string + AND?: Prisma.HouseWhereInput | Prisma.HouseWhereInput[] + OR?: Prisma.HouseWhereInput[] + NOT?: Prisma.HouseWhereInput | Prisma.HouseWhereInput[] + name?: Prisma.StringFilter<"House"> | string + logo?: Prisma.StringNullableFilter<"House"> | string | null + createdAt?: Prisma.DateTimeFilter<"House"> | Date | string + metadata?: Prisma.StringNullableFilter<"House"> | string | null + color?: Prisma.StringNullableFilter<"House"> | string | null + members?: Prisma.MemberListRelationFilter + invitations?: Prisma.InvitationListRelationFilter +}, "id" | "slug"> + +export type HouseOrderByWithAggregationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + slug?: Prisma.SortOrder + logo?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + metadata?: Prisma.SortOrderInput | Prisma.SortOrder + color?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.HouseCountOrderByAggregateInput + _max?: Prisma.HouseMaxOrderByAggregateInput + _min?: Prisma.HouseMinOrderByAggregateInput +} + +export type HouseScalarWhereWithAggregatesInput = { + AND?: Prisma.HouseScalarWhereWithAggregatesInput | Prisma.HouseScalarWhereWithAggregatesInput[] + OR?: Prisma.HouseScalarWhereWithAggregatesInput[] + NOT?: Prisma.HouseScalarWhereWithAggregatesInput | Prisma.HouseScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"House"> | string + name?: Prisma.StringWithAggregatesFilter<"House"> | string + slug?: Prisma.StringWithAggregatesFilter<"House"> | string + logo?: Prisma.StringNullableWithAggregatesFilter<"House"> | string | null + createdAt?: Prisma.DateTimeWithAggregatesFilter<"House"> | Date | string + metadata?: Prisma.StringNullableWithAggregatesFilter<"House"> | string | null + color?: Prisma.StringNullableWithAggregatesFilter<"House"> | string | null +} + +export type HouseCreateInput = { + id?: string + name: string + slug: string + logo?: string | null + createdAt: Date | string + metadata?: string | null + color?: string | null + members?: Prisma.MemberCreateNestedManyWithoutHouseInput + invitations?: Prisma.InvitationCreateNestedManyWithoutHouseInput +} + +export type HouseUncheckedCreateInput = { + id?: string + name: string + slug: string + logo?: string | null + createdAt: Date | string + metadata?: string | null + color?: string | null + members?: Prisma.MemberUncheckedCreateNestedManyWithoutHouseInput + invitations?: Prisma.InvitationUncheckedCreateNestedManyWithoutHouseInput +} + +export type HouseUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + members?: Prisma.MemberUpdateManyWithoutHouseNestedInput + invitations?: Prisma.InvitationUpdateManyWithoutHouseNestedInput +} + +export type HouseUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + members?: Prisma.MemberUncheckedUpdateManyWithoutHouseNestedInput + invitations?: Prisma.InvitationUncheckedUpdateManyWithoutHouseNestedInput +} + +export type HouseCreateManyInput = { + id?: string + name: string + slug: string + logo?: string | null + createdAt: Date | string + metadata?: string | null + color?: string | null +} + +export type HouseUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type HouseUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type HouseCountOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + slug?: Prisma.SortOrder + logo?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + metadata?: Prisma.SortOrder + color?: Prisma.SortOrder +} + +export type HouseMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + slug?: Prisma.SortOrder + logo?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + metadata?: Prisma.SortOrder + color?: Prisma.SortOrder +} + +export type HouseMinOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + slug?: Prisma.SortOrder + logo?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + metadata?: Prisma.SortOrder + color?: Prisma.SortOrder +} + +export type HouseScalarRelationFilter = { + is?: Prisma.HouseWhereInput + isNot?: Prisma.HouseWhereInput +} + +export type HouseCreateNestedOneWithoutMembersInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.HouseCreateOrConnectWithoutMembersInput + connect?: Prisma.HouseWhereUniqueInput +} + +export type HouseUpdateOneRequiredWithoutMembersNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.HouseCreateOrConnectWithoutMembersInput + upsert?: Prisma.HouseUpsertWithoutMembersInput + connect?: Prisma.HouseWhereUniqueInput + update?: Prisma.XOR, Prisma.HouseUncheckedUpdateWithoutMembersInput> +} + +export type HouseCreateNestedOneWithoutInvitationsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.HouseCreateOrConnectWithoutInvitationsInput + connect?: Prisma.HouseWhereUniqueInput +} + +export type HouseUpdateOneRequiredWithoutInvitationsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.HouseCreateOrConnectWithoutInvitationsInput + upsert?: Prisma.HouseUpsertWithoutInvitationsInput + connect?: Prisma.HouseWhereUniqueInput + update?: Prisma.XOR, Prisma.HouseUncheckedUpdateWithoutInvitationsInput> +} + +export type HouseCreateWithoutMembersInput = { + id?: string + name: string + slug: string + logo?: string | null + createdAt: Date | string + metadata?: string | null + color?: string | null + invitations?: Prisma.InvitationCreateNestedManyWithoutHouseInput +} + +export type HouseUncheckedCreateWithoutMembersInput = { + id?: string + name: string + slug: string + logo?: string | null + createdAt: Date | string + metadata?: string | null + color?: string | null + invitations?: Prisma.InvitationUncheckedCreateNestedManyWithoutHouseInput +} + +export type HouseCreateOrConnectWithoutMembersInput = { + where: Prisma.HouseWhereUniqueInput + create: Prisma.XOR +} + +export type HouseUpsertWithoutMembersInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.HouseWhereInput +} + +export type HouseUpdateToOneWithWhereWithoutMembersInput = { + where?: Prisma.HouseWhereInput + data: Prisma.XOR +} + +export type HouseUpdateWithoutMembersInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + invitations?: Prisma.InvitationUpdateManyWithoutHouseNestedInput +} + +export type HouseUncheckedUpdateWithoutMembersInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + invitations?: Prisma.InvitationUncheckedUpdateManyWithoutHouseNestedInput +} + +export type HouseCreateWithoutInvitationsInput = { + id?: string + name: string + slug: string + logo?: string | null + createdAt: Date | string + metadata?: string | null + color?: string | null + members?: Prisma.MemberCreateNestedManyWithoutHouseInput +} + +export type HouseUncheckedCreateWithoutInvitationsInput = { + id?: string + name: string + slug: string + logo?: string | null + createdAt: Date | string + metadata?: string | null + color?: string | null + members?: Prisma.MemberUncheckedCreateNestedManyWithoutHouseInput +} + +export type HouseCreateOrConnectWithoutInvitationsInput = { + where: Prisma.HouseWhereUniqueInput + create: Prisma.XOR +} + +export type HouseUpsertWithoutInvitationsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.HouseWhereInput +} + +export type HouseUpdateToOneWithWhereWithoutInvitationsInput = { + where?: Prisma.HouseWhereInput + data: Prisma.XOR +} + +export type HouseUpdateWithoutInvitationsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + members?: Prisma.MemberUpdateManyWithoutHouseNestedInput +} + +export type HouseUncheckedUpdateWithoutInvitationsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + members?: Prisma.MemberUncheckedUpdateManyWithoutHouseNestedInput +} + + +/** + * Count Type HouseCountOutputType + */ + +export type HouseCountOutputType = { + members: number + invitations: number +} + +export type HouseCountOutputTypeSelect = { + members?: boolean | HouseCountOutputTypeCountMembersArgs + invitations?: boolean | HouseCountOutputTypeCountInvitationsArgs +} + +/** + * HouseCountOutputType without action + */ +export type HouseCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the HouseCountOutputType + */ + select?: Prisma.HouseCountOutputTypeSelect | null +} + +/** + * HouseCountOutputType without action + */ +export type HouseCountOutputTypeCountMembersArgs = { + where?: Prisma.MemberWhereInput +} + +/** + * HouseCountOutputType without action + */ +export type HouseCountOutputTypeCountInvitationsArgs = { + where?: Prisma.InvitationWhereInput +} + + +export type HouseSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + slug?: boolean + logo?: boolean + createdAt?: boolean + metadata?: boolean + color?: boolean + members?: boolean | Prisma.House$membersArgs + invitations?: boolean | Prisma.House$invitationsArgs + _count?: boolean | Prisma.HouseCountOutputTypeDefaultArgs +}, ExtArgs["result"]["house"]> + +export type HouseSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + slug?: boolean + logo?: boolean + createdAt?: boolean + metadata?: boolean + color?: boolean +}, ExtArgs["result"]["house"]> + +export type HouseSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + slug?: boolean + logo?: boolean + createdAt?: boolean + metadata?: boolean + color?: boolean +}, ExtArgs["result"]["house"]> + +export type HouseSelectScalar = { + id?: boolean + name?: boolean + slug?: boolean + logo?: boolean + createdAt?: boolean + metadata?: boolean + color?: boolean +} + +export type HouseOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "slug" | "logo" | "createdAt" | "metadata" | "color", ExtArgs["result"]["house"]> +export type HouseInclude = { + members?: boolean | Prisma.House$membersArgs + invitations?: boolean | Prisma.House$invitationsArgs + _count?: boolean | Prisma.HouseCountOutputTypeDefaultArgs +} +export type HouseIncludeCreateManyAndReturn = {} +export type HouseIncludeUpdateManyAndReturn = {} + +export type $HousePayload = { + name: "House" + objects: { + members: Prisma.$MemberPayload[] + invitations: Prisma.$InvitationPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + name: string + slug: string + logo: string | null + createdAt: Date + metadata: string | null + color: string | null + }, ExtArgs["result"]["house"]> + composites: {} +} + +export type HouseGetPayload = runtime.Types.Result.GetResult + +export type HouseCountArgs = + Omit & { + select?: HouseCountAggregateInputType | true + } + +export interface HouseDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['House'], meta: { name: 'House' } } + /** + * Find zero or one House that matches the filter. + * @param {HouseFindUniqueArgs} args - Arguments to find a House + * @example + * // Get one House + * const house = await prisma.house.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__HouseClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one House that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {HouseFindUniqueOrThrowArgs} args - Arguments to find a House + * @example + * // Get one House + * const house = await prisma.house.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__HouseClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first House 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 {HouseFindFirstArgs} args - Arguments to find a House + * @example + * // Get one House + * const house = await prisma.house.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__HouseClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first House 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 {HouseFindFirstOrThrowArgs} args - Arguments to find a House + * @example + * // Get one House + * const house = await prisma.house.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__HouseClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Houses 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 {HouseFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Houses + * const houses = await prisma.house.findMany() + * + * // Get first 10 Houses + * const houses = await prisma.house.findMany({ take: 10 }) + * + * // Only select the `id` + * const houseWithIdOnly = await prisma.house.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a House. + * @param {HouseCreateArgs} args - Arguments to create a House. + * @example + * // Create one House + * const House = await prisma.house.create({ + * data: { + * // ... data to create a House + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__HouseClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Houses. + * @param {HouseCreateManyArgs} args - Arguments to create many Houses. + * @example + * // Create many Houses + * const house = await prisma.house.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Houses and returns the data saved in the database. + * @param {HouseCreateManyAndReturnArgs} args - Arguments to create many Houses. + * @example + * // Create many Houses + * const house = await prisma.house.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Houses and only return the `id` + * const houseWithIdOnly = await prisma.house.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 House. + * @param {HouseDeleteArgs} args - Arguments to delete one House. + * @example + * // Delete one House + * const House = await prisma.house.delete({ + * where: { + * // ... filter to delete one House + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__HouseClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one House. + * @param {HouseUpdateArgs} args - Arguments to update one House. + * @example + * // Update one House + * const house = await prisma.house.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__HouseClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Houses. + * @param {HouseDeleteManyArgs} args - Arguments to filter Houses to delete. + * @example + * // Delete a few Houses + * const { count } = await prisma.house.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Houses. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {HouseUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Houses + * const house = await prisma.house.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Houses and returns the data updated in the database. + * @param {HouseUpdateManyAndReturnArgs} args - Arguments to update many Houses. + * @example + * // Update many Houses + * const house = await prisma.house.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Houses and only return the `id` + * const houseWithIdOnly = await prisma.house.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 House. + * @param {HouseUpsertArgs} args - Arguments to update or create a House. + * @example + * // Update or create a House + * const house = await prisma.house.upsert({ + * create: { + * // ... data to create a House + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the House we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__HouseClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Houses. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {HouseCountArgs} args - Arguments to filter Houses to count. + * @example + * // Count the number of Houses + * const count = await prisma.house.count({ + * where: { + * // ... the filter for the Houses 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 House. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {HouseAggregateArgs} 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 House. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {HouseGroupByArgs} 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 HouseGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: HouseGroupByArgs['orderBy'] } + : { orderBy?: HouseGroupByArgs['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 ? GetHouseGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the House model + */ +readonly fields: HouseFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for House. + * 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__HouseClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + members = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + invitations = {}>(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 House model + */ +export interface HouseFieldRefs { + readonly id: Prisma.FieldRef<"House", 'String'> + readonly name: Prisma.FieldRef<"House", 'String'> + readonly slug: Prisma.FieldRef<"House", 'String'> + readonly logo: Prisma.FieldRef<"House", 'String'> + readonly createdAt: Prisma.FieldRef<"House", 'DateTime'> + readonly metadata: Prisma.FieldRef<"House", 'String'> + readonly color: Prisma.FieldRef<"House", 'String'> +} + + +// Custom InputTypes +/** + * House findUnique + */ +export type HouseFindUniqueArgs = { + /** + * Select specific fields to fetch from the House + */ + select?: Prisma.HouseSelect | null + /** + * Omit specific fields from the House + */ + omit?: Prisma.HouseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.HouseInclude | null + /** + * Filter, which House to fetch. + */ + where: Prisma.HouseWhereUniqueInput +} + +/** + * House findUniqueOrThrow + */ +export type HouseFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the House + */ + select?: Prisma.HouseSelect | null + /** + * Omit specific fields from the House + */ + omit?: Prisma.HouseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.HouseInclude | null + /** + * Filter, which House to fetch. + */ + where: Prisma.HouseWhereUniqueInput +} + +/** + * House findFirst + */ +export type HouseFindFirstArgs = { + /** + * Select specific fields to fetch from the House + */ + select?: Prisma.HouseSelect | null + /** + * Omit specific fields from the House + */ + omit?: Prisma.HouseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.HouseInclude | null + /** + * Filter, which House to fetch. + */ + where?: Prisma.HouseWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Houses to fetch. + */ + orderBy?: Prisma.HouseOrderByWithRelationInput | Prisma.HouseOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Houses. + */ + cursor?: Prisma.HouseWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Houses 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` Houses. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Houses. + */ + distinct?: Prisma.HouseScalarFieldEnum | Prisma.HouseScalarFieldEnum[] +} + +/** + * House findFirstOrThrow + */ +export type HouseFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the House + */ + select?: Prisma.HouseSelect | null + /** + * Omit specific fields from the House + */ + omit?: Prisma.HouseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.HouseInclude | null + /** + * Filter, which House to fetch. + */ + where?: Prisma.HouseWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Houses to fetch. + */ + orderBy?: Prisma.HouseOrderByWithRelationInput | Prisma.HouseOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Houses. + */ + cursor?: Prisma.HouseWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Houses 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` Houses. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Houses. + */ + distinct?: Prisma.HouseScalarFieldEnum | Prisma.HouseScalarFieldEnum[] +} + +/** + * House findMany + */ +export type HouseFindManyArgs = { + /** + * Select specific fields to fetch from the House + */ + select?: Prisma.HouseSelect | null + /** + * Omit specific fields from the House + */ + omit?: Prisma.HouseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.HouseInclude | null + /** + * Filter, which Houses to fetch. + */ + where?: Prisma.HouseWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Houses to fetch. + */ + orderBy?: Prisma.HouseOrderByWithRelationInput | Prisma.HouseOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Houses. + */ + cursor?: Prisma.HouseWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Houses 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` Houses. + */ + skip?: number + distinct?: Prisma.HouseScalarFieldEnum | Prisma.HouseScalarFieldEnum[] +} + +/** + * House create + */ +export type HouseCreateArgs = { + /** + * Select specific fields to fetch from the House + */ + select?: Prisma.HouseSelect | null + /** + * Omit specific fields from the House + */ + omit?: Prisma.HouseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.HouseInclude | null + /** + * The data needed to create a House. + */ + data: Prisma.XOR +} + +/** + * House createMany + */ +export type HouseCreateManyArgs = { + /** + * The data used to create many Houses. + */ + data: Prisma.HouseCreateManyInput | Prisma.HouseCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * House createManyAndReturn + */ +export type HouseCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the House + */ + select?: Prisma.HouseSelectCreateManyAndReturn | null + /** + * Omit specific fields from the House + */ + omit?: Prisma.HouseOmit | null + /** + * The data used to create many Houses. + */ + data: Prisma.HouseCreateManyInput | Prisma.HouseCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * House update + */ +export type HouseUpdateArgs = { + /** + * Select specific fields to fetch from the House + */ + select?: Prisma.HouseSelect | null + /** + * Omit specific fields from the House + */ + omit?: Prisma.HouseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.HouseInclude | null + /** + * The data needed to update a House. + */ + data: Prisma.XOR + /** + * Choose, which House to update. + */ + where: Prisma.HouseWhereUniqueInput +} + +/** + * House updateMany + */ +export type HouseUpdateManyArgs = { + /** + * The data used to update Houses. + */ + data: Prisma.XOR + /** + * Filter which Houses to update + */ + where?: Prisma.HouseWhereInput + /** + * Limit how many Houses to update. + */ + limit?: number +} + +/** + * House updateManyAndReturn + */ +export type HouseUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the House + */ + select?: Prisma.HouseSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the House + */ + omit?: Prisma.HouseOmit | null + /** + * The data used to update Houses. + */ + data: Prisma.XOR + /** + * Filter which Houses to update + */ + where?: Prisma.HouseWhereInput + /** + * Limit how many Houses to update. + */ + limit?: number +} + +/** + * House upsert + */ +export type HouseUpsertArgs = { + /** + * Select specific fields to fetch from the House + */ + select?: Prisma.HouseSelect | null + /** + * Omit specific fields from the House + */ + omit?: Prisma.HouseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.HouseInclude | null + /** + * The filter to search for the House to update in case it exists. + */ + where: Prisma.HouseWhereUniqueInput + /** + * In case the House found by the `where` argument doesn't exist, create a new House with this data. + */ + create: Prisma.XOR + /** + * In case the House was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * House delete + */ +export type HouseDeleteArgs = { + /** + * Select specific fields to fetch from the House + */ + select?: Prisma.HouseSelect | null + /** + * Omit specific fields from the House + */ + omit?: Prisma.HouseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.HouseInclude | null + /** + * Filter which House to delete. + */ + where: Prisma.HouseWhereUniqueInput +} + +/** + * House deleteMany + */ +export type HouseDeleteManyArgs = { + /** + * Filter which Houses to delete + */ + where?: Prisma.HouseWhereInput + /** + * Limit how many Houses to delete. + */ + limit?: number +} + +/** + * House.members + */ +export type House$membersArgs = { + /** + * Select specific fields to fetch from the Member + */ + select?: Prisma.MemberSelect | null + /** + * Omit specific fields from the Member + */ + omit?: Prisma.MemberOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.MemberInclude | null + where?: Prisma.MemberWhereInput + orderBy?: Prisma.MemberOrderByWithRelationInput | Prisma.MemberOrderByWithRelationInput[] + cursor?: Prisma.MemberWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.MemberScalarFieldEnum | Prisma.MemberScalarFieldEnum[] +} + +/** + * House.invitations + */ +export type House$invitationsArgs = { + /** + * Select specific fields to fetch from the Invitation + */ + select?: Prisma.InvitationSelect | null + /** + * Omit specific fields from the Invitation + */ + omit?: Prisma.InvitationOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InvitationInclude | null + where?: Prisma.InvitationWhereInput + orderBy?: Prisma.InvitationOrderByWithRelationInput | Prisma.InvitationOrderByWithRelationInput[] + cursor?: Prisma.InvitationWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.InvitationScalarFieldEnum | Prisma.InvitationScalarFieldEnum[] +} + +/** + * House without action + */ +export type HouseDefaultArgs = { + /** + * Select specific fields to fetch from the House + */ + select?: Prisma.HouseSelect | null + /** + * Omit specific fields from the House + */ + omit?: Prisma.HouseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.HouseInclude | null +} diff --git a/src/generated/prisma/models/Invitation.ts b/src/generated/prisma/models/Invitation.ts index c63d4df..64db534 100644 --- a/src/generated/prisma/models/Invitation.ts +++ b/src/generated/prisma/models/Invitation.ts @@ -206,7 +206,7 @@ export type InvitationWhereInput = { expiresAt?: Prisma.DateTimeFilter<"Invitation"> | Date | string createdAt?: Prisma.DateTimeFilter<"Invitation"> | Date | string inviterId?: Prisma.StringFilter<"Invitation"> | string - organization?: Prisma.XOR + house?: Prisma.XOR user?: Prisma.XOR } @@ -219,7 +219,7 @@ export type InvitationOrderByWithRelationInput = { expiresAt?: Prisma.SortOrder createdAt?: Prisma.SortOrder inviterId?: Prisma.SortOrder - organization?: Prisma.OrganizationOrderByWithRelationInput + house?: Prisma.HouseOrderByWithRelationInput user?: Prisma.UserOrderByWithRelationInput } @@ -235,7 +235,7 @@ export type InvitationWhereUniqueInput = Prisma.AtLeast<{ expiresAt?: Prisma.DateTimeFilter<"Invitation"> | Date | string createdAt?: Prisma.DateTimeFilter<"Invitation"> | Date | string inviterId?: Prisma.StringFilter<"Invitation"> | string - organization?: Prisma.XOR + house?: Prisma.XOR user?: Prisma.XOR }, "id"> @@ -274,7 +274,7 @@ export type InvitationCreateInput = { status?: string expiresAt: Date | string createdAt?: Date | string - organization: Prisma.OrganizationCreateNestedOneWithoutInvitationsInput + house: Prisma.HouseCreateNestedOneWithoutInvitationsInput user: Prisma.UserCreateNestedOneWithoutInvitationsInput } @@ -296,7 +296,7 @@ export type InvitationUpdateInput = { status?: Prisma.StringFieldUpdateOperationsInput | string expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - organization?: Prisma.OrganizationUpdateOneRequiredWithoutInvitationsNestedInput + house?: Prisma.HouseUpdateOneRequiredWithoutInvitationsNestedInput user?: Prisma.UserUpdateOneRequiredWithoutInvitationsNestedInput } @@ -427,45 +427,45 @@ export type InvitationUncheckedUpdateManyWithoutUserNestedInput = { deleteMany?: Prisma.InvitationScalarWhereInput | Prisma.InvitationScalarWhereInput[] } -export type InvitationCreateNestedManyWithoutOrganizationInput = { - create?: Prisma.XOR | Prisma.InvitationCreateWithoutOrganizationInput[] | Prisma.InvitationUncheckedCreateWithoutOrganizationInput[] - connectOrCreate?: Prisma.InvitationCreateOrConnectWithoutOrganizationInput | Prisma.InvitationCreateOrConnectWithoutOrganizationInput[] - createMany?: Prisma.InvitationCreateManyOrganizationInputEnvelope +export type InvitationCreateNestedManyWithoutHouseInput = { + create?: Prisma.XOR | Prisma.InvitationCreateWithoutHouseInput[] | Prisma.InvitationUncheckedCreateWithoutHouseInput[] + connectOrCreate?: Prisma.InvitationCreateOrConnectWithoutHouseInput | Prisma.InvitationCreateOrConnectWithoutHouseInput[] + createMany?: Prisma.InvitationCreateManyHouseInputEnvelope connect?: Prisma.InvitationWhereUniqueInput | Prisma.InvitationWhereUniqueInput[] } -export type InvitationUncheckedCreateNestedManyWithoutOrganizationInput = { - create?: Prisma.XOR | Prisma.InvitationCreateWithoutOrganizationInput[] | Prisma.InvitationUncheckedCreateWithoutOrganizationInput[] - connectOrCreate?: Prisma.InvitationCreateOrConnectWithoutOrganizationInput | Prisma.InvitationCreateOrConnectWithoutOrganizationInput[] - createMany?: Prisma.InvitationCreateManyOrganizationInputEnvelope +export type InvitationUncheckedCreateNestedManyWithoutHouseInput = { + create?: Prisma.XOR | Prisma.InvitationCreateWithoutHouseInput[] | Prisma.InvitationUncheckedCreateWithoutHouseInput[] + connectOrCreate?: Prisma.InvitationCreateOrConnectWithoutHouseInput | Prisma.InvitationCreateOrConnectWithoutHouseInput[] + createMany?: Prisma.InvitationCreateManyHouseInputEnvelope connect?: Prisma.InvitationWhereUniqueInput | Prisma.InvitationWhereUniqueInput[] } -export type InvitationUpdateManyWithoutOrganizationNestedInput = { - create?: Prisma.XOR | Prisma.InvitationCreateWithoutOrganizationInput[] | Prisma.InvitationUncheckedCreateWithoutOrganizationInput[] - connectOrCreate?: Prisma.InvitationCreateOrConnectWithoutOrganizationInput | Prisma.InvitationCreateOrConnectWithoutOrganizationInput[] - upsert?: Prisma.InvitationUpsertWithWhereUniqueWithoutOrganizationInput | Prisma.InvitationUpsertWithWhereUniqueWithoutOrganizationInput[] - createMany?: Prisma.InvitationCreateManyOrganizationInputEnvelope +export type InvitationUpdateManyWithoutHouseNestedInput = { + create?: Prisma.XOR | Prisma.InvitationCreateWithoutHouseInput[] | Prisma.InvitationUncheckedCreateWithoutHouseInput[] + connectOrCreate?: Prisma.InvitationCreateOrConnectWithoutHouseInput | Prisma.InvitationCreateOrConnectWithoutHouseInput[] + upsert?: Prisma.InvitationUpsertWithWhereUniqueWithoutHouseInput | Prisma.InvitationUpsertWithWhereUniqueWithoutHouseInput[] + createMany?: Prisma.InvitationCreateManyHouseInputEnvelope set?: Prisma.InvitationWhereUniqueInput | Prisma.InvitationWhereUniqueInput[] disconnect?: Prisma.InvitationWhereUniqueInput | Prisma.InvitationWhereUniqueInput[] delete?: Prisma.InvitationWhereUniqueInput | Prisma.InvitationWhereUniqueInput[] connect?: Prisma.InvitationWhereUniqueInput | Prisma.InvitationWhereUniqueInput[] - update?: Prisma.InvitationUpdateWithWhereUniqueWithoutOrganizationInput | Prisma.InvitationUpdateWithWhereUniqueWithoutOrganizationInput[] - updateMany?: Prisma.InvitationUpdateManyWithWhereWithoutOrganizationInput | Prisma.InvitationUpdateManyWithWhereWithoutOrganizationInput[] + update?: Prisma.InvitationUpdateWithWhereUniqueWithoutHouseInput | Prisma.InvitationUpdateWithWhereUniqueWithoutHouseInput[] + updateMany?: Prisma.InvitationUpdateManyWithWhereWithoutHouseInput | Prisma.InvitationUpdateManyWithWhereWithoutHouseInput[] deleteMany?: Prisma.InvitationScalarWhereInput | Prisma.InvitationScalarWhereInput[] } -export type InvitationUncheckedUpdateManyWithoutOrganizationNestedInput = { - create?: Prisma.XOR | Prisma.InvitationCreateWithoutOrganizationInput[] | Prisma.InvitationUncheckedCreateWithoutOrganizationInput[] - connectOrCreate?: Prisma.InvitationCreateOrConnectWithoutOrganizationInput | Prisma.InvitationCreateOrConnectWithoutOrganizationInput[] - upsert?: Prisma.InvitationUpsertWithWhereUniqueWithoutOrganizationInput | Prisma.InvitationUpsertWithWhereUniqueWithoutOrganizationInput[] - createMany?: Prisma.InvitationCreateManyOrganizationInputEnvelope +export type InvitationUncheckedUpdateManyWithoutHouseNestedInput = { + create?: Prisma.XOR | Prisma.InvitationCreateWithoutHouseInput[] | Prisma.InvitationUncheckedCreateWithoutHouseInput[] + connectOrCreate?: Prisma.InvitationCreateOrConnectWithoutHouseInput | Prisma.InvitationCreateOrConnectWithoutHouseInput[] + upsert?: Prisma.InvitationUpsertWithWhereUniqueWithoutHouseInput | Prisma.InvitationUpsertWithWhereUniqueWithoutHouseInput[] + createMany?: Prisma.InvitationCreateManyHouseInputEnvelope set?: Prisma.InvitationWhereUniqueInput | Prisma.InvitationWhereUniqueInput[] disconnect?: Prisma.InvitationWhereUniqueInput | Prisma.InvitationWhereUniqueInput[] delete?: Prisma.InvitationWhereUniqueInput | Prisma.InvitationWhereUniqueInput[] connect?: Prisma.InvitationWhereUniqueInput | Prisma.InvitationWhereUniqueInput[] - update?: Prisma.InvitationUpdateWithWhereUniqueWithoutOrganizationInput | Prisma.InvitationUpdateWithWhereUniqueWithoutOrganizationInput[] - updateMany?: Prisma.InvitationUpdateManyWithWhereWithoutOrganizationInput | Prisma.InvitationUpdateManyWithWhereWithoutOrganizationInput[] + update?: Prisma.InvitationUpdateWithWhereUniqueWithoutHouseInput | Prisma.InvitationUpdateWithWhereUniqueWithoutHouseInput[] + updateMany?: Prisma.InvitationUpdateManyWithWhereWithoutHouseInput | Prisma.InvitationUpdateManyWithWhereWithoutHouseInput[] deleteMany?: Prisma.InvitationScalarWhereInput | Prisma.InvitationScalarWhereInput[] } @@ -476,7 +476,7 @@ export type InvitationCreateWithoutUserInput = { status?: string expiresAt: Date | string createdAt?: Date | string - organization: Prisma.OrganizationCreateNestedOneWithoutInvitationsInput + house: Prisma.HouseCreateNestedOneWithoutInvitationsInput } export type InvitationUncheckedCreateWithoutUserInput = { @@ -529,7 +529,7 @@ export type InvitationScalarWhereInput = { inviterId?: Prisma.StringFilter<"Invitation"> | string } -export type InvitationCreateWithoutOrganizationInput = { +export type InvitationCreateWithoutHouseInput = { id?: string email: string role?: string | null @@ -539,7 +539,7 @@ export type InvitationCreateWithoutOrganizationInput = { user: Prisma.UserCreateNestedOneWithoutInvitationsInput } -export type InvitationUncheckedCreateWithoutOrganizationInput = { +export type InvitationUncheckedCreateWithoutHouseInput = { id?: string email: string role?: string | null @@ -549,30 +549,30 @@ export type InvitationUncheckedCreateWithoutOrganizationInput = { inviterId: string } -export type InvitationCreateOrConnectWithoutOrganizationInput = { +export type InvitationCreateOrConnectWithoutHouseInput = { where: Prisma.InvitationWhereUniqueInput - create: Prisma.XOR + create: Prisma.XOR } -export type InvitationCreateManyOrganizationInputEnvelope = { - data: Prisma.InvitationCreateManyOrganizationInput | Prisma.InvitationCreateManyOrganizationInput[] +export type InvitationCreateManyHouseInputEnvelope = { + data: Prisma.InvitationCreateManyHouseInput | Prisma.InvitationCreateManyHouseInput[] skipDuplicates?: boolean } -export type InvitationUpsertWithWhereUniqueWithoutOrganizationInput = { +export type InvitationUpsertWithWhereUniqueWithoutHouseInput = { where: Prisma.InvitationWhereUniqueInput - update: Prisma.XOR - create: Prisma.XOR + update: Prisma.XOR + create: Prisma.XOR } -export type InvitationUpdateWithWhereUniqueWithoutOrganizationInput = { +export type InvitationUpdateWithWhereUniqueWithoutHouseInput = { where: Prisma.InvitationWhereUniqueInput - data: Prisma.XOR + data: Prisma.XOR } -export type InvitationUpdateManyWithWhereWithoutOrganizationInput = { +export type InvitationUpdateManyWithWhereWithoutHouseInput = { where: Prisma.InvitationScalarWhereInput - data: Prisma.XOR + data: Prisma.XOR } export type InvitationCreateManyUserInput = { @@ -592,7 +592,7 @@ export type InvitationUpdateWithoutUserInput = { status?: Prisma.StringFieldUpdateOperationsInput | string expiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - organization?: Prisma.OrganizationUpdateOneRequiredWithoutInvitationsNestedInput + house?: Prisma.HouseUpdateOneRequiredWithoutInvitationsNestedInput } export type InvitationUncheckedUpdateWithoutUserInput = { @@ -615,7 +615,7 @@ export type InvitationUncheckedUpdateManyWithoutUserInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } -export type InvitationCreateManyOrganizationInput = { +export type InvitationCreateManyHouseInput = { id?: string email: string role?: string | null @@ -625,7 +625,7 @@ export type InvitationCreateManyOrganizationInput = { inviterId: string } -export type InvitationUpdateWithoutOrganizationInput = { +export type InvitationUpdateWithoutHouseInput = { id?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.StringFieldUpdateOperationsInput | string role?: Prisma.NullableStringFieldUpdateOperationsInput | string | null @@ -635,7 +635,7 @@ export type InvitationUpdateWithoutOrganizationInput = { user?: Prisma.UserUpdateOneRequiredWithoutInvitationsNestedInput } -export type InvitationUncheckedUpdateWithoutOrganizationInput = { +export type InvitationUncheckedUpdateWithoutHouseInput = { id?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.StringFieldUpdateOperationsInput | string role?: Prisma.NullableStringFieldUpdateOperationsInput | string | null @@ -645,7 +645,7 @@ export type InvitationUncheckedUpdateWithoutOrganizationInput = { inviterId?: Prisma.StringFieldUpdateOperationsInput | string } -export type InvitationUncheckedUpdateManyWithoutOrganizationInput = { +export type InvitationUncheckedUpdateManyWithoutHouseInput = { id?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.StringFieldUpdateOperationsInput | string role?: Prisma.NullableStringFieldUpdateOperationsInput | string | null @@ -666,7 +666,7 @@ export type InvitationSelect + house?: boolean | Prisma.HouseDefaultArgs user?: boolean | Prisma.UserDefaultArgs }, ExtArgs["result"]["invitation"]> @@ -679,7 +679,7 @@ export type InvitationSelectCreateManyAndReturn + house?: boolean | Prisma.HouseDefaultArgs user?: boolean | Prisma.UserDefaultArgs }, ExtArgs["result"]["invitation"]> @@ -692,7 +692,7 @@ export type InvitationSelectUpdateManyAndReturn + house?: boolean | Prisma.HouseDefaultArgs user?: boolean | Prisma.UserDefaultArgs }, ExtArgs["result"]["invitation"]> @@ -709,22 +709,22 @@ export type InvitationSelectScalar = { export type InvitationOmit = runtime.Types.Extensions.GetOmit<"id" | "organizationId" | "email" | "role" | "status" | "expiresAt" | "createdAt" | "inviterId", ExtArgs["result"]["invitation"]> export type InvitationInclude = { - organization?: boolean | Prisma.OrganizationDefaultArgs + house?: boolean | Prisma.HouseDefaultArgs user?: boolean | Prisma.UserDefaultArgs } export type InvitationIncludeCreateManyAndReturn = { - organization?: boolean | Prisma.OrganizationDefaultArgs + house?: boolean | Prisma.HouseDefaultArgs user?: boolean | Prisma.UserDefaultArgs } export type InvitationIncludeUpdateManyAndReturn = { - organization?: boolean | Prisma.OrganizationDefaultArgs + house?: boolean | Prisma.HouseDefaultArgs user?: boolean | Prisma.UserDefaultArgs } export type $InvitationPayload = { name: "Invitation" objects: { - organization: Prisma.$OrganizationPayload + house: Prisma.$HousePayload user: Prisma.$UserPayload } scalars: runtime.Types.Extensions.GetPayloadResult<{ @@ -1130,7 +1130,7 @@ readonly fields: InvitationFieldRefs; */ export interface Prisma__InvitationClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" - organization = {}>(args?: Prisma.Subset>): Prisma.Prisma__OrganizationClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + house = {}>(args?: Prisma.Subset>): Prisma.Prisma__HouseClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> user = {}>(args?: Prisma.Subset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> /** * Attaches callbacks for the resolution and/or rejection of the Promise. diff --git a/src/generated/prisma/models/Member.ts b/src/generated/prisma/models/Member.ts index 68b9b12..572a79e 100644 --- a/src/generated/prisma/models/Member.ts +++ b/src/generated/prisma/models/Member.ts @@ -182,7 +182,7 @@ export type MemberWhereInput = { userId?: Prisma.StringFilter<"Member"> | string role?: Prisma.StringFilter<"Member"> | string createdAt?: Prisma.DateTimeFilter<"Member"> | Date | string - organization?: Prisma.XOR + house?: Prisma.XOR user?: Prisma.XOR } @@ -192,7 +192,7 @@ export type MemberOrderByWithRelationInput = { userId?: Prisma.SortOrder role?: Prisma.SortOrder createdAt?: Prisma.SortOrder - organization?: Prisma.OrganizationOrderByWithRelationInput + house?: Prisma.HouseOrderByWithRelationInput user?: Prisma.UserOrderByWithRelationInput } @@ -205,7 +205,7 @@ export type MemberWhereUniqueInput = Prisma.AtLeast<{ userId?: Prisma.StringFilter<"Member"> | string role?: Prisma.StringFilter<"Member"> | string createdAt?: Prisma.DateTimeFilter<"Member"> | Date | string - organization?: Prisma.XOR + house?: Prisma.XOR user?: Prisma.XOR }, "id"> @@ -235,7 +235,7 @@ export type MemberCreateInput = { id?: string role?: string createdAt: Date | string - organization: Prisma.OrganizationCreateNestedOneWithoutMembersInput + house: Prisma.HouseCreateNestedOneWithoutMembersInput user: Prisma.UserCreateNestedOneWithoutMembersInput } @@ -251,7 +251,7 @@ export type MemberUpdateInput = { id?: Prisma.StringFieldUpdateOperationsInput | string role?: Prisma.StringFieldUpdateOperationsInput | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - organization?: Prisma.OrganizationUpdateOneRequiredWithoutMembersNestedInput + house?: Prisma.HouseUpdateOneRequiredWithoutMembersNestedInput user?: Prisma.UserUpdateOneRequiredWithoutMembersNestedInput } @@ -361,45 +361,45 @@ export type MemberUncheckedUpdateManyWithoutUserNestedInput = { deleteMany?: Prisma.MemberScalarWhereInput | Prisma.MemberScalarWhereInput[] } -export type MemberCreateNestedManyWithoutOrganizationInput = { - create?: Prisma.XOR | Prisma.MemberCreateWithoutOrganizationInput[] | Prisma.MemberUncheckedCreateWithoutOrganizationInput[] - connectOrCreate?: Prisma.MemberCreateOrConnectWithoutOrganizationInput | Prisma.MemberCreateOrConnectWithoutOrganizationInput[] - createMany?: Prisma.MemberCreateManyOrganizationInputEnvelope +export type MemberCreateNestedManyWithoutHouseInput = { + create?: Prisma.XOR | Prisma.MemberCreateWithoutHouseInput[] | Prisma.MemberUncheckedCreateWithoutHouseInput[] + connectOrCreate?: Prisma.MemberCreateOrConnectWithoutHouseInput | Prisma.MemberCreateOrConnectWithoutHouseInput[] + createMany?: Prisma.MemberCreateManyHouseInputEnvelope connect?: Prisma.MemberWhereUniqueInput | Prisma.MemberWhereUniqueInput[] } -export type MemberUncheckedCreateNestedManyWithoutOrganizationInput = { - create?: Prisma.XOR | Prisma.MemberCreateWithoutOrganizationInput[] | Prisma.MemberUncheckedCreateWithoutOrganizationInput[] - connectOrCreate?: Prisma.MemberCreateOrConnectWithoutOrganizationInput | Prisma.MemberCreateOrConnectWithoutOrganizationInput[] - createMany?: Prisma.MemberCreateManyOrganizationInputEnvelope +export type MemberUncheckedCreateNestedManyWithoutHouseInput = { + create?: Prisma.XOR | Prisma.MemberCreateWithoutHouseInput[] | Prisma.MemberUncheckedCreateWithoutHouseInput[] + connectOrCreate?: Prisma.MemberCreateOrConnectWithoutHouseInput | Prisma.MemberCreateOrConnectWithoutHouseInput[] + createMany?: Prisma.MemberCreateManyHouseInputEnvelope connect?: Prisma.MemberWhereUniqueInput | Prisma.MemberWhereUniqueInput[] } -export type MemberUpdateManyWithoutOrganizationNestedInput = { - create?: Prisma.XOR | Prisma.MemberCreateWithoutOrganizationInput[] | Prisma.MemberUncheckedCreateWithoutOrganizationInput[] - connectOrCreate?: Prisma.MemberCreateOrConnectWithoutOrganizationInput | Prisma.MemberCreateOrConnectWithoutOrganizationInput[] - upsert?: Prisma.MemberUpsertWithWhereUniqueWithoutOrganizationInput | Prisma.MemberUpsertWithWhereUniqueWithoutOrganizationInput[] - createMany?: Prisma.MemberCreateManyOrganizationInputEnvelope +export type MemberUpdateManyWithoutHouseNestedInput = { + create?: Prisma.XOR | Prisma.MemberCreateWithoutHouseInput[] | Prisma.MemberUncheckedCreateWithoutHouseInput[] + connectOrCreate?: Prisma.MemberCreateOrConnectWithoutHouseInput | Prisma.MemberCreateOrConnectWithoutHouseInput[] + upsert?: Prisma.MemberUpsertWithWhereUniqueWithoutHouseInput | Prisma.MemberUpsertWithWhereUniqueWithoutHouseInput[] + createMany?: Prisma.MemberCreateManyHouseInputEnvelope set?: Prisma.MemberWhereUniqueInput | Prisma.MemberWhereUniqueInput[] disconnect?: Prisma.MemberWhereUniqueInput | Prisma.MemberWhereUniqueInput[] delete?: Prisma.MemberWhereUniqueInput | Prisma.MemberWhereUniqueInput[] connect?: Prisma.MemberWhereUniqueInput | Prisma.MemberWhereUniqueInput[] - update?: Prisma.MemberUpdateWithWhereUniqueWithoutOrganizationInput | Prisma.MemberUpdateWithWhereUniqueWithoutOrganizationInput[] - updateMany?: Prisma.MemberUpdateManyWithWhereWithoutOrganizationInput | Prisma.MemberUpdateManyWithWhereWithoutOrganizationInput[] + update?: Prisma.MemberUpdateWithWhereUniqueWithoutHouseInput | Prisma.MemberUpdateWithWhereUniqueWithoutHouseInput[] + updateMany?: Prisma.MemberUpdateManyWithWhereWithoutHouseInput | Prisma.MemberUpdateManyWithWhereWithoutHouseInput[] deleteMany?: Prisma.MemberScalarWhereInput | Prisma.MemberScalarWhereInput[] } -export type MemberUncheckedUpdateManyWithoutOrganizationNestedInput = { - create?: Prisma.XOR | Prisma.MemberCreateWithoutOrganizationInput[] | Prisma.MemberUncheckedCreateWithoutOrganizationInput[] - connectOrCreate?: Prisma.MemberCreateOrConnectWithoutOrganizationInput | Prisma.MemberCreateOrConnectWithoutOrganizationInput[] - upsert?: Prisma.MemberUpsertWithWhereUniqueWithoutOrganizationInput | Prisma.MemberUpsertWithWhereUniqueWithoutOrganizationInput[] - createMany?: Prisma.MemberCreateManyOrganizationInputEnvelope +export type MemberUncheckedUpdateManyWithoutHouseNestedInput = { + create?: Prisma.XOR | Prisma.MemberCreateWithoutHouseInput[] | Prisma.MemberUncheckedCreateWithoutHouseInput[] + connectOrCreate?: Prisma.MemberCreateOrConnectWithoutHouseInput | Prisma.MemberCreateOrConnectWithoutHouseInput[] + upsert?: Prisma.MemberUpsertWithWhereUniqueWithoutHouseInput | Prisma.MemberUpsertWithWhereUniqueWithoutHouseInput[] + createMany?: Prisma.MemberCreateManyHouseInputEnvelope set?: Prisma.MemberWhereUniqueInput | Prisma.MemberWhereUniqueInput[] disconnect?: Prisma.MemberWhereUniqueInput | Prisma.MemberWhereUniqueInput[] delete?: Prisma.MemberWhereUniqueInput | Prisma.MemberWhereUniqueInput[] connect?: Prisma.MemberWhereUniqueInput | Prisma.MemberWhereUniqueInput[] - update?: Prisma.MemberUpdateWithWhereUniqueWithoutOrganizationInput | Prisma.MemberUpdateWithWhereUniqueWithoutOrganizationInput[] - updateMany?: Prisma.MemberUpdateManyWithWhereWithoutOrganizationInput | Prisma.MemberUpdateManyWithWhereWithoutOrganizationInput[] + update?: Prisma.MemberUpdateWithWhereUniqueWithoutHouseInput | Prisma.MemberUpdateWithWhereUniqueWithoutHouseInput[] + updateMany?: Prisma.MemberUpdateManyWithWhereWithoutHouseInput | Prisma.MemberUpdateManyWithWhereWithoutHouseInput[] deleteMany?: Prisma.MemberScalarWhereInput | Prisma.MemberScalarWhereInput[] } @@ -407,7 +407,7 @@ export type MemberCreateWithoutUserInput = { id?: string role?: string createdAt: Date | string - organization: Prisma.OrganizationCreateNestedOneWithoutMembersInput + house: Prisma.HouseCreateNestedOneWithoutMembersInput } export type MemberUncheckedCreateWithoutUserInput = { @@ -454,44 +454,44 @@ export type MemberScalarWhereInput = { createdAt?: Prisma.DateTimeFilter<"Member"> | Date | string } -export type MemberCreateWithoutOrganizationInput = { +export type MemberCreateWithoutHouseInput = { id?: string role?: string createdAt: Date | string user: Prisma.UserCreateNestedOneWithoutMembersInput } -export type MemberUncheckedCreateWithoutOrganizationInput = { +export type MemberUncheckedCreateWithoutHouseInput = { id?: string userId: string role?: string createdAt: Date | string } -export type MemberCreateOrConnectWithoutOrganizationInput = { +export type MemberCreateOrConnectWithoutHouseInput = { where: Prisma.MemberWhereUniqueInput - create: Prisma.XOR + create: Prisma.XOR } -export type MemberCreateManyOrganizationInputEnvelope = { - data: Prisma.MemberCreateManyOrganizationInput | Prisma.MemberCreateManyOrganizationInput[] +export type MemberCreateManyHouseInputEnvelope = { + data: Prisma.MemberCreateManyHouseInput | Prisma.MemberCreateManyHouseInput[] skipDuplicates?: boolean } -export type MemberUpsertWithWhereUniqueWithoutOrganizationInput = { +export type MemberUpsertWithWhereUniqueWithoutHouseInput = { where: Prisma.MemberWhereUniqueInput - update: Prisma.XOR - create: Prisma.XOR + update: Prisma.XOR + create: Prisma.XOR } -export type MemberUpdateWithWhereUniqueWithoutOrganizationInput = { +export type MemberUpdateWithWhereUniqueWithoutHouseInput = { where: Prisma.MemberWhereUniqueInput - data: Prisma.XOR + data: Prisma.XOR } -export type MemberUpdateManyWithWhereWithoutOrganizationInput = { +export type MemberUpdateManyWithWhereWithoutHouseInput = { where: Prisma.MemberScalarWhereInput - data: Prisma.XOR + data: Prisma.XOR } export type MemberCreateManyUserInput = { @@ -505,7 +505,7 @@ export type MemberUpdateWithoutUserInput = { id?: Prisma.StringFieldUpdateOperationsInput | string role?: Prisma.StringFieldUpdateOperationsInput | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - organization?: Prisma.OrganizationUpdateOneRequiredWithoutMembersNestedInput + house?: Prisma.HouseUpdateOneRequiredWithoutMembersNestedInput } export type MemberUncheckedUpdateWithoutUserInput = { @@ -522,28 +522,28 @@ export type MemberUncheckedUpdateManyWithoutUserInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } -export type MemberCreateManyOrganizationInput = { +export type MemberCreateManyHouseInput = { id?: string userId: string role?: string createdAt: Date | string } -export type MemberUpdateWithoutOrganizationInput = { +export type MemberUpdateWithoutHouseInput = { id?: Prisma.StringFieldUpdateOperationsInput | string role?: Prisma.StringFieldUpdateOperationsInput | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string user?: Prisma.UserUpdateOneRequiredWithoutMembersNestedInput } -export type MemberUncheckedUpdateWithoutOrganizationInput = { +export type MemberUncheckedUpdateWithoutHouseInput = { id?: Prisma.StringFieldUpdateOperationsInput | string userId?: Prisma.StringFieldUpdateOperationsInput | string role?: Prisma.StringFieldUpdateOperationsInput | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } -export type MemberUncheckedUpdateManyWithoutOrganizationInput = { +export type MemberUncheckedUpdateManyWithoutHouseInput = { id?: Prisma.StringFieldUpdateOperationsInput | string userId?: Prisma.StringFieldUpdateOperationsInput | string role?: Prisma.StringFieldUpdateOperationsInput | string @@ -558,7 +558,7 @@ export type MemberSelect + house?: boolean | Prisma.HouseDefaultArgs user?: boolean | Prisma.UserDefaultArgs }, ExtArgs["result"]["member"]> @@ -568,7 +568,7 @@ export type MemberSelectCreateManyAndReturn + house?: boolean | Prisma.HouseDefaultArgs user?: boolean | Prisma.UserDefaultArgs }, ExtArgs["result"]["member"]> @@ -578,7 +578,7 @@ export type MemberSelectUpdateManyAndReturn + house?: boolean | Prisma.HouseDefaultArgs user?: boolean | Prisma.UserDefaultArgs }, ExtArgs["result"]["member"]> @@ -592,22 +592,22 @@ export type MemberSelectScalar = { export type MemberOmit = runtime.Types.Extensions.GetOmit<"id" | "organizationId" | "userId" | "role" | "createdAt", ExtArgs["result"]["member"]> export type MemberInclude = { - organization?: boolean | Prisma.OrganizationDefaultArgs + house?: boolean | Prisma.HouseDefaultArgs user?: boolean | Prisma.UserDefaultArgs } export type MemberIncludeCreateManyAndReturn = { - organization?: boolean | Prisma.OrganizationDefaultArgs + house?: boolean | Prisma.HouseDefaultArgs user?: boolean | Prisma.UserDefaultArgs } export type MemberIncludeUpdateManyAndReturn = { - organization?: boolean | Prisma.OrganizationDefaultArgs + house?: boolean | Prisma.HouseDefaultArgs user?: boolean | Prisma.UserDefaultArgs } export type $MemberPayload = { name: "Member" objects: { - organization: Prisma.$OrganizationPayload + house: Prisma.$HousePayload user: Prisma.$UserPayload } scalars: runtime.Types.Extensions.GetPayloadResult<{ @@ -1010,7 +1010,7 @@ readonly fields: MemberFieldRefs; */ export interface Prisma__MemberClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" - organization = {}>(args?: Prisma.Subset>): Prisma.Prisma__OrganizationClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + house = {}>(args?: Prisma.Subset>): Prisma.Prisma__HouseClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> user = {}>(args?: Prisma.Subset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> /** * Attaches callbacks for the resolution and/or rejection of the Promise. diff --git a/src/generated/prisma/models/Organization.ts b/src/generated/prisma/models/Organization.ts deleted file mode 100644 index 4afae39..0000000 --- a/src/generated/prisma/models/Organization.ts +++ /dev/null @@ -1,1508 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * This file exports the `Organization` 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 Organization - * - */ -export type OrganizationModel = runtime.Types.Result.DefaultSelection - -export type AggregateOrganization = { - _count: OrganizationCountAggregateOutputType | null - _min: OrganizationMinAggregateOutputType | null - _max: OrganizationMaxAggregateOutputType | null -} - -export type OrganizationMinAggregateOutputType = { - id: string | null - name: string | null - slug: string | null - logo: string | null - createdAt: Date | null - metadata: string | null - color: string | null -} - -export type OrganizationMaxAggregateOutputType = { - id: string | null - name: string | null - slug: string | null - logo: string | null - createdAt: Date | null - metadata: string | null - color: string | null -} - -export type OrganizationCountAggregateOutputType = { - id: number - name: number - slug: number - logo: number - createdAt: number - metadata: number - color: number - _all: number -} - - -export type OrganizationMinAggregateInputType = { - id?: true - name?: true - slug?: true - logo?: true - createdAt?: true - metadata?: true - color?: true -} - -export type OrganizationMaxAggregateInputType = { - id?: true - name?: true - slug?: true - logo?: true - createdAt?: true - metadata?: true - color?: true -} - -export type OrganizationCountAggregateInputType = { - id?: true - name?: true - slug?: true - logo?: true - createdAt?: true - metadata?: true - color?: true - _all?: true -} - -export type OrganizationAggregateArgs = { - /** - * Filter which Organization to aggregate. - */ - where?: Prisma.OrganizationWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Organizations to fetch. - */ - orderBy?: Prisma.OrganizationOrderByWithRelationInput | Prisma.OrganizationOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: Prisma.OrganizationWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Organizations 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` Organizations. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned Organizations - **/ - _count?: true | OrganizationCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: OrganizationMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: OrganizationMaxAggregateInputType -} - -export type GetOrganizationAggregateType = { - [P in keyof T & keyof AggregateOrganization]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType -} - - - - -export type OrganizationGroupByArgs = { - where?: Prisma.OrganizationWhereInput - orderBy?: Prisma.OrganizationOrderByWithAggregationInput | Prisma.OrganizationOrderByWithAggregationInput[] - by: Prisma.OrganizationScalarFieldEnum[] | Prisma.OrganizationScalarFieldEnum - having?: Prisma.OrganizationScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: OrganizationCountAggregateInputType | true - _min?: OrganizationMinAggregateInputType - _max?: OrganizationMaxAggregateInputType -} - -export type OrganizationGroupByOutputType = { - id: string - name: string - slug: string - logo: string | null - createdAt: Date - metadata: string | null - color: string | null - _count: OrganizationCountAggregateOutputType | null - _min: OrganizationMinAggregateOutputType | null - _max: OrganizationMaxAggregateOutputType | null -} - -type GetOrganizationGroupByPayload = Prisma.PrismaPromise< - Array< - Prisma.PickEnumerable & - { - [P in ((keyof T) & (keyof OrganizationGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType - } - > - > - - - -export type OrganizationWhereInput = { - AND?: Prisma.OrganizationWhereInput | Prisma.OrganizationWhereInput[] - OR?: Prisma.OrganizationWhereInput[] - NOT?: Prisma.OrganizationWhereInput | Prisma.OrganizationWhereInput[] - id?: Prisma.StringFilter<"Organization"> | string - name?: Prisma.StringFilter<"Organization"> | string - slug?: Prisma.StringFilter<"Organization"> | string - logo?: Prisma.StringNullableFilter<"Organization"> | string | null - createdAt?: Prisma.DateTimeFilter<"Organization"> | Date | string - metadata?: Prisma.StringNullableFilter<"Organization"> | string | null - color?: Prisma.StringNullableFilter<"Organization"> | string | null - members?: Prisma.MemberListRelationFilter - invitations?: Prisma.InvitationListRelationFilter -} - -export type OrganizationOrderByWithRelationInput = { - id?: Prisma.SortOrder - name?: Prisma.SortOrder - slug?: Prisma.SortOrder - logo?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - metadata?: Prisma.SortOrderInput | Prisma.SortOrder - color?: Prisma.SortOrderInput | Prisma.SortOrder - members?: Prisma.MemberOrderByRelationAggregateInput - invitations?: Prisma.InvitationOrderByRelationAggregateInput -} - -export type OrganizationWhereUniqueInput = Prisma.AtLeast<{ - id?: string - slug?: string - AND?: Prisma.OrganizationWhereInput | Prisma.OrganizationWhereInput[] - OR?: Prisma.OrganizationWhereInput[] - NOT?: Prisma.OrganizationWhereInput | Prisma.OrganizationWhereInput[] - name?: Prisma.StringFilter<"Organization"> | string - logo?: Prisma.StringNullableFilter<"Organization"> | string | null - createdAt?: Prisma.DateTimeFilter<"Organization"> | Date | string - metadata?: Prisma.StringNullableFilter<"Organization"> | string | null - color?: Prisma.StringNullableFilter<"Organization"> | string | null - members?: Prisma.MemberListRelationFilter - invitations?: Prisma.InvitationListRelationFilter -}, "id" | "slug"> - -export type OrganizationOrderByWithAggregationInput = { - id?: Prisma.SortOrder - name?: Prisma.SortOrder - slug?: Prisma.SortOrder - logo?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - metadata?: Prisma.SortOrderInput | Prisma.SortOrder - color?: Prisma.SortOrderInput | Prisma.SortOrder - _count?: Prisma.OrganizationCountOrderByAggregateInput - _max?: Prisma.OrganizationMaxOrderByAggregateInput - _min?: Prisma.OrganizationMinOrderByAggregateInput -} - -export type OrganizationScalarWhereWithAggregatesInput = { - AND?: Prisma.OrganizationScalarWhereWithAggregatesInput | Prisma.OrganizationScalarWhereWithAggregatesInput[] - OR?: Prisma.OrganizationScalarWhereWithAggregatesInput[] - NOT?: Prisma.OrganizationScalarWhereWithAggregatesInput | Prisma.OrganizationScalarWhereWithAggregatesInput[] - id?: Prisma.StringWithAggregatesFilter<"Organization"> | string - name?: Prisma.StringWithAggregatesFilter<"Organization"> | string - slug?: Prisma.StringWithAggregatesFilter<"Organization"> | string - logo?: Prisma.StringNullableWithAggregatesFilter<"Organization"> | string | null - createdAt?: Prisma.DateTimeWithAggregatesFilter<"Organization"> | Date | string - metadata?: Prisma.StringNullableWithAggregatesFilter<"Organization"> | string | null - color?: Prisma.StringNullableWithAggregatesFilter<"Organization"> | string | null -} - -export type OrganizationCreateInput = { - id?: string - name: string - slug: string - logo?: string | null - createdAt: Date | string - metadata?: string | null - color?: string | null - members?: Prisma.MemberCreateNestedManyWithoutOrganizationInput - invitations?: Prisma.InvitationCreateNestedManyWithoutOrganizationInput -} - -export type OrganizationUncheckedCreateInput = { - id?: string - name: string - slug: string - logo?: string | null - createdAt: Date | string - metadata?: string | null - color?: string | null - members?: Prisma.MemberUncheckedCreateNestedManyWithoutOrganizationInput - invitations?: Prisma.InvitationUncheckedCreateNestedManyWithoutOrganizationInput -} - -export type OrganizationUpdateInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - slug?: Prisma.StringFieldUpdateOperationsInput | string - logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - members?: Prisma.MemberUpdateManyWithoutOrganizationNestedInput - invitations?: Prisma.InvitationUpdateManyWithoutOrganizationNestedInput -} - -export type OrganizationUncheckedUpdateInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - slug?: Prisma.StringFieldUpdateOperationsInput | string - logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - members?: Prisma.MemberUncheckedUpdateManyWithoutOrganizationNestedInput - invitations?: Prisma.InvitationUncheckedUpdateManyWithoutOrganizationNestedInput -} - -export type OrganizationCreateManyInput = { - id?: string - name: string - slug: string - logo?: string | null - createdAt: Date | string - metadata?: string | null - color?: string | null -} - -export type OrganizationUpdateManyMutationInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - slug?: Prisma.StringFieldUpdateOperationsInput | string - logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null -} - -export type OrganizationUncheckedUpdateManyInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - slug?: Prisma.StringFieldUpdateOperationsInput | string - logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null -} - -export type OrganizationCountOrderByAggregateInput = { - id?: Prisma.SortOrder - name?: Prisma.SortOrder - slug?: Prisma.SortOrder - logo?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - metadata?: Prisma.SortOrder - color?: Prisma.SortOrder -} - -export type OrganizationMaxOrderByAggregateInput = { - id?: Prisma.SortOrder - name?: Prisma.SortOrder - slug?: Prisma.SortOrder - logo?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - metadata?: Prisma.SortOrder - color?: Prisma.SortOrder -} - -export type OrganizationMinOrderByAggregateInput = { - id?: Prisma.SortOrder - name?: Prisma.SortOrder - slug?: Prisma.SortOrder - logo?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - metadata?: Prisma.SortOrder - color?: Prisma.SortOrder -} - -export type OrganizationScalarRelationFilter = { - is?: Prisma.OrganizationWhereInput - isNot?: Prisma.OrganizationWhereInput -} - -export type OrganizationCreateNestedOneWithoutMembersInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.OrganizationCreateOrConnectWithoutMembersInput - connect?: Prisma.OrganizationWhereUniqueInput -} - -export type OrganizationUpdateOneRequiredWithoutMembersNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.OrganizationCreateOrConnectWithoutMembersInput - upsert?: Prisma.OrganizationUpsertWithoutMembersInput - connect?: Prisma.OrganizationWhereUniqueInput - update?: Prisma.XOR, Prisma.OrganizationUncheckedUpdateWithoutMembersInput> -} - -export type OrganizationCreateNestedOneWithoutInvitationsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.OrganizationCreateOrConnectWithoutInvitationsInput - connect?: Prisma.OrganizationWhereUniqueInput -} - -export type OrganizationUpdateOneRequiredWithoutInvitationsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.OrganizationCreateOrConnectWithoutInvitationsInput - upsert?: Prisma.OrganizationUpsertWithoutInvitationsInput - connect?: Prisma.OrganizationWhereUniqueInput - update?: Prisma.XOR, Prisma.OrganizationUncheckedUpdateWithoutInvitationsInput> -} - -export type OrganizationCreateWithoutMembersInput = { - id?: string - name: string - slug: string - logo?: string | null - createdAt: Date | string - metadata?: string | null - color?: string | null - invitations?: Prisma.InvitationCreateNestedManyWithoutOrganizationInput -} - -export type OrganizationUncheckedCreateWithoutMembersInput = { - id?: string - name: string - slug: string - logo?: string | null - createdAt: Date | string - metadata?: string | null - color?: string | null - invitations?: Prisma.InvitationUncheckedCreateNestedManyWithoutOrganizationInput -} - -export type OrganizationCreateOrConnectWithoutMembersInput = { - where: Prisma.OrganizationWhereUniqueInput - create: Prisma.XOR -} - -export type OrganizationUpsertWithoutMembersInput = { - update: Prisma.XOR - create: Prisma.XOR - where?: Prisma.OrganizationWhereInput -} - -export type OrganizationUpdateToOneWithWhereWithoutMembersInput = { - where?: Prisma.OrganizationWhereInput - data: Prisma.XOR -} - -export type OrganizationUpdateWithoutMembersInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - slug?: Prisma.StringFieldUpdateOperationsInput | string - logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - invitations?: Prisma.InvitationUpdateManyWithoutOrganizationNestedInput -} - -export type OrganizationUncheckedUpdateWithoutMembersInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - slug?: Prisma.StringFieldUpdateOperationsInput | string - logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - invitations?: Prisma.InvitationUncheckedUpdateManyWithoutOrganizationNestedInput -} - -export type OrganizationCreateWithoutInvitationsInput = { - id?: string - name: string - slug: string - logo?: string | null - createdAt: Date | string - metadata?: string | null - color?: string | null - members?: Prisma.MemberCreateNestedManyWithoutOrganizationInput -} - -export type OrganizationUncheckedCreateWithoutInvitationsInput = { - id?: string - name: string - slug: string - logo?: string | null - createdAt: Date | string - metadata?: string | null - color?: string | null - members?: Prisma.MemberUncheckedCreateNestedManyWithoutOrganizationInput -} - -export type OrganizationCreateOrConnectWithoutInvitationsInput = { - where: Prisma.OrganizationWhereUniqueInput - create: Prisma.XOR -} - -export type OrganizationUpsertWithoutInvitationsInput = { - update: Prisma.XOR - create: Prisma.XOR - where?: Prisma.OrganizationWhereInput -} - -export type OrganizationUpdateToOneWithWhereWithoutInvitationsInput = { - where?: Prisma.OrganizationWhereInput - data: Prisma.XOR -} - -export type OrganizationUpdateWithoutInvitationsInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - slug?: Prisma.StringFieldUpdateOperationsInput | string - logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - members?: Prisma.MemberUpdateManyWithoutOrganizationNestedInput -} - -export type OrganizationUncheckedUpdateWithoutInvitationsInput = { - id?: Prisma.StringFieldUpdateOperationsInput | string - name?: Prisma.StringFieldUpdateOperationsInput | string - slug?: Prisma.StringFieldUpdateOperationsInput | string - logo?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - color?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - members?: Prisma.MemberUncheckedUpdateManyWithoutOrganizationNestedInput -} - - -/** - * Count Type OrganizationCountOutputType - */ - -export type OrganizationCountOutputType = { - members: number - invitations: number -} - -export type OrganizationCountOutputTypeSelect = { - members?: boolean | OrganizationCountOutputTypeCountMembersArgs - invitations?: boolean | OrganizationCountOutputTypeCountInvitationsArgs -} - -/** - * OrganizationCountOutputType without action - */ -export type OrganizationCountOutputTypeDefaultArgs = { - /** - * Select specific fields to fetch from the OrganizationCountOutputType - */ - select?: Prisma.OrganizationCountOutputTypeSelect | null -} - -/** - * OrganizationCountOutputType without action - */ -export type OrganizationCountOutputTypeCountMembersArgs = { - where?: Prisma.MemberWhereInput -} - -/** - * OrganizationCountOutputType without action - */ -export type OrganizationCountOutputTypeCountInvitationsArgs = { - where?: Prisma.InvitationWhereInput -} - - -export type OrganizationSelect = runtime.Types.Extensions.GetSelect<{ - id?: boolean - name?: boolean - slug?: boolean - logo?: boolean - createdAt?: boolean - metadata?: boolean - color?: boolean - members?: boolean | Prisma.Organization$membersArgs - invitations?: boolean | Prisma.Organization$invitationsArgs - _count?: boolean | Prisma.OrganizationCountOutputTypeDefaultArgs -}, ExtArgs["result"]["organization"]> - -export type OrganizationSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ - id?: boolean - name?: boolean - slug?: boolean - logo?: boolean - createdAt?: boolean - metadata?: boolean - color?: boolean -}, ExtArgs["result"]["organization"]> - -export type OrganizationSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ - id?: boolean - name?: boolean - slug?: boolean - logo?: boolean - createdAt?: boolean - metadata?: boolean - color?: boolean -}, ExtArgs["result"]["organization"]> - -export type OrganizationSelectScalar = { - id?: boolean - name?: boolean - slug?: boolean - logo?: boolean - createdAt?: boolean - metadata?: boolean - color?: boolean -} - -export type OrganizationOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "slug" | "logo" | "createdAt" | "metadata" | "color", ExtArgs["result"]["organization"]> -export type OrganizationInclude = { - members?: boolean | Prisma.Organization$membersArgs - invitations?: boolean | Prisma.Organization$invitationsArgs - _count?: boolean | Prisma.OrganizationCountOutputTypeDefaultArgs -} -export type OrganizationIncludeCreateManyAndReturn = {} -export type OrganizationIncludeUpdateManyAndReturn = {} - -export type $OrganizationPayload = { - name: "Organization" - objects: { - members: Prisma.$MemberPayload[] - invitations: Prisma.$InvitationPayload[] - } - scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: string - name: string - slug: string - logo: string | null - createdAt: Date - metadata: string | null - color: string | null - }, ExtArgs["result"]["organization"]> - composites: {} -} - -export type OrganizationGetPayload = runtime.Types.Result.GetResult - -export type OrganizationCountArgs = - Omit & { - select?: OrganizationCountAggregateInputType | true - } - -export interface OrganizationDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['Organization'], meta: { name: 'Organization' } } - /** - * Find zero or one Organization that matches the filter. - * @param {OrganizationFindUniqueArgs} args - Arguments to find a Organization - * @example - * // Get one Organization - * const organization = await prisma.organization.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__OrganizationClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find one Organization that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {OrganizationFindUniqueOrThrowArgs} args - Arguments to find a Organization - * @example - * // Get one Organization - * const organization = await prisma.organization.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__OrganizationClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find the first Organization 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 {OrganizationFindFirstArgs} args - Arguments to find a Organization - * @example - * // Get one Organization - * const organization = await prisma.organization.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__OrganizationClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find the first Organization 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 {OrganizationFindFirstOrThrowArgs} args - Arguments to find a Organization - * @example - * // Get one Organization - * const organization = await prisma.organization.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__OrganizationClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find zero or more Organizations 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 {OrganizationFindManyArgs} args - Arguments to filter and select certain fields only. - * @example - * // Get all Organizations - * const organizations = await prisma.organization.findMany() - * - * // Get first 10 Organizations - * const organizations = await prisma.organization.findMany({ take: 10 }) - * - * // Only select the `id` - * const organizationWithIdOnly = await prisma.organization.findMany({ select: { id: true } }) - * - */ - findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> - - /** - * Create a Organization. - * @param {OrganizationCreateArgs} args - Arguments to create a Organization. - * @example - * // Create one Organization - * const Organization = await prisma.organization.create({ - * data: { - * // ... data to create a Organization - * } - * }) - * - */ - create(args: Prisma.SelectSubset>): Prisma.Prisma__OrganizationClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Create many Organizations. - * @param {OrganizationCreateManyArgs} args - Arguments to create many Organizations. - * @example - * // Create many Organizations - * const organization = await prisma.organization.createMany({ - * data: [ - * // ... provide data here - * ] - * }) - * - */ - createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Create many Organizations and returns the data saved in the database. - * @param {OrganizationCreateManyAndReturnArgs} args - Arguments to create many Organizations. - * @example - * // Create many Organizations - * const organization = await prisma.organization.createManyAndReturn({ - * data: [ - * // ... provide data here - * ] - * }) - * - * // Create many Organizations and only return the `id` - * const organizationWithIdOnly = await prisma.organization.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 Organization. - * @param {OrganizationDeleteArgs} args - Arguments to delete one Organization. - * @example - * // Delete one Organization - * const Organization = await prisma.organization.delete({ - * where: { - * // ... filter to delete one Organization - * } - * }) - * - */ - delete(args: Prisma.SelectSubset>): Prisma.Prisma__OrganizationClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Update one Organization. - * @param {OrganizationUpdateArgs} args - Arguments to update one Organization. - * @example - * // Update one Organization - * const organization = await prisma.organization.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - update(args: Prisma.SelectSubset>): Prisma.Prisma__OrganizationClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Delete zero or more Organizations. - * @param {OrganizationDeleteManyArgs} args - Arguments to filter Organizations to delete. - * @example - * // Delete a few Organizations - * const { count } = await prisma.organization.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - */ - deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more Organizations. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {OrganizationUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many Organizations - * const organization = await prisma.organization.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more Organizations and returns the data updated in the database. - * @param {OrganizationUpdateManyAndReturnArgs} args - Arguments to update many Organizations. - * @example - * // Update many Organizations - * const organization = await prisma.organization.updateManyAndReturn({ - * where: { - * // ... provide filter here - * }, - * data: [ - * // ... provide data here - * ] - * }) - * - * // Update zero or more Organizations and only return the `id` - * const organizationWithIdOnly = await prisma.organization.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 Organization. - * @param {OrganizationUpsertArgs} args - Arguments to update or create a Organization. - * @example - * // Update or create a Organization - * const organization = await prisma.organization.upsert({ - * create: { - * // ... data to create a Organization - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the Organization we want to update - * } - * }) - */ - upsert(args: Prisma.SelectSubset>): Prisma.Prisma__OrganizationClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - - /** - * Count the number of Organizations. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {OrganizationCountArgs} args - Arguments to filter Organizations to count. - * @example - * // Count the number of Organizations - * const count = await prisma.organization.count({ - * where: { - * // ... the filter for the Organizations 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 Organization. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {OrganizationAggregateArgs} 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 Organization. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {OrganizationGroupByArgs} 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 OrganizationGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: OrganizationGroupByArgs['orderBy'] } - : { orderBy?: OrganizationGroupByArgs['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 ? GetOrganizationGroupByPayload : Prisma.PrismaPromise -/** - * Fields of the Organization model - */ -readonly fields: OrganizationFieldRefs; -} - -/** - * The delegate class that acts as a "Promise-like" for Organization. - * 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__OrganizationClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: "PrismaPromise" - members = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> - invitations = {}>(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 Organization model - */ -export interface OrganizationFieldRefs { - readonly id: Prisma.FieldRef<"Organization", 'String'> - readonly name: Prisma.FieldRef<"Organization", 'String'> - readonly slug: Prisma.FieldRef<"Organization", 'String'> - readonly logo: Prisma.FieldRef<"Organization", 'String'> - readonly createdAt: Prisma.FieldRef<"Organization", 'DateTime'> - readonly metadata: Prisma.FieldRef<"Organization", 'String'> - readonly color: Prisma.FieldRef<"Organization", 'String'> -} - - -// Custom InputTypes -/** - * Organization findUnique - */ -export type OrganizationFindUniqueArgs = { - /** - * Select specific fields to fetch from the Organization - */ - select?: Prisma.OrganizationSelect | null - /** - * Omit specific fields from the Organization - */ - omit?: Prisma.OrganizationOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.OrganizationInclude | null - /** - * Filter, which Organization to fetch. - */ - where: Prisma.OrganizationWhereUniqueInput -} - -/** - * Organization findUniqueOrThrow - */ -export type OrganizationFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the Organization - */ - select?: Prisma.OrganizationSelect | null - /** - * Omit specific fields from the Organization - */ - omit?: Prisma.OrganizationOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.OrganizationInclude | null - /** - * Filter, which Organization to fetch. - */ - where: Prisma.OrganizationWhereUniqueInput -} - -/** - * Organization findFirst - */ -export type OrganizationFindFirstArgs = { - /** - * Select specific fields to fetch from the Organization - */ - select?: Prisma.OrganizationSelect | null - /** - * Omit specific fields from the Organization - */ - omit?: Prisma.OrganizationOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.OrganizationInclude | null - /** - * Filter, which Organization to fetch. - */ - where?: Prisma.OrganizationWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Organizations to fetch. - */ - orderBy?: Prisma.OrganizationOrderByWithRelationInput | Prisma.OrganizationOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Organizations. - */ - cursor?: Prisma.OrganizationWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Organizations 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` Organizations. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Organizations. - */ - distinct?: Prisma.OrganizationScalarFieldEnum | Prisma.OrganizationScalarFieldEnum[] -} - -/** - * Organization findFirstOrThrow - */ -export type OrganizationFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the Organization - */ - select?: Prisma.OrganizationSelect | null - /** - * Omit specific fields from the Organization - */ - omit?: Prisma.OrganizationOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.OrganizationInclude | null - /** - * Filter, which Organization to fetch. - */ - where?: Prisma.OrganizationWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Organizations to fetch. - */ - orderBy?: Prisma.OrganizationOrderByWithRelationInput | Prisma.OrganizationOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Organizations. - */ - cursor?: Prisma.OrganizationWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Organizations 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` Organizations. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Organizations. - */ - distinct?: Prisma.OrganizationScalarFieldEnum | Prisma.OrganizationScalarFieldEnum[] -} - -/** - * Organization findMany - */ -export type OrganizationFindManyArgs = { - /** - * Select specific fields to fetch from the Organization - */ - select?: Prisma.OrganizationSelect | null - /** - * Omit specific fields from the Organization - */ - omit?: Prisma.OrganizationOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.OrganizationInclude | null - /** - * Filter, which Organizations to fetch. - */ - where?: Prisma.OrganizationWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Organizations to fetch. - */ - orderBy?: Prisma.OrganizationOrderByWithRelationInput | Prisma.OrganizationOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing Organizations. - */ - cursor?: Prisma.OrganizationWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Organizations 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` Organizations. - */ - skip?: number - distinct?: Prisma.OrganizationScalarFieldEnum | Prisma.OrganizationScalarFieldEnum[] -} - -/** - * Organization create - */ -export type OrganizationCreateArgs = { - /** - * Select specific fields to fetch from the Organization - */ - select?: Prisma.OrganizationSelect | null - /** - * Omit specific fields from the Organization - */ - omit?: Prisma.OrganizationOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.OrganizationInclude | null - /** - * The data needed to create a Organization. - */ - data: Prisma.XOR -} - -/** - * Organization createMany - */ -export type OrganizationCreateManyArgs = { - /** - * The data used to create many Organizations. - */ - data: Prisma.OrganizationCreateManyInput | Prisma.OrganizationCreateManyInput[] - skipDuplicates?: boolean -} - -/** - * Organization createManyAndReturn - */ -export type OrganizationCreateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the Organization - */ - select?: Prisma.OrganizationSelectCreateManyAndReturn | null - /** - * Omit specific fields from the Organization - */ - omit?: Prisma.OrganizationOmit | null - /** - * The data used to create many Organizations. - */ - data: Prisma.OrganizationCreateManyInput | Prisma.OrganizationCreateManyInput[] - skipDuplicates?: boolean -} - -/** - * Organization update - */ -export type OrganizationUpdateArgs = { - /** - * Select specific fields to fetch from the Organization - */ - select?: Prisma.OrganizationSelect | null - /** - * Omit specific fields from the Organization - */ - omit?: Prisma.OrganizationOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.OrganizationInclude | null - /** - * The data needed to update a Organization. - */ - data: Prisma.XOR - /** - * Choose, which Organization to update. - */ - where: Prisma.OrganizationWhereUniqueInput -} - -/** - * Organization updateMany - */ -export type OrganizationUpdateManyArgs = { - /** - * The data used to update Organizations. - */ - data: Prisma.XOR - /** - * Filter which Organizations to update - */ - where?: Prisma.OrganizationWhereInput - /** - * Limit how many Organizations to update. - */ - limit?: number -} - -/** - * Organization updateManyAndReturn - */ -export type OrganizationUpdateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the Organization - */ - select?: Prisma.OrganizationSelectUpdateManyAndReturn | null - /** - * Omit specific fields from the Organization - */ - omit?: Prisma.OrganizationOmit | null - /** - * The data used to update Organizations. - */ - data: Prisma.XOR - /** - * Filter which Organizations to update - */ - where?: Prisma.OrganizationWhereInput - /** - * Limit how many Organizations to update. - */ - limit?: number -} - -/** - * Organization upsert - */ -export type OrganizationUpsertArgs = { - /** - * Select specific fields to fetch from the Organization - */ - select?: Prisma.OrganizationSelect | null - /** - * Omit specific fields from the Organization - */ - omit?: Prisma.OrganizationOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.OrganizationInclude | null - /** - * The filter to search for the Organization to update in case it exists. - */ - where: Prisma.OrganizationWhereUniqueInput - /** - * In case the Organization found by the `where` argument doesn't exist, create a new Organization with this data. - */ - create: Prisma.XOR - /** - * In case the Organization was found with the provided `where` argument, update it with this data. - */ - update: Prisma.XOR -} - -/** - * Organization delete - */ -export type OrganizationDeleteArgs = { - /** - * Select specific fields to fetch from the Organization - */ - select?: Prisma.OrganizationSelect | null - /** - * Omit specific fields from the Organization - */ - omit?: Prisma.OrganizationOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.OrganizationInclude | null - /** - * Filter which Organization to delete. - */ - where: Prisma.OrganizationWhereUniqueInput -} - -/** - * Organization deleteMany - */ -export type OrganizationDeleteManyArgs = { - /** - * Filter which Organizations to delete - */ - where?: Prisma.OrganizationWhereInput - /** - * Limit how many Organizations to delete. - */ - limit?: number -} - -/** - * Organization.members - */ -export type Organization$membersArgs = { - /** - * Select specific fields to fetch from the Member - */ - select?: Prisma.MemberSelect | null - /** - * Omit specific fields from the Member - */ - omit?: Prisma.MemberOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.MemberInclude | null - where?: Prisma.MemberWhereInput - orderBy?: Prisma.MemberOrderByWithRelationInput | Prisma.MemberOrderByWithRelationInput[] - cursor?: Prisma.MemberWhereUniqueInput - take?: number - skip?: number - distinct?: Prisma.MemberScalarFieldEnum | Prisma.MemberScalarFieldEnum[] -} - -/** - * Organization.invitations - */ -export type Organization$invitationsArgs = { - /** - * Select specific fields to fetch from the Invitation - */ - select?: Prisma.InvitationSelect | null - /** - * Omit specific fields from the Invitation - */ - omit?: Prisma.InvitationOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.InvitationInclude | null - where?: Prisma.InvitationWhereInput - orderBy?: Prisma.InvitationOrderByWithRelationInput | Prisma.InvitationOrderByWithRelationInput[] - cursor?: Prisma.InvitationWhereUniqueInput - take?: number - skip?: number - distinct?: Prisma.InvitationScalarFieldEnum | Prisma.InvitationScalarFieldEnum[] -} - -/** - * Organization without action - */ -export type OrganizationDefaultArgs = { - /** - * Select specific fields to fetch from the Organization - */ - select?: Prisma.OrganizationSelect | null - /** - * Omit specific fields from the Organization - */ - omit?: Prisma.OrganizationOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.OrganizationInclude | null -} diff --git a/src/lib/auth-client.ts b/src/lib/auth-client.ts index 0cf71ae..d8452f8 100644 --- a/src/lib/auth-client.ts +++ b/src/lib/auth-client.ts @@ -21,6 +21,7 @@ export const authClient = createAuthClient({ roles: { owner, admin: adminOrg, member }, schema: { organization: { + modelName: 'house', additionalFields: { color: { type: 'string', diff --git a/src/lib/auth.ts b/src/lib/auth.ts index 3d30ce0..a7e2757 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -45,6 +45,7 @@ export const auth = betterAuth({ roles: { owner, admin: adminOrg, member }, schema: { organization: { + modelName: 'house', additionalFields: { color: { type: 'string', diff --git a/src/service/house.api.ts b/src/service/house.api.ts index 3b2fe08..dd03384 100644 --- a/src/service/house.api.ts +++ b/src/service/house.api.ts @@ -1,5 +1,5 @@ import { prisma } from '@/db'; -import { OrganizationWhereInput } from '@/generated/prisma/models'; +import { HouseWhereInput } from '@/generated/prisma/models'; import { DB_TABLE, LOG_ACTION, NOTIFICATION_TYPE } from '@/types/enum'; import { auth } from '@lib/auth'; import { parseError } from '@lib/errors'; @@ -25,7 +25,7 @@ export const getAllHouse = createServerFn({ method: 'GET' }) const { page, limit, keyword } = data; const skip = (page - 1) * limit; - const where: OrganizationWhereInput = { + const where: HouseWhereInput = { OR: [ { name: { @@ -37,7 +37,7 @@ export const getAllHouse = createServerFn({ method: 'GET' }) }; const [list, total]: [HouseWithMembers[], number] = await Promise.all([ - await prisma.organization.findMany({ + await prisma.house.findMany({ where, orderBy: { createdAt: 'desc' }, include: { @@ -58,7 +58,7 @@ export const getAllHouse = createServerFn({ method: 'GET' }) take: limit, skip, }), - await prisma.organization.count({ where }), + await prisma.house.count({ where }), ]); const totalPage = Math.ceil(+total / limit); @@ -82,7 +82,7 @@ export const getCurrentUserHouses = createServerFn({ method: 'GET' }) .middleware([authMiddleware]) .handler(async ({ context: { user } }) => { try { - const houses = await prisma.organization.findMany({ + const houses = await prisma.house.findMany({ where: { members: { some: { userId: user.id } } }, orderBy: { createdAt: 'asc' }, include: { @@ -148,13 +148,13 @@ export const updateHouse = createServerFn({ method: 'POST' }) .inputValidator(houseEditBESchema) .handler(async ({ data, context: { user } }) => { try { - const currentHouse = await prisma.organization.findUnique({ + const currentHouse = await prisma.house.findUnique({ where: { id: data.id }, }); if (!currentHouse) throw Error('House not found'); const { id, slug, name, color } = data; - const result = await prisma.organization.update({ + const result = await prisma.house.update({ where: { id }, data: { name, @@ -185,13 +185,13 @@ export const deleteHouse = createServerFn({ method: 'POST' }) .inputValidator(baseHouse) .handler(async ({ data, context: { user } }) => { try { - const currentHouse = await prisma.organization.findUnique({ + const currentHouse = await prisma.house.findUnique({ where: { id: data.id }, }); if (!currentHouse) throw Error('House not found'); const result = await Promise.all([ - prisma.organization.delete({ + prisma.house.delete({ where: { id: data.id }, }), prisma.member.deleteMany({ @@ -224,7 +224,7 @@ export const deleteUserHouse = createServerFn({ method: 'POST' }) .inputValidator(baseHouse) .handler(async ({ data, context: { user } }) => { try { - const currentHouse = await prisma.organization.findUnique({ + const currentHouse = await prisma.house.findUnique({ where: { id: data.id }, }); if (!currentHouse) throw Error('House not found'); @@ -271,7 +271,7 @@ export const invitationMember = createServerFn({ method: 'POST' }) const cuser = await prisma.user.findUnique({ where: { email: data.email }, }); - const chouse = await prisma.organization.findUnique({ + const chouse = await prisma.house.findUnique({ where: { id: data.houseId }, }); diff --git a/src/service/repository.ts b/src/service/repository.ts index 8c1d809..f34b834 100644 --- a/src/service/repository.ts +++ b/src/service/repository.ts @@ -50,7 +50,7 @@ export const createAuditLog = async (data: Omit) => { }; export const getInitialOrganization = async (userId: string) => { - const organization = await prisma.organization.findFirst({ + const organization = await prisma.house.findFirst({ where: { members: { some: { diff --git a/src/types/db.d.ts b/src/types/db.d.ts index c510ced..54e434f 100644 --- a/src/types/db.d.ts +++ b/src/types/db.d.ts @@ -12,7 +12,7 @@ declare global { }; }>; - type HouseWithMembers = Prisma.OrganizationGetPayload<{ + type HouseWithMembers = Prisma.HouseGetPayload<{ include: { members: { select: {