commit 9ae270609d395ce52ef526f9d7e357c3d7c4f100 Author: Jose Selesan Date: Wed Apr 8 22:53:11 2026 -0300 Initial commit diff --git a/.codex/environments/environment.toml b/.codex/environments/environment.toml new file mode 100644 index 0000000..f047be2 --- /dev/null +++ b/.codex/environments/environment.toml @@ -0,0 +1,11 @@ +# THIS IS AUTOGENERATED. DO NOT EDIT MANUALLY +version = 1 +name = "monorepo" + +[setup] +script = "" + +[[actions]] +name = "Run" +icon = "run" +command = "bun dev" diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..dead531 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +.git +.DS_Store +node_modules +**/node_modules +**/dist +**/.turbo +**/.cache +**/.vite +**/.next +coverage diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b6a2950 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +bun.lock +.DS_Store diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3c358ef --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "js/ts.tsdk.path": "node_modules/typescript/lib" +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..703177e --- /dev/null +++ b/README.md @@ -0,0 +1,184 @@ +# Monorepo (Frontend + Backend + Contrato API) + +Este repositorio contiene: + +- `apps/frontend`: app web en React + Vite + TanStack Router/Query. +- `apps/backend`: API en Bun + Hono + Prisma + Supabase Auth. +- `packages/api-contract`: contratos compartidos (schemas/types/rutas) entre frontend y backend. + +## Objetivo de este README + +Dejarte productivo/a en pocos minutos para que puedas: + +1. Levantar frontend y backend en local. +2. Configurar variables de entorno. +3. Ejecutar migraciones de base de datos. +4. Entender la estructura y el flujo de trabajo del proyecto. + +## Stack técnico + +- Runtime/package manager: `bun` +- Frontend: `React 19`, `Vite`, `TanStack Router`, `TanStack Query` +- Backend: `Bun`, `Hono`, `Prisma`, `PostgreSQL` +- Auth: `Supabase Auth` (token Bearer validado en backend) +- Validación de contratos: `zod` en `@repo/api-contract` + +## Prerrequisitos + +- `bun` instalado (versión reciente). +- `PostgreSQL` corriendo localmente (o accesible remotamente). +- Proyecto de `Supabase` para autenticación (URL + anon key). + +## Setup rápido + +1. Instalar dependencias desde la raíz: + +```sh +bun install +``` + +2. Configurar variables de entorno del backend: + +```sh +cp apps/backend/.env.example apps/backend/.env +``` + +3. Configurar variables de entorno del frontend: + +```sh +cp apps/frontend/.env.example apps/frontend/.env +``` + +4. Revisar/editar valores en ambos `.env` según tu entorno. + +## Variables de entorno + +### Backend (`apps/backend/.env`) + +Variables esperadas: + +- `SUPABASE_URL` +- `SUPABASE_ANON_KEY` +- `CORS_ORIGIN` (por defecto local frontend) +- `LOG_LEVEL` +- `DATABASE_URL` (PostgreSQL) + +Notas: + +- El backend también acepta `VITE_SUPABASE_URL` y `VITE_SUPABASE_ANON_KEY` como fallback. +- Si falta `DATABASE_URL`, Prisma no puede inicializarse. + +### Frontend (`apps/frontend/.env`) + +Variables esperadas: + +- `VITE_SUPABASE_URL` +- `VITE_SUPABASE_ANON_KEY` +- `VITE_API_BASE_URL` (por defecto: `http://localhost:3000`) + +## Base de datos (Prisma) + +Antes de arrancar backend por primera vez, corré migraciones: + +```sh +bun --filter backend prisma:migrate +``` + +Si cambiás el schema, regenerá cliente: + +```sh +bun --filter backend prisma:generate +``` + +## Ejecutar en desarrollo + +Terminal 1 (backend): + +```sh +bun run dev:backend +``` + +Terminal 2 (frontend): + +```sh +bun run dev:frontend +``` + +Puertos por defecto: + +- Frontend: `http://localhost:5173` +- Backend: `http://localhost:3000` + +## Scripts útiles + +Desde la raíz: + +- `bun run dev:frontend` +- `bun run dev:backend` +- `bun run build:frontend` +- `bun run lint:frontend` + +Desde `apps/backend`: + +- `bun run dev` +- `bun run start` +- `bun run prisma:migrate` +- `bun run prisma:generate` + +## Estructura del repo + +```txt +. +├─ apps/ +│ ├─ frontend/ # UI y navegación +│ └─ backend/ # API, auth middleware, acceso a DB +└─ packages/ + └─ api-contract/ # Schemas/tipos/rutas compartidos +``` + +## Flujo de autenticación (resumen) + +1. Frontend autentica con Supabase. +2. Frontend guarda el access token y lo envía como `Authorization: Bearer ...` al backend. +3. Backend valida token con Supabase (`requireAuth` middleware). +4. Si el token es válido, habilita rutas protegidas (`/api/user/*`, `/api/tenants/*`). + +## Endpoints principales + +- `GET /api/user/profile` +- `POST /api/tenants` +- `GET /api/tenants/:id` +- `PATCH /api/tenants/:id` + +## Convenciones recomendadas para el equipo + +- Mantener contratos de API en `packages/api-contract` (evitar duplicar tipos). +- Si agregás/cambiás endpoint: + 1. Actualizá schema/tipos en `api-contract`. + 2. Implementá handler/ruta en backend. + 3. Consumí el contrato desde frontend. +- Validar payloads con Zod tanto en contrato como en rutas. +- Mantener PRs chicos y enfocados. + +## Troubleshooting rápido + +- Error de CORS: + - Revisar `CORS_ORIGIN` en backend y que incluya `http://localhost:5173`. +- `403 Missing bearer token`: + - Verificar login en frontend y envío del header `Authorization`. +- Error de Supabase env vars: + - Confirmar `SUPABASE_URL`/`SUPABASE_ANON_KEY` (backend) y `VITE_*` (frontend). +- Error de Prisma/DB: + - Confirmar `DATABASE_URL`, conectividad a PostgreSQL y migraciones aplicadas. + +## Primer día sugerido para onboarding + +1. Levantar backend y frontend en local. +2. Crear usuario o iniciar sesión desde la pantalla de onboard. +3. Crear un tenant de prueba. +4. Probar lectura/edición de tenant. +5. Revisar `packages/api-contract` para entender cómo se comparten tipos y rutas. + +--- + +Si te trabás en el setup, empezá verificando `.env`, estado de PostgreSQL y que ambos procesos (`dev:backend` y `dev:frontend`) estén corriendo. diff --git a/apps/backend/.env b/apps/backend/.env new file mode 100644 index 0000000..8987705 --- /dev/null +++ b/apps/backend/.env @@ -0,0 +1,12 @@ +SUPABASE_URL=https://afzzqgvdkkpyxmifpaya.supabase.co +SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFmenpxZ3Zka2tweXhtaWZwYXlhIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc3NDg5Njc5MiwiZXhwIjoyMDkwNDcyNzkyfQ.2tex8lMCGzxBqeIk01Z08Wl15K7AavyfClUFgUl2NPM +SUPABASE_ANON_KEY=sb_publishable_RgMLVBTCTClhK-1Ks_X02Q_Sq1Z1Pq- +CORS_ORIGIN=http://localhost:5173,http://127.0.0.1:5173 +DATABASE_URL=postgres://super_admin:solotech25@localhost:5432/playzer-dev +APP_BASE_URL=http://localhost:5173 +ONBOARDING_TTL_MINUTES=60 +SMTP_HOST=sandbox.smtp.mailtrap.io +SMTP_PORT=587 +SMTP_USER=6af2bf58132d12 +SMTP_PASS=1253b2fe0fc47a +SMTP_FROM=Playzer \ No newline at end of file diff --git a/apps/backend/.env.example b/apps/backend/.env.example new file mode 100644 index 0000000..cccf350 --- /dev/null +++ b/apps/backend/.env.example @@ -0,0 +1,18 @@ +SUPABASE_URL=https://your-project-ref.supabase.co +SUPABASE_ANON_KEY=your-anon-key +SUPABASE_SERVICE_ROLE_KEY=your-service-role-key +# Fallbacks accepted too: +# VITE_SUPABASE_URL=https://your-project-ref.supabase.co +# VITE_SUPABASE_ANON_KEY=your-anon-key +CORS_ORIGIN=http://localhost:5173,http://127.0.0.1:5173 +LOG_LEVEL=debug +DATABASE_URL=postgresql://postgres:postgres@localhost:5432/monorepo +APP_BASE_URL=http://localhost:5173 +ONBOARDING_OTP_TTL_MINUTES=10 +ONBOARDING_OTP_MAX_ATTEMPTS=5 +ONBOARDING_OTP_RESEND_COOLDOWN_SECONDS=30 +SMTP_HOST=smtp.example.com +SMTP_PORT=587 +SMTP_USER=user@example.com +SMTP_PASS=your-smtp-password +SMTP_FROM=Playzer diff --git a/apps/backend/.gitignore b/apps/backend/.gitignore new file mode 100644 index 0000000..506e4c3 --- /dev/null +++ b/apps/backend/.gitignore @@ -0,0 +1,2 @@ +# deps +node_modules/ diff --git a/apps/backend/Dockerfile b/apps/backend/Dockerfile new file mode 100644 index 0000000..574f8ff --- /dev/null +++ b/apps/backend/Dockerfile @@ -0,0 +1,40 @@ +# syntax=docker/dockerfile:1.7 + +FROM oven/bun:1.3 AS deps +WORKDIR /app + +# Workspace manifests first for better layer caching. +COPY package.json bun.lock ./ +COPY apps/backend/package.json apps/backend/package.json +COPY packages/api-contract/package.json packages/api-contract/package.json + +RUN bun install --frozen-lockfile + +FROM deps AS build +WORKDIR /app + +COPY apps/backend apps/backend +COPY packages/api-contract packages/api-contract + +# Prisma 7 config resolves DATABASE_URL at generate time. +ARG DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres +ENV DATABASE_URL=${DATABASE_URL} + +RUN bun --cwd apps/backend run prisma:generate + +FROM oven/bun:1.3-slim AS runner +WORKDIR /app + +ENV NODE_ENV=production +ENV HOST=0.0.0.0 +ENV PORT=3000 + +COPY --from=deps /app/node_modules ./node_modules +COPY --from=build /app/apps/backend ./apps/backend +COPY --from=build /app/packages ./packages +COPY package.json bun.lock ./ + +WORKDIR /app/apps/backend +EXPOSE 3000 + +CMD ["bun", "run", "start"] diff --git a/apps/backend/README.md b/apps/backend/README.md new file mode 100644 index 0000000..6dd13e7 --- /dev/null +++ b/apps/backend/README.md @@ -0,0 +1,11 @@ +To install dependencies: +```sh +bun install +``` + +To run: +```sh +bun run dev +``` + +open http://localhost:3000 diff --git a/apps/backend/package.json b/apps/backend/package.json new file mode 100644 index 0000000..e6ada96 --- /dev/null +++ b/apps/backend/package.json @@ -0,0 +1,31 @@ +{ + "name": "backend", + "scripts": { + "dev": "bun run --hot src/server.ts", + "start": "bun src/server.ts", + "prisma:generate": "prisma generate", + "prisma:migrate": "prisma migrate dev", + "prisma:seed": "prisma db seed", + "prisma:seed:reset:plans": "bun prisma/reset-plans.ts" + }, + "dependencies": { + "@hono/zod-validator": "^0.7.6", + "@prisma/adapter-pg": "^7.6.0", + "@prisma/client": "^7", + "@repo/api-contract": "workspace:*", + "@supabase/supabase-js": "2.101.1", + "dotenv": "^17.4.1", + "hono": "4.12.10", + "nodemailer": "^8.0.5", + "pg": "^8.20.0", + "pino": "10.3.1", + "pino-pretty": "13.1.3", + "pino-std-serializers": "7.1.0", + "uuid": "^13.0.0" + }, + "devDependencies": { + "@types/bun": "latest", + "@types/nodemailer": "^8.0.0", + "prisma": "^7" + } +} diff --git a/apps/backend/prisma.config.ts b/apps/backend/prisma.config.ts new file mode 100644 index 0000000..a362ded --- /dev/null +++ b/apps/backend/prisma.config.ts @@ -0,0 +1,13 @@ +import 'dotenv/config' +import { defineConfig, env } from 'prisma/config' + +export default defineConfig({ + schema: 'prisma', + migrations: { + path: 'prisma/migrations', + seed: 'bun ./prisma/seed.ts', + }, + datasource: { + url: env('DATABASE_URL'), + }, +}) diff --git a/apps/backend/prisma/complex.prisma b/apps/backend/prisma/complex.prisma new file mode 100644 index 0000000..dd33e36 --- /dev/null +++ b/apps/backend/prisma/complex.prisma @@ -0,0 +1,34 @@ +model Complex { + id String @id @db.Uuid + complexName String @map("complex_name") + physicalAddress String? @map("physical_address") @db.VarChar(200) + complexSlug String @unique @map("complex_slug") + adminEmail String @map("admin_email") + planCode String? @map("plan_code") @db.VarChar(10) + createdAt DateTime @default(now()) @map("created_at") + updatedAt DateTime @updatedAt @map("updated_at") + plan Plan? @relation(fields: [planCode], references: [code]) + users ComplexUser[] + courts Court[] + + @@index([planCode]) + @@index([complexSlug]) + @@map("complexes") +} + +enum ComplexUserRole { + ADMIN +} + +model ComplexUser { + complexId String @map("complex_id") @db.Uuid + userId String @map("user_id") @db.Uuid + role ComplexUserRole @default(ADMIN) + createdAt DateTime @default(now()) @map("created_at") + complex Complex @relation(fields: [complexId], references: [id], onDelete: Cascade) + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + + @@id([complexId, userId]) + @@index([userId]) + @@map("complex_users") +} diff --git a/apps/backend/prisma/court.prisma b/apps/backend/prisma/court.prisma new file mode 100644 index 0000000..6262bc2 --- /dev/null +++ b/apps/backend/prisma/court.prisma @@ -0,0 +1,95 @@ +enum DayOfWeek { + MONDAY + TUESDAY + WEDNESDAY + THURSDAY + FRIDAY + SATURDAY + SUNDAY +} + +enum CourtBookingStatus { + CONFIRMED + CANCELLED +} + +model Sport { + id String @id @db.Uuid + name String @unique + slug String @unique + isActive Boolean @default(true) @map("is_active") + createdAt DateTime @default(now()) @map("created_at") + updatedAt DateTime @updatedAt @map("updated_at") + courts Court[] + + @@map("sports") +} + +model Court { + id String @id @db.Uuid + complexId String @map("complex_id") @db.Uuid + sportId String @map("sport_id") @db.Uuid + name String + slotDurationMinutes Int @map("slot_duration_minutes") + basePrice Decimal @map("base_price") @db.Decimal(19, 2) + createdAt DateTime @default(now()) @map("created_at") + updatedAt DateTime @updatedAt @map("updated_at") + complex Complex @relation(fields: [complexId], references: [id], onDelete: Cascade) + sport Sport @relation(fields: [sportId], references: [id]) + availabilities CourtAvailability[] + priceRules CourtPriceRule[] + bookings CourtBooking[] + + @@index([complexId]) + @@index([sportId]) + @@map("courts") +} + +model CourtAvailability { + id String @id @db.Uuid + courtId String @map("court_id") @db.Uuid + dayOfWeek DayOfWeek @map("day_of_week") + startTime String @map("start_time") @db.VarChar(5) + endTime String @map("end_time") @db.VarChar(5) + createdAt DateTime @default(now()) @map("created_at") + court Court @relation(fields: [courtId], references: [id], onDelete: Cascade) + + @@index([courtId, dayOfWeek]) + @@map("court_availabilities") +} + +model CourtPriceRule { + id String @id @db.Uuid + courtId String @map("court_id") @db.Uuid + dayOfWeek DayOfWeek? @map("day_of_week") + startTime String? @map("start_time") @db.VarChar(5) + endTime String? @map("end_time") @db.VarChar(5) + price Decimal @db.Decimal(19, 2) + isActive Boolean @default(true) @map("is_active") + createdAt DateTime @default(now()) @map("created_at") + updatedAt DateTime @updatedAt @map("updated_at") + court Court @relation(fields: [courtId], references: [id], onDelete: Cascade) + + @@index([courtId, isActive]) + @@map("court_price_rules") +} + +model CourtBooking { + id String @id @db.Uuid + bookingCode String @unique @map("booking_code") @db.VarChar(8) + courtId String @map("court_id") @db.Uuid + bookingDate DateTime @map("booking_date") @db.Date + startTime String @map("start_time") @db.VarChar(5) + endTime String @map("end_time") @db.VarChar(5) + customerName String @map("customer_name") @db.VarChar(120) + customerPhone String @map("customer_phone") @db.VarChar(30) + status CourtBookingStatus @default(CONFIRMED) + createdAt DateTime @default(now()) @map("created_at") + updatedAt DateTime @updatedAt @map("updated_at") + court Court @relation(fields: [courtId], references: [id], onDelete: Cascade) + + @@unique([courtId, bookingDate, startTime]) + @@index([courtId, bookingDate]) + @@index([bookingDate]) + @@map("court_bookings") +} diff --git a/apps/backend/prisma/migrations/20260408014652_add_complex_model/migration.sql b/apps/backend/prisma/migrations/20260408014652_add_complex_model/migration.sql new file mode 100644 index 0000000..b04065e --- /dev/null +++ b/apps/backend/prisma/migrations/20260408014652_add_complex_model/migration.sql @@ -0,0 +1,32 @@ +-- CreateTable +CREATE TABLE "plans" ( + "code" VARCHAR(10) NOT NULL, + "name" VARCHAR(30) NOT NULL, + "price" DECIMAL(19,2) NOT NULL, + "rules" JSONB NOT NULL, + "last_updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "plans_pkey" PRIMARY KEY ("code") +); + +-- CreateTable +CREATE TABLE "complexes" ( + "id" UUID NOT NULL, + "complex_name" TEXT NOT NULL, + "complex_slug" TEXT NOT NULL, + "admin_email" TEXT NOT NULL, + "plan_code" VARCHAR(10), + "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "complexes_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "complexes_complex_slug_key" ON "complexes"("complex_slug"); + +-- CreateIndex +CREATE INDEX "complexes_plan_code_idx" ON "complexes"("plan_code"); + +-- AddForeignKey +ALTER TABLE "complexes" ADD CONSTRAINT "complexes_plan_code_fkey" FOREIGN KEY ("plan_code") REFERENCES "plans"("code") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/apps/backend/prisma/migrations/20260408102522_onboarding_flow/migration.sql b/apps/backend/prisma/migrations/20260408102522_onboarding_flow/migration.sql new file mode 100644 index 0000000..832b9ad --- /dev/null +++ b/apps/backend/prisma/migrations/20260408102522_onboarding_flow/migration.sql @@ -0,0 +1,64 @@ +-- CreateEnum +CREATE TYPE "ComplexUserRole" AS ENUM ('ADMIN'); + +-- CreateTable +CREATE TABLE "complex_users" ( + "complex_id" UUID NOT NULL, + "user_id" UUID NOT NULL, + "role" "ComplexUserRole" NOT NULL DEFAULT 'ADMIN', + "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "complex_users_pkey" PRIMARY KEY ("complex_id","user_id") +); + +-- CreateTable +CREATE TABLE "onboarding_requests" ( + "id" UUID NOT NULL, + "full_name" TEXT NOT NULL, + "email" TEXT NOT NULL, + "email_verification_token_hash" TEXT NOT NULL, + "email_verification_sent_at" TIMESTAMP(3) NOT NULL, + "email_verified_at" TIMESTAMP(3), + "expires_at" TIMESTAMP(3) NOT NULL, + "completed_at" TIMESTAMP(3), + "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "onboarding_requests_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "users" ( + "id" UUID NOT NULL, + "supabase_user_id" UUID NOT NULL, + "email" TEXT NOT NULL, + "full_name" TEXT NOT NULL, + "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "users_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE INDEX "complex_users_user_id_idx" ON "complex_users"("user_id"); + +-- CreateIndex +CREATE UNIQUE INDEX "onboarding_requests_email_verification_token_hash_key" ON "onboarding_requests"("email_verification_token_hash"); + +-- CreateIndex +CREATE INDEX "onboarding_requests_email_idx" ON "onboarding_requests"("email"); + +-- CreateIndex +CREATE INDEX "onboarding_requests_expires_at_idx" ON "onboarding_requests"("expires_at"); + +-- CreateIndex +CREATE UNIQUE INDEX "users_supabase_user_id_key" ON "users"("supabase_user_id"); + +-- CreateIndex +CREATE UNIQUE INDEX "users_email_key" ON "users"("email"); + +-- AddForeignKey +ALTER TABLE "complex_users" ADD CONSTRAINT "complex_users_complex_id_fkey" FOREIGN KEY ("complex_id") REFERENCES "complexes"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "complex_users" ADD CONSTRAINT "complex_users_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/apps/backend/prisma/migrations/20260408113000_onboarding_otp/migration.sql b/apps/backend/prisma/migrations/20260408113000_onboarding_otp/migration.sql new file mode 100644 index 0000000..6c1f66b --- /dev/null +++ b/apps/backend/prisma/migrations/20260408113000_onboarding_otp/migration.sql @@ -0,0 +1,35 @@ +-- DropIndex +DROP INDEX IF EXISTS "onboarding_requests_email_verification_token_hash_key"; + +-- DropIndex +DROP INDEX IF EXISTS "onboarding_requests_expires_at_idx"; + +-- AlterTable +ALTER TABLE "onboarding_requests" +ADD COLUMN "otp_hash" TEXT, +ADD COLUMN "otp_expires_at" TIMESTAMP(3), +ADD COLUMN "otp_attempts" INTEGER NOT NULL DEFAULT 0, +ADD COLUMN "otp_last_sent_at" TIMESTAMP(3), +ADD COLUMN "otp_resend_count" INTEGER NOT NULL DEFAULT 0; + +-- Backfill for existing rows +UPDATE "onboarding_requests" +SET + "otp_hash" = md5("id"::text || ':legacy'), + "otp_expires_at" = COALESCE("expires_at", NOW()), + "otp_last_sent_at" = COALESCE("email_verification_sent_at", NOW()); + +-- Enforce required fields +ALTER TABLE "onboarding_requests" +ALTER COLUMN "otp_hash" SET NOT NULL, +ALTER COLUMN "otp_expires_at" SET NOT NULL, +ALTER COLUMN "otp_last_sent_at" SET NOT NULL; + +-- CreateIndex +CREATE INDEX "onboarding_requests_otp_expires_at_idx" ON "onboarding_requests"("otp_expires_at"); + +-- Drop legacy columns +ALTER TABLE "onboarding_requests" +DROP COLUMN "email_verification_token_hash", +DROP COLUMN "email_verification_sent_at", +DROP COLUMN "expires_at"; diff --git a/apps/backend/prisma/migrations/20260408132000_add_courts_and_sports/migration.sql b/apps/backend/prisma/migrations/20260408132000_add_courts_and_sports/migration.sql new file mode 100644 index 0000000..39a8e2c --- /dev/null +++ b/apps/backend/prisma/migrations/20260408132000_add_courts_and_sports/migration.sql @@ -0,0 +1,93 @@ +-- CreateEnum +CREATE TYPE "DayOfWeek" AS ENUM ( + 'MONDAY', + 'TUESDAY', + 'WEDNESDAY', + 'THURSDAY', + 'FRIDAY', + 'SATURDAY', + 'SUNDAY' +); + +-- CreateTable +CREATE TABLE "sports" ( + "id" UUID NOT NULL, + "name" TEXT NOT NULL, + "slug" TEXT NOT NULL, + "is_active" BOOLEAN NOT NULL DEFAULT true, + "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "sports_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "courts" ( + "id" UUID NOT NULL, + "complex_id" UUID NOT NULL, + "sport_id" UUID NOT NULL, + "name" TEXT NOT NULL, + "slot_duration_minutes" INTEGER NOT NULL, + "base_price" DECIMAL(19,2) NOT NULL, + "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "courts_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "court_availabilities" ( + "id" UUID NOT NULL, + "court_id" UUID NOT NULL, + "day_of_week" "DayOfWeek" NOT NULL, + "start_time" VARCHAR(5) NOT NULL, + "end_time" VARCHAR(5) NOT NULL, + "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "court_availabilities_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "court_price_rules" ( + "id" UUID NOT NULL, + "court_id" UUID NOT NULL, + "day_of_week" "DayOfWeek", + "start_time" VARCHAR(5), + "end_time" VARCHAR(5), + "price" DECIMAL(19,2) NOT NULL, + "is_active" BOOLEAN NOT NULL DEFAULT true, + "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "court_price_rules_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "sports_name_key" ON "sports"("name"); + +-- CreateIndex +CREATE UNIQUE INDEX "sports_slug_key" ON "sports"("slug"); + +-- CreateIndex +CREATE INDEX "courts_complex_id_idx" ON "courts"("complex_id"); + +-- CreateIndex +CREATE INDEX "courts_sport_id_idx" ON "courts"("sport_id"); + +-- CreateIndex +CREATE INDEX "court_availabilities_court_id_day_of_week_idx" ON "court_availabilities"("court_id", "day_of_week"); + +-- CreateIndex +CREATE INDEX "court_price_rules_court_id_is_active_idx" ON "court_price_rules"("court_id", "is_active"); + +-- AddForeignKey +ALTER TABLE "courts" ADD CONSTRAINT "courts_complex_id_fkey" FOREIGN KEY ("complex_id") REFERENCES "complexes"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "courts" ADD CONSTRAINT "courts_sport_id_fkey" FOREIGN KEY ("sport_id") REFERENCES "sports"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "court_availabilities" ADD CONSTRAINT "court_availabilities_court_id_fkey" FOREIGN KEY ("court_id") REFERENCES "courts"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "court_price_rules" ADD CONSTRAINT "court_price_rules_court_id_fkey" FOREIGN KEY ("court_id") REFERENCES "courts"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/apps/backend/prisma/migrations/20260408193000_add_court_bookings/migration.sql b/apps/backend/prisma/migrations/20260408193000_add_court_bookings/migration.sql new file mode 100644 index 0000000..8e428bb --- /dev/null +++ b/apps/backend/prisma/migrations/20260408193000_add_court_bookings/migration.sql @@ -0,0 +1,30 @@ +-- CreateEnum +CREATE TYPE "CourtBookingStatus" AS ENUM ('CONFIRMED', 'CANCELLED'); + +-- CreateTable +CREATE TABLE "court_bookings" ( + "id" UUID NOT NULL, + "court_id" UUID NOT NULL, + "booking_date" DATE NOT NULL, + "start_time" VARCHAR(5) NOT NULL, + "end_time" VARCHAR(5) NOT NULL, + "customer_name" VARCHAR(120) NOT NULL, + "customer_phone" VARCHAR(30) NOT NULL, + "status" "CourtBookingStatus" NOT NULL DEFAULT 'CONFIRMED', + "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "court_bookings_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "court_bookings_court_id_booking_date_start_time_key" ON "court_bookings"("court_id", "booking_date", "start_time"); + +-- CreateIndex +CREATE INDEX "court_bookings_court_id_booking_date_idx" ON "court_bookings"("court_id", "booking_date"); + +-- CreateIndex +CREATE INDEX "court_bookings_booking_date_idx" ON "court_bookings"("booking_date"); + +-- AddForeignKey +ALTER TABLE "court_bookings" ADD CONSTRAINT "court_bookings_court_id_fkey" FOREIGN KEY ("court_id") REFERENCES "courts"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/apps/backend/prisma/migrations/20260408203000_add_booking_code/migration.sql b/apps/backend/prisma/migrations/20260408203000_add_booking_code/migration.sql new file mode 100644 index 0000000..08c8a16 --- /dev/null +++ b/apps/backend/prisma/migrations/20260408203000_add_booking_code/migration.sql @@ -0,0 +1,11 @@ +-- AlterTable +ALTER TABLE "court_bookings" ADD COLUMN "booking_code" VARCHAR(8); + +-- Backfill existing rows +UPDATE "court_bookings" +SET "booking_code" = UPPER(SUBSTRING(REPLACE("id"::text, '-', '') FROM 1 FOR 8)) +WHERE "booking_code" IS NULL; + +-- Enforce not-null and uniqueness +ALTER TABLE "court_bookings" ALTER COLUMN "booking_code" SET NOT NULL; +CREATE UNIQUE INDEX "court_bookings_booking_code_key" ON "court_bookings"("booking_code"); diff --git a/apps/backend/prisma/migrations/20260408214307_add_index_by_slug/migration.sql b/apps/backend/prisma/migrations/20260408214307_add_index_by_slug/migration.sql new file mode 100644 index 0000000..497aa70 --- /dev/null +++ b/apps/backend/prisma/migrations/20260408214307_add_index_by_slug/migration.sql @@ -0,0 +1,2 @@ +-- CreateIndex +CREATE INDEX "complexes_complex_slug_idx" ON "complexes"("complex_slug"); diff --git a/apps/backend/prisma/migrations/20260408224500_add_complex_physical_address/migration.sql b/apps/backend/prisma/migrations/20260408224500_add_complex_physical_address/migration.sql new file mode 100644 index 0000000..4a49dcd --- /dev/null +++ b/apps/backend/prisma/migrations/20260408224500_add_complex_physical_address/migration.sql @@ -0,0 +1,3 @@ +-- AlterTable +ALTER TABLE "complexes" +ADD COLUMN "physical_address" VARCHAR(200); diff --git a/apps/backend/prisma/migrations/migration_lock.toml b/apps/backend/prisma/migrations/migration_lock.toml new file mode 100644 index 0000000..044d57c --- /dev/null +++ b/apps/backend/prisma/migrations/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (e.g., Git) +provider = "postgresql" diff --git a/apps/backend/prisma/onboarding.prisma b/apps/backend/prisma/onboarding.prisma new file mode 100644 index 0000000..13d6d46 --- /dev/null +++ b/apps/backend/prisma/onboarding.prisma @@ -0,0 +1,18 @@ +model OnboardingRequest { + id String @id @db.Uuid + fullName String @map("full_name") + email String + otpHash String @map("otp_hash") + otpExpiresAt DateTime @map("otp_expires_at") + otpAttempts Int @default(0) @map("otp_attempts") + otpLastSentAt DateTime @map("otp_last_sent_at") + otpResendCount Int @default(0) @map("otp_resend_count") + emailVerifiedAt DateTime? @map("email_verified_at") + completedAt DateTime? @map("completed_at") + createdAt DateTime @default(now()) @map("created_at") + updatedAt DateTime @updatedAt @map("updated_at") + + @@index([email]) + @@index([otpExpiresAt]) + @@map("onboarding_requests") +} diff --git a/apps/backend/prisma/plan.prisma b/apps/backend/prisma/plan.prisma new file mode 100644 index 0000000..5222c98 --- /dev/null +++ b/apps/backend/prisma/plan.prisma @@ -0,0 +1,10 @@ +model Plan { + code String @id @db.VarChar(10) + name String @db.VarChar(30) + price Decimal @db.Decimal(19, 2) + rules Json + lastUpdatedAt DateTime @default(now()) @map("last_updated_at") + complexes Complex[] + + @@map("plans") +} diff --git a/apps/backend/prisma/plans.seed-data.ts b/apps/backend/prisma/plans.seed-data.ts new file mode 100644 index 0000000..ba65bb4 --- /dev/null +++ b/apps/backend/prisma/plans.seed-data.ts @@ -0,0 +1,77 @@ +export const planSeeds = [ + { + code: 'BASIC', + name: 'Basic', + price: '49.00', + rules: { + version: 'v1', + limits: { + maxCourts: 2, + maxBookingsPerDay: 80, + maxActiveUsers: 3, + maxConcurrentBookingsPerSlot: 1, + }, + policies: { + maxAdvanceBookingDays: 7, + minCancellationNoticeHours: 2, + allowOverbooking: false, + }, + features: { + onlinePayments: false, + publicBookingPage: true, + advancedReports: false, + whatsappReminders: false, + }, + }, + }, + { + code: 'ADVANCED', + name: 'Advanced', + price: '99.00', + rules: { + version: 'v1', + limits: { + maxCourts: 5, + maxBookingsPerDay: 220, + maxActiveUsers: 8, + maxConcurrentBookingsPerSlot: 1, + }, + policies: { + maxAdvanceBookingDays: 15, + minCancellationNoticeHours: 2, + allowOverbooking: false, + }, + features: { + onlinePayments: true, + publicBookingPage: true, + advancedReports: true, + whatsappReminders: true, + }, + }, + }, + { + code: 'ENTERPRISE', + name: 'Enterprise', + price: '199.00', + rules: { + version: 'v1', + limits: { + maxCourts: 20, + maxBookingsPerDay: 2000, + maxActiveUsers: 50, + maxConcurrentBookingsPerSlot: 2, + }, + policies: { + maxAdvanceBookingDays: 60, + minCancellationNoticeHours: 1, + allowOverbooking: true, + }, + features: { + onlinePayments: true, + publicBookingPage: true, + advancedReports: true, + whatsappReminders: true, + }, + }, + }, +] as const diff --git a/apps/backend/prisma/reset-plans.ts b/apps/backend/prisma/reset-plans.ts new file mode 100644 index 0000000..f654110 --- /dev/null +++ b/apps/backend/prisma/reset-plans.ts @@ -0,0 +1,55 @@ +import 'dotenv/config' +import { PrismaPg } from '@prisma/adapter-pg' +import { PrismaClient } from '../src/generated/prisma/client' +import { planSeeds } from './plans.seed-data' + +const databaseUrl = process.env.DATABASE_URL + +if (!databaseUrl) { + throw new Error('Missing DATABASE_URL in environment for plan reset.') +} + +const adapter = new PrismaPg({ + connectionString: databaseUrl, +}) + +const prisma = new PrismaClient({ adapter }) + +async function run() { + const complexesUsingPlans = await prisma.complex.count({ + where: { planCode: { not: null } }, + }) + + if (complexesUsingPlans > 0) { + throw new Error( + `No se puede resetear planes: hay ${complexesUsingPlans} complejos con plan asignado.`, + ) + } + + await prisma.$transaction(async (tx) => { + await tx.plan.deleteMany({}) + + for (const plan of planSeeds) { + await tx.plan.create({ + data: { + code: plan.code, + name: plan.name, + price: plan.price, + rules: plan.rules, + }, + }) + } + }) + + console.log('Planes reseteados: BASIC, ADVANCED, ENTERPRISE') +} + +run() + .then(async () => { + await prisma.$disconnect() + }) + .catch(async (error) => { + console.error(error) + await prisma.$disconnect() + process.exit(1) + }) diff --git a/apps/backend/prisma/schema.prisma b/apps/backend/prisma/schema.prisma new file mode 100644 index 0000000..dfb621e --- /dev/null +++ b/apps/backend/prisma/schema.prisma @@ -0,0 +1,8 @@ +generator client { + provider = "prisma-client" + output = "../src/generated/prisma" +} + +datasource db { + provider = "postgresql" +} diff --git a/apps/backend/prisma/seed.ts b/apps/backend/prisma/seed.ts new file mode 100644 index 0000000..3c7bddd --- /dev/null +++ b/apps/backend/prisma/seed.ts @@ -0,0 +1,64 @@ +import 'dotenv/config' +import { PrismaPg } from '@prisma/adapter-pg' +import { v7 as uuidv7 } from 'uuid' +import { PrismaClient } from '../src/generated/prisma/client' +import { planSeeds } from './plans.seed-data' +import { sportSeeds } from './sports.seed-data' + +const databaseUrl = process.env.DATABASE_URL + +if (!databaseUrl) { + throw new Error('Missing DATABASE_URL in environment for seeding.') +} + +const adapter = new PrismaPg({ + connectionString: databaseUrl, +}) + +const prisma = new PrismaClient({ adapter }) + +async function run() { + for (const plan of planSeeds) { + await prisma.plan.upsert({ + where: { code: plan.code }, + update: { + name: plan.name, + price: plan.price, + rules: plan.rules, + lastUpdatedAt: new Date(), + }, + create: { + code: plan.code, + name: plan.name, + price: plan.price, + rules: plan.rules, + }, + }) + } + + for (const sport of sportSeeds) { + await prisma.sport.upsert({ + where: { slug: sport.slug }, + update: { + name: sport.name, + isActive: true, + }, + create: { + id: uuidv7(), + name: sport.name, + slug: sport.slug, + isActive: true, + }, + }) + } +} + +run() + .then(async () => { + await prisma.$disconnect() + }) + .catch(async (error) => { + console.error(error) + await prisma.$disconnect() + process.exit(1) + }) diff --git a/apps/backend/prisma/sports.seed-data.ts b/apps/backend/prisma/sports.seed-data.ts new file mode 100644 index 0000000..5f6e41e --- /dev/null +++ b/apps/backend/prisma/sports.seed-data.ts @@ -0,0 +1,8 @@ +export const sportSeeds = [ + { name: 'Futbol 5', slug: 'futbol-5' }, + { name: 'Padel', slug: 'padel' }, + { name: 'Tenis', slug: 'tenis' }, + { name: 'Pickleball', slug: 'pickleball' }, + { name: 'Basquet', slug: 'basquet' }, + { name: 'Basquet 3', slug: 'basquet-3' }, +] as const diff --git a/apps/backend/prisma/user.prisma b/apps/backend/prisma/user.prisma new file mode 100644 index 0000000..a626604 --- /dev/null +++ b/apps/backend/prisma/user.prisma @@ -0,0 +1,11 @@ +model User { + id String @id @db.Uuid + supabaseUserId String @unique @map("supabase_user_id") @db.Uuid + email String @unique + fullName String @map("full_name") + createdAt DateTime @default(now()) @map("created_at") + updatedAt DateTime @updatedAt @map("updated_at") + complexes ComplexUser[] + + @@map("users") +} diff --git a/apps/backend/src/app.ts b/apps/backend/src/app.ts new file mode 100644 index 0000000..94f2590 --- /dev/null +++ b/apps/backend/src/app.ts @@ -0,0 +1,48 @@ +import { Hono } from 'hono' +import { cors } from 'hono/cors' +import { logger } from '@/lib/logger' +import type { AppEnv } from '@/types/hono' +import { requestId } from 'hono/request-id' + +export function createApp() { + const app = new Hono() + + const allowedOrigins = ( + Bun.env.CORS_ORIGIN ?? + 'http://localhost:5173,http://127.0.0.1:5173' + ) + .split(',') + .map((value) => value.trim()) + .filter(Boolean) + + app.use( + '*', + cors({ + origin: (origin) => { + if (!origin) return allowedOrigins[0] ?? '' + return allowedOrigins.includes(origin) ? origin : '' + }, + allowHeaders: ['Authorization', 'Content-Type'], + allowMethods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], + }), + ) + + app.use('*', async (c, next) => { + const start = performance.now() + await next() + const durationMs = Number((performance.now() - start).toFixed(1)) + + logger.info( + { + method: c.req.method, + path: c.req.path, + status: c.res.status, + durationMs, + requestId + }, + 'http_request', + ) + }) + + return app +} diff --git a/apps/backend/src/generated/prisma/browser.ts b/apps/backend/src/generated/prisma/browser.ts new file mode 100644 index 0000000..bc22bfb --- /dev/null +++ b/apps/backend/src/generated/prisma/browser.ts @@ -0,0 +1,69 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file should be your main import to use Prisma-related types and utilities in a browser. + * Use it to get access to models, enums, and input types. + * + * This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only. + * See `client.ts` for the standard, server-side entry point. + * + * 🟢 You can import this file directly. + */ + +import * as Prisma from './internal/prismaNamespaceBrowser' +export { Prisma } +export * as $Enums from './enums' +export * from './enums'; +/** + * Model Complex + * + */ +export type Complex = Prisma.ComplexModel +/** + * Model ComplexUser + * + */ +export type ComplexUser = Prisma.ComplexUserModel +/** + * Model Sport + * + */ +export type Sport = Prisma.SportModel +/** + * Model Court + * + */ +export type Court = Prisma.CourtModel +/** + * Model CourtAvailability + * + */ +export type CourtAvailability = Prisma.CourtAvailabilityModel +/** + * Model CourtPriceRule + * + */ +export type CourtPriceRule = Prisma.CourtPriceRuleModel +/** + * Model CourtBooking + * + */ +export type CourtBooking = Prisma.CourtBookingModel +/** + * Model OnboardingRequest + * + */ +export type OnboardingRequest = Prisma.OnboardingRequestModel +/** + * Model Plan + * + */ +export type Plan = Prisma.PlanModel +/** + * Model User + * + */ +export type User = Prisma.UserModel diff --git a/apps/backend/src/generated/prisma/client.ts b/apps/backend/src/generated/prisma/client.ts new file mode 100644 index 0000000..a4578f1 --- /dev/null +++ b/apps/backend/src/generated/prisma/client.ts @@ -0,0 +1,93 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types. + * If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead. + * + * 🟢 You can import this file directly. + */ + +import * as process from 'node:process' +import * as path from 'node:path' +import { fileURLToPath } from 'node:url' +globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url)) + +import * as runtime from "@prisma/client/runtime/client" +import * as $Enums from "./enums" +import * as $Class from "./internal/class" +import * as Prisma from "./internal/prismaNamespace" + +export * as $Enums from './enums' +export * from "./enums" +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient({ + * adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL }) + * }) + * // Fetch zero or more Complexes + * const complexes = await prisma.complex.findMany() + * ``` + * + * Read more in our [docs](https://pris.ly/d/client). + */ +export const PrismaClient = $Class.getPrismaClientClass() +export type PrismaClient = $Class.PrismaClient +export { Prisma } + +/** + * Model Complex + * + */ +export type Complex = Prisma.ComplexModel +/** + * Model ComplexUser + * + */ +export type ComplexUser = Prisma.ComplexUserModel +/** + * Model Sport + * + */ +export type Sport = Prisma.SportModel +/** + * Model Court + * + */ +export type Court = Prisma.CourtModel +/** + * Model CourtAvailability + * + */ +export type CourtAvailability = Prisma.CourtAvailabilityModel +/** + * Model CourtPriceRule + * + */ +export type CourtPriceRule = Prisma.CourtPriceRuleModel +/** + * Model CourtBooking + * + */ +export type CourtBooking = Prisma.CourtBookingModel +/** + * Model OnboardingRequest + * + */ +export type OnboardingRequest = Prisma.OnboardingRequestModel +/** + * Model Plan + * + */ +export type Plan = Prisma.PlanModel +/** + * Model User + * + */ +export type User = Prisma.UserModel diff --git a/apps/backend/src/generated/prisma/commonInputTypes.ts b/apps/backend/src/generated/prisma/commonInputTypes.ts new file mode 100644 index 0000000..f527e11 --- /dev/null +++ b/apps/backend/src/generated/prisma/commonInputTypes.ts @@ -0,0 +1,669 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports various common sort, input & filter types that are not directly linked to a particular model. + * + * 🟢 You can import this file directly. + */ + +import type * as runtime from "@prisma/client/runtime/client" +import * as $Enums from "./enums" +import type * as Prisma from "./internal/prismaNamespace" + + +export type UuidFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedUuidFilter<$PrismaModel> | string +} + +export type StringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type StringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + +export type DateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string +} + +export type SortOrderInput = { + sort: Prisma.SortOrder + nulls?: Prisma.NullsOrder +} + +export type UuidWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedUuidWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type StringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + +export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeFilter<$PrismaModel> +} + +export type EnumComplexUserRoleFilter<$PrismaModel = never> = { + equals?: $Enums.ComplexUserRole | Prisma.EnumComplexUserRoleFieldRefInput<$PrismaModel> + in?: $Enums.ComplexUserRole[] | Prisma.ListEnumComplexUserRoleFieldRefInput<$PrismaModel> + notIn?: $Enums.ComplexUserRole[] | Prisma.ListEnumComplexUserRoleFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumComplexUserRoleFilter<$PrismaModel> | $Enums.ComplexUserRole +} + +export type EnumComplexUserRoleWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.ComplexUserRole | Prisma.EnumComplexUserRoleFieldRefInput<$PrismaModel> + in?: $Enums.ComplexUserRole[] | Prisma.ListEnumComplexUserRoleFieldRefInput<$PrismaModel> + notIn?: $Enums.ComplexUserRole[] | Prisma.ListEnumComplexUserRoleFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumComplexUserRoleWithAggregatesFilter<$PrismaModel> | $Enums.ComplexUserRole + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumComplexUserRoleFilter<$PrismaModel> + _max?: Prisma.NestedEnumComplexUserRoleFilter<$PrismaModel> +} + +export type BoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type BoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + +export type IntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number +} + +export type DecimalFilter<$PrismaModel = never> = { + equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel> + notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel> + lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type IntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + +export type DecimalWithAggregatesFilter<$PrismaModel = never> = { + equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel> + notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel> + lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + not?: Prisma.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedDecimalFilter<$PrismaModel> + _sum?: Prisma.NestedDecimalFilter<$PrismaModel> + _min?: Prisma.NestedDecimalFilter<$PrismaModel> + _max?: Prisma.NestedDecimalFilter<$PrismaModel> +} + +export type EnumDayOfWeekFilter<$PrismaModel = never> = { + equals?: $Enums.DayOfWeek | Prisma.EnumDayOfWeekFieldRefInput<$PrismaModel> + in?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> + notIn?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumDayOfWeekFilter<$PrismaModel> | $Enums.DayOfWeek +} + +export type EnumDayOfWeekWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.DayOfWeek | Prisma.EnumDayOfWeekFieldRefInput<$PrismaModel> + in?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> + notIn?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumDayOfWeekWithAggregatesFilter<$PrismaModel> | $Enums.DayOfWeek + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumDayOfWeekFilter<$PrismaModel> + _max?: Prisma.NestedEnumDayOfWeekFilter<$PrismaModel> +} + +export type EnumDayOfWeekNullableFilter<$PrismaModel = never> = { + equals?: $Enums.DayOfWeek | Prisma.EnumDayOfWeekFieldRefInput<$PrismaModel> | null + in?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> | null + notIn?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> | null + not?: Prisma.NestedEnumDayOfWeekNullableFilter<$PrismaModel> | $Enums.DayOfWeek | null +} + +export type EnumDayOfWeekNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.DayOfWeek | Prisma.EnumDayOfWeekFieldRefInput<$PrismaModel> | null + in?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> | null + notIn?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> | null + not?: Prisma.NestedEnumDayOfWeekNullableWithAggregatesFilter<$PrismaModel> | $Enums.DayOfWeek | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedEnumDayOfWeekNullableFilter<$PrismaModel> + _max?: Prisma.NestedEnumDayOfWeekNullableFilter<$PrismaModel> +} + +export type EnumCourtBookingStatusFilter<$PrismaModel = never> = { + equals?: $Enums.CourtBookingStatus | Prisma.EnumCourtBookingStatusFieldRefInput<$PrismaModel> + in?: $Enums.CourtBookingStatus[] | Prisma.ListEnumCourtBookingStatusFieldRefInput<$PrismaModel> + notIn?: $Enums.CourtBookingStatus[] | Prisma.ListEnumCourtBookingStatusFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumCourtBookingStatusFilter<$PrismaModel> | $Enums.CourtBookingStatus +} + +export type EnumCourtBookingStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.CourtBookingStatus | Prisma.EnumCourtBookingStatusFieldRefInput<$PrismaModel> + in?: $Enums.CourtBookingStatus[] | Prisma.ListEnumCourtBookingStatusFieldRefInput<$PrismaModel> + notIn?: $Enums.CourtBookingStatus[] | Prisma.ListEnumCourtBookingStatusFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumCourtBookingStatusWithAggregatesFilter<$PrismaModel> | $Enums.CourtBookingStatus + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumCourtBookingStatusFilter<$PrismaModel> + _max?: Prisma.NestedEnumCourtBookingStatusFilter<$PrismaModel> +} + +export type DateTimeNullableFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null +} + +export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> +} + +export type JsonFilter<$PrismaModel = never> = +| Prisma.PatchUndefined< + Prisma.Either>, Exclude>, 'path'>>, + Required> + > +| Prisma.OptionalFlat>, 'path'>> + +export type JsonFilterBase<$PrismaModel = never> = { + equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + path?: string[] + mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter +} + +export type JsonWithAggregatesFilter<$PrismaModel = never> = +| Prisma.PatchUndefined< + Prisma.Either>, Exclude>, 'path'>>, + Required> + > +| Prisma.OptionalFlat>, 'path'>> + +export type JsonWithAggregatesFilterBase<$PrismaModel = never> = { + equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + path?: string[] + mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedJsonFilter<$PrismaModel> + _max?: Prisma.NestedJsonFilter<$PrismaModel> +} + +export type NestedUuidFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedUuidFilter<$PrismaModel> | string +} + +export type NestedStringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type NestedStringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + +export type NestedDateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string +} + +export type NestedUuidWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedUuidWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type NestedIntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number +} + +export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + +export type NestedIntNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null +} + +export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeFilter<$PrismaModel> +} + +export type NestedEnumComplexUserRoleFilter<$PrismaModel = never> = { + equals?: $Enums.ComplexUserRole | Prisma.EnumComplexUserRoleFieldRefInput<$PrismaModel> + in?: $Enums.ComplexUserRole[] | Prisma.ListEnumComplexUserRoleFieldRefInput<$PrismaModel> + notIn?: $Enums.ComplexUserRole[] | Prisma.ListEnumComplexUserRoleFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumComplexUserRoleFilter<$PrismaModel> | $Enums.ComplexUserRole +} + +export type NestedEnumComplexUserRoleWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.ComplexUserRole | Prisma.EnumComplexUserRoleFieldRefInput<$PrismaModel> + in?: $Enums.ComplexUserRole[] | Prisma.ListEnumComplexUserRoleFieldRefInput<$PrismaModel> + notIn?: $Enums.ComplexUserRole[] | Prisma.ListEnumComplexUserRoleFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumComplexUserRoleWithAggregatesFilter<$PrismaModel> | $Enums.ComplexUserRole + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumComplexUserRoleFilter<$PrismaModel> + _max?: Prisma.NestedEnumComplexUserRoleFilter<$PrismaModel> +} + +export type NestedBoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + +export type NestedDecimalFilter<$PrismaModel = never> = { + equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel> + notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel> + lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + +export type NestedFloatFilter<$PrismaModel = never> = { + equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> + lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + not?: Prisma.NestedFloatFilter<$PrismaModel> | number +} + +export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = { + equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel> + notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | Prisma.ListDecimalFieldRefInput<$PrismaModel> + lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + not?: Prisma.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedDecimalFilter<$PrismaModel> + _sum?: Prisma.NestedDecimalFilter<$PrismaModel> + _min?: Prisma.NestedDecimalFilter<$PrismaModel> + _max?: Prisma.NestedDecimalFilter<$PrismaModel> +} + +export type NestedEnumDayOfWeekFilter<$PrismaModel = never> = { + equals?: $Enums.DayOfWeek | Prisma.EnumDayOfWeekFieldRefInput<$PrismaModel> + in?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> + notIn?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumDayOfWeekFilter<$PrismaModel> | $Enums.DayOfWeek +} + +export type NestedEnumDayOfWeekWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.DayOfWeek | Prisma.EnumDayOfWeekFieldRefInput<$PrismaModel> + in?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> + notIn?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumDayOfWeekWithAggregatesFilter<$PrismaModel> | $Enums.DayOfWeek + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumDayOfWeekFilter<$PrismaModel> + _max?: Prisma.NestedEnumDayOfWeekFilter<$PrismaModel> +} + +export type NestedEnumDayOfWeekNullableFilter<$PrismaModel = never> = { + equals?: $Enums.DayOfWeek | Prisma.EnumDayOfWeekFieldRefInput<$PrismaModel> | null + in?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> | null + notIn?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> | null + not?: Prisma.NestedEnumDayOfWeekNullableFilter<$PrismaModel> | $Enums.DayOfWeek | null +} + +export type NestedEnumDayOfWeekNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.DayOfWeek | Prisma.EnumDayOfWeekFieldRefInput<$PrismaModel> | null + in?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> | null + notIn?: $Enums.DayOfWeek[] | Prisma.ListEnumDayOfWeekFieldRefInput<$PrismaModel> | null + not?: Prisma.NestedEnumDayOfWeekNullableWithAggregatesFilter<$PrismaModel> | $Enums.DayOfWeek | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedEnumDayOfWeekNullableFilter<$PrismaModel> + _max?: Prisma.NestedEnumDayOfWeekNullableFilter<$PrismaModel> +} + +export type NestedEnumCourtBookingStatusFilter<$PrismaModel = never> = { + equals?: $Enums.CourtBookingStatus | Prisma.EnumCourtBookingStatusFieldRefInput<$PrismaModel> + in?: $Enums.CourtBookingStatus[] | Prisma.ListEnumCourtBookingStatusFieldRefInput<$PrismaModel> + notIn?: $Enums.CourtBookingStatus[] | Prisma.ListEnumCourtBookingStatusFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumCourtBookingStatusFilter<$PrismaModel> | $Enums.CourtBookingStatus +} + +export type NestedEnumCourtBookingStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.CourtBookingStatus | Prisma.EnumCourtBookingStatusFieldRefInput<$PrismaModel> + in?: $Enums.CourtBookingStatus[] | Prisma.ListEnumCourtBookingStatusFieldRefInput<$PrismaModel> + notIn?: $Enums.CourtBookingStatus[] | Prisma.ListEnumCourtBookingStatusFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumCourtBookingStatusWithAggregatesFilter<$PrismaModel> | $Enums.CourtBookingStatus + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumCourtBookingStatusFilter<$PrismaModel> + _max?: Prisma.NestedEnumCourtBookingStatusFilter<$PrismaModel> +} + +export type NestedDateTimeNullableFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null +} + +export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> +} + +export type NestedJsonFilter<$PrismaModel = never> = +| Prisma.PatchUndefined< + Prisma.Either>, Exclude>, 'path'>>, + Required> + > +| Prisma.OptionalFlat>, 'path'>> + +export type NestedJsonFilterBase<$PrismaModel = never> = { + equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + path?: string[] + mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter +} + + diff --git a/apps/backend/src/generated/prisma/enums.ts b/apps/backend/src/generated/prisma/enums.ts new file mode 100644 index 0000000..79d67bb --- /dev/null +++ b/apps/backend/src/generated/prisma/enums.ts @@ -0,0 +1,37 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* +* This file exports all enum related types from the schema. +* +* 🟢 You can import this file directly. +*/ + +export const ComplexUserRole = { + ADMIN: 'ADMIN' +} as const + +export type ComplexUserRole = (typeof ComplexUserRole)[keyof typeof ComplexUserRole] + + +export const DayOfWeek = { + MONDAY: 'MONDAY', + TUESDAY: 'TUESDAY', + WEDNESDAY: 'WEDNESDAY', + THURSDAY: 'THURSDAY', + FRIDAY: 'FRIDAY', + SATURDAY: 'SATURDAY', + SUNDAY: 'SUNDAY' +} as const + +export type DayOfWeek = (typeof DayOfWeek)[keyof typeof DayOfWeek] + + +export const CourtBookingStatus = { + CONFIRMED: 'CONFIRMED', + CANCELLED: 'CANCELLED' +} as const + +export type CourtBookingStatus = (typeof CourtBookingStatus)[keyof typeof CourtBookingStatus] diff --git a/apps/backend/src/generated/prisma/internal/class.ts b/apps/backend/src/generated/prisma/internal/class.ts new file mode 100644 index 0000000..d10462e --- /dev/null +++ b/apps/backend/src/generated/prisma/internal/class.ts @@ -0,0 +1,294 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * Please import the `PrismaClient` class from the `client.ts` file instead. + */ + +import * as runtime from "@prisma/client/runtime/client" +import type * as Prisma from "./prismaNamespace" + + +const config: runtime.GetPrismaClientConfig = { + "previewFeatures": [], + "clientVersion": "7.6.0", + "engineVersion": "75cbdc1eb7150937890ad5465d861175c6624711", + "activeProvider": "postgresql", + "inlineSchema": "model Complex {\n id String @id @db.Uuid\n complexName String @map(\"complex_name\")\n physicalAddress String? @map(\"physical_address\") @db.VarChar(200)\n complexSlug String @unique @map(\"complex_slug\")\n adminEmail String @map(\"admin_email\")\n planCode String? @map(\"plan_code\") @db.VarChar(10)\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n plan Plan? @relation(fields: [planCode], references: [code])\n users ComplexUser[]\n courts Court[]\n\n @@index([planCode])\n @@index([complexSlug])\n @@map(\"complexes\")\n}\n\nenum ComplexUserRole {\n ADMIN\n}\n\nmodel ComplexUser {\n complexId String @map(\"complex_id\") @db.Uuid\n userId String @map(\"user_id\") @db.Uuid\n role ComplexUserRole @default(ADMIN)\n createdAt DateTime @default(now()) @map(\"created_at\")\n complex Complex @relation(fields: [complexId], references: [id], onDelete: Cascade)\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n @@id([complexId, userId])\n @@index([userId])\n @@map(\"complex_users\")\n}\n\nenum DayOfWeek {\n MONDAY\n TUESDAY\n WEDNESDAY\n THURSDAY\n FRIDAY\n SATURDAY\n SUNDAY\n}\n\nenum CourtBookingStatus {\n CONFIRMED\n CANCELLED\n}\n\nmodel Sport {\n id String @id @db.Uuid\n name String @unique\n slug String @unique\n isActive Boolean @default(true) @map(\"is_active\")\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n courts Court[]\n\n @@map(\"sports\")\n}\n\nmodel Court {\n id String @id @db.Uuid\n complexId String @map(\"complex_id\") @db.Uuid\n sportId String @map(\"sport_id\") @db.Uuid\n name String\n slotDurationMinutes Int @map(\"slot_duration_minutes\")\n basePrice Decimal @map(\"base_price\") @db.Decimal(19, 2)\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n complex Complex @relation(fields: [complexId], references: [id], onDelete: Cascade)\n sport Sport @relation(fields: [sportId], references: [id])\n availabilities CourtAvailability[]\n priceRules CourtPriceRule[]\n bookings CourtBooking[]\n\n @@index([complexId])\n @@index([sportId])\n @@map(\"courts\")\n}\n\nmodel CourtAvailability {\n id String @id @db.Uuid\n courtId String @map(\"court_id\") @db.Uuid\n dayOfWeek DayOfWeek @map(\"day_of_week\")\n startTime String @map(\"start_time\") @db.VarChar(5)\n endTime String @map(\"end_time\") @db.VarChar(5)\n createdAt DateTime @default(now()) @map(\"created_at\")\n court Court @relation(fields: [courtId], references: [id], onDelete: Cascade)\n\n @@index([courtId, dayOfWeek])\n @@map(\"court_availabilities\")\n}\n\nmodel CourtPriceRule {\n id String @id @db.Uuid\n courtId String @map(\"court_id\") @db.Uuid\n dayOfWeek DayOfWeek? @map(\"day_of_week\")\n startTime String? @map(\"start_time\") @db.VarChar(5)\n endTime String? @map(\"end_time\") @db.VarChar(5)\n price Decimal @db.Decimal(19, 2)\n isActive Boolean @default(true) @map(\"is_active\")\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n court Court @relation(fields: [courtId], references: [id], onDelete: Cascade)\n\n @@index([courtId, isActive])\n @@map(\"court_price_rules\")\n}\n\nmodel CourtBooking {\n id String @id @db.Uuid\n bookingCode String @unique @map(\"booking_code\") @db.VarChar(8)\n courtId String @map(\"court_id\") @db.Uuid\n bookingDate DateTime @map(\"booking_date\") @db.Date\n startTime String @map(\"start_time\") @db.VarChar(5)\n endTime String @map(\"end_time\") @db.VarChar(5)\n customerName String @map(\"customer_name\") @db.VarChar(120)\n customerPhone String @map(\"customer_phone\") @db.VarChar(30)\n status CourtBookingStatus @default(CONFIRMED)\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n court Court @relation(fields: [courtId], references: [id], onDelete: Cascade)\n\n @@unique([courtId, bookingDate, startTime])\n @@index([courtId, bookingDate])\n @@index([bookingDate])\n @@map(\"court_bookings\")\n}\n\nmodel OnboardingRequest {\n id String @id @db.Uuid\n fullName String @map(\"full_name\")\n email String\n otpHash String @map(\"otp_hash\")\n otpExpiresAt DateTime @map(\"otp_expires_at\")\n otpAttempts Int @default(0) @map(\"otp_attempts\")\n otpLastSentAt DateTime @map(\"otp_last_sent_at\")\n otpResendCount Int @default(0) @map(\"otp_resend_count\")\n emailVerifiedAt DateTime? @map(\"email_verified_at\")\n completedAt DateTime? @map(\"completed_at\")\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n\n @@index([email])\n @@index([otpExpiresAt])\n @@map(\"onboarding_requests\")\n}\n\nmodel Plan {\n code String @id @db.VarChar(10)\n name String @db.VarChar(30)\n price Decimal @db.Decimal(19, 2)\n rules Json\n lastUpdatedAt DateTime @default(now()) @map(\"last_updated_at\")\n complexes Complex[]\n\n @@map(\"plans\")\n}\n\ngenerator 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 @db.Uuid\n supabaseUserId String @unique @map(\"supabase_user_id\") @db.Uuid\n email String @unique\n fullName String @map(\"full_name\")\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n complexes ComplexUser[]\n\n @@map(\"users\")\n}\n", + "runtimeDataModel": { + "models": {}, + "enums": {}, + "types": {} + }, + "parameterizationSchema": { + "strings": [], + "graph": "" + } +} + +config.runtimeDataModel = JSON.parse("{\"models\":{\"Complex\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complexName\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"complex_name\"},{\"name\":\"physicalAddress\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"physical_address\"},{\"name\":\"complexSlug\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"complex_slug\"},{\"name\":\"adminEmail\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"admin_email\"},{\"name\":\"planCode\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"plan_code\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"plan\",\"kind\":\"object\",\"type\":\"Plan\",\"relationName\":\"ComplexToPlan\"},{\"name\":\"users\",\"kind\":\"object\",\"type\":\"ComplexUser\",\"relationName\":\"ComplexToComplexUser\"},{\"name\":\"courts\",\"kind\":\"object\",\"type\":\"Court\",\"relationName\":\"ComplexToCourt\"}],\"dbName\":\"complexes\"},\"ComplexUser\":{\"fields\":[{\"name\":\"complexId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"complex_id\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"user_id\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"ComplexUserRole\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToComplexUser\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"ComplexUserToUser\"}],\"dbName\":\"complex_users\"},\"Sport\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"slug\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\",\"dbName\":\"is_active\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"courts\",\"kind\":\"object\",\"type\":\"Court\",\"relationName\":\"CourtToSport\"}],\"dbName\":\"sports\"},\"Court\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complexId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"complex_id\"},{\"name\":\"sportId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"sport_id\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"slotDurationMinutes\",\"kind\":\"scalar\",\"type\":\"Int\",\"dbName\":\"slot_duration_minutes\"},{\"name\":\"basePrice\",\"kind\":\"scalar\",\"type\":\"Decimal\",\"dbName\":\"base_price\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToCourt\"},{\"name\":\"sport\",\"kind\":\"object\",\"type\":\"Sport\",\"relationName\":\"CourtToSport\"},{\"name\":\"availabilities\",\"kind\":\"object\",\"type\":\"CourtAvailability\",\"relationName\":\"CourtToCourtAvailability\"},{\"name\":\"priceRules\",\"kind\":\"object\",\"type\":\"CourtPriceRule\",\"relationName\":\"CourtToCourtPriceRule\"},{\"name\":\"bookings\",\"kind\":\"object\",\"type\":\"CourtBooking\",\"relationName\":\"CourtToCourtBooking\"}],\"dbName\":\"courts\"},\"CourtAvailability\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"courtId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"court_id\"},{\"name\":\"dayOfWeek\",\"kind\":\"enum\",\"type\":\"DayOfWeek\",\"dbName\":\"day_of_week\"},{\"name\":\"startTime\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"start_time\"},{\"name\":\"endTime\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"end_time\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"court\",\"kind\":\"object\",\"type\":\"Court\",\"relationName\":\"CourtToCourtAvailability\"}],\"dbName\":\"court_availabilities\"},\"CourtPriceRule\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"courtId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"court_id\"},{\"name\":\"dayOfWeek\",\"kind\":\"enum\",\"type\":\"DayOfWeek\",\"dbName\":\"day_of_week\"},{\"name\":\"startTime\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"start_time\"},{\"name\":\"endTime\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"end_time\"},{\"name\":\"price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\",\"dbName\":\"is_active\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"court\",\"kind\":\"object\",\"type\":\"Court\",\"relationName\":\"CourtToCourtPriceRule\"}],\"dbName\":\"court_price_rules\"},\"CourtBooking\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"bookingCode\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"booking_code\"},{\"name\":\"courtId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"court_id\"},{\"name\":\"bookingDate\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"booking_date\"},{\"name\":\"startTime\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"start_time\"},{\"name\":\"endTime\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"end_time\"},{\"name\":\"customerName\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"customer_name\"},{\"name\":\"customerPhone\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"customer_phone\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"CourtBookingStatus\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"court\",\"kind\":\"object\",\"type\":\"Court\",\"relationName\":\"CourtToCourtBooking\"}],\"dbName\":\"court_bookings\"},\"OnboardingRequest\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"fullName\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"full_name\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"otpHash\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"otp_hash\"},{\"name\":\"otpExpiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"otp_expires_at\"},{\"name\":\"otpAttempts\",\"kind\":\"scalar\",\"type\":\"Int\",\"dbName\":\"otp_attempts\"},{\"name\":\"otpLastSentAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"otp_last_sent_at\"},{\"name\":\"otpResendCount\",\"kind\":\"scalar\",\"type\":\"Int\",\"dbName\":\"otp_resend_count\"},{\"name\":\"emailVerifiedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"email_verified_at\"},{\"name\":\"completedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"completed_at\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"}],\"dbName\":\"onboarding_requests\"},\"Plan\":{\"fields\":[{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"rules\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"lastUpdatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"last_updated_at\"},{\"name\":\"complexes\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToPlan\"}],\"dbName\":\"plans\"},\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"supabaseUserId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"supabase_user_id\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"fullName\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"full_name\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"complexes\",\"kind\":\"object\",\"type\":\"ComplexUser\",\"relationName\":\"ComplexUserToUser\"}],\"dbName\":\"users\"}},\"enums\":{},\"types\":{}}") +config.parameterizationSchema = { + strings: JSON.parse("[\"where\",\"orderBy\",\"cursor\",\"complexes\",\"_count\",\"plan\",\"complex\",\"user\",\"users\",\"courts\",\"sport\",\"court\",\"availabilities\",\"priceRules\",\"bookings\",\"Complex.findUnique\",\"Complex.findUniqueOrThrow\",\"Complex.findFirst\",\"Complex.findFirstOrThrow\",\"Complex.findMany\",\"data\",\"Complex.createOne\",\"Complex.createMany\",\"Complex.createManyAndReturn\",\"Complex.updateOne\",\"Complex.updateMany\",\"Complex.updateManyAndReturn\",\"create\",\"update\",\"Complex.upsertOne\",\"Complex.deleteOne\",\"Complex.deleteMany\",\"having\",\"_min\",\"_max\",\"Complex.groupBy\",\"Complex.aggregate\",\"ComplexUser.findUnique\",\"ComplexUser.findUniqueOrThrow\",\"ComplexUser.findFirst\",\"ComplexUser.findFirstOrThrow\",\"ComplexUser.findMany\",\"ComplexUser.createOne\",\"ComplexUser.createMany\",\"ComplexUser.createManyAndReturn\",\"ComplexUser.updateOne\",\"ComplexUser.updateMany\",\"ComplexUser.updateManyAndReturn\",\"ComplexUser.upsertOne\",\"ComplexUser.deleteOne\",\"ComplexUser.deleteMany\",\"ComplexUser.groupBy\",\"ComplexUser.aggregate\",\"Sport.findUnique\",\"Sport.findUniqueOrThrow\",\"Sport.findFirst\",\"Sport.findFirstOrThrow\",\"Sport.findMany\",\"Sport.createOne\",\"Sport.createMany\",\"Sport.createManyAndReturn\",\"Sport.updateOne\",\"Sport.updateMany\",\"Sport.updateManyAndReturn\",\"Sport.upsertOne\",\"Sport.deleteOne\",\"Sport.deleteMany\",\"Sport.groupBy\",\"Sport.aggregate\",\"Court.findUnique\",\"Court.findUniqueOrThrow\",\"Court.findFirst\",\"Court.findFirstOrThrow\",\"Court.findMany\",\"Court.createOne\",\"Court.createMany\",\"Court.createManyAndReturn\",\"Court.updateOne\",\"Court.updateMany\",\"Court.updateManyAndReturn\",\"Court.upsertOne\",\"Court.deleteOne\",\"Court.deleteMany\",\"_avg\",\"_sum\",\"Court.groupBy\",\"Court.aggregate\",\"CourtAvailability.findUnique\",\"CourtAvailability.findUniqueOrThrow\",\"CourtAvailability.findFirst\",\"CourtAvailability.findFirstOrThrow\",\"CourtAvailability.findMany\",\"CourtAvailability.createOne\",\"CourtAvailability.createMany\",\"CourtAvailability.createManyAndReturn\",\"CourtAvailability.updateOne\",\"CourtAvailability.updateMany\",\"CourtAvailability.updateManyAndReturn\",\"CourtAvailability.upsertOne\",\"CourtAvailability.deleteOne\",\"CourtAvailability.deleteMany\",\"CourtAvailability.groupBy\",\"CourtAvailability.aggregate\",\"CourtPriceRule.findUnique\",\"CourtPriceRule.findUniqueOrThrow\",\"CourtPriceRule.findFirst\",\"CourtPriceRule.findFirstOrThrow\",\"CourtPriceRule.findMany\",\"CourtPriceRule.createOne\",\"CourtPriceRule.createMany\",\"CourtPriceRule.createManyAndReturn\",\"CourtPriceRule.updateOne\",\"CourtPriceRule.updateMany\",\"CourtPriceRule.updateManyAndReturn\",\"CourtPriceRule.upsertOne\",\"CourtPriceRule.deleteOne\",\"CourtPriceRule.deleteMany\",\"CourtPriceRule.groupBy\",\"CourtPriceRule.aggregate\",\"CourtBooking.findUnique\",\"CourtBooking.findUniqueOrThrow\",\"CourtBooking.findFirst\",\"CourtBooking.findFirstOrThrow\",\"CourtBooking.findMany\",\"CourtBooking.createOne\",\"CourtBooking.createMany\",\"CourtBooking.createManyAndReturn\",\"CourtBooking.updateOne\",\"CourtBooking.updateMany\",\"CourtBooking.updateManyAndReturn\",\"CourtBooking.upsertOne\",\"CourtBooking.deleteOne\",\"CourtBooking.deleteMany\",\"CourtBooking.groupBy\",\"CourtBooking.aggregate\",\"OnboardingRequest.findUnique\",\"OnboardingRequest.findUniqueOrThrow\",\"OnboardingRequest.findFirst\",\"OnboardingRequest.findFirstOrThrow\",\"OnboardingRequest.findMany\",\"OnboardingRequest.createOne\",\"OnboardingRequest.createMany\",\"OnboardingRequest.createManyAndReturn\",\"OnboardingRequest.updateOne\",\"OnboardingRequest.updateMany\",\"OnboardingRequest.updateManyAndReturn\",\"OnboardingRequest.upsertOne\",\"OnboardingRequest.deleteOne\",\"OnboardingRequest.deleteMany\",\"OnboardingRequest.groupBy\",\"OnboardingRequest.aggregate\",\"Plan.findUnique\",\"Plan.findUniqueOrThrow\",\"Plan.findFirst\",\"Plan.findFirstOrThrow\",\"Plan.findMany\",\"Plan.createOne\",\"Plan.createMany\",\"Plan.createManyAndReturn\",\"Plan.updateOne\",\"Plan.updateMany\",\"Plan.updateManyAndReturn\",\"Plan.upsertOne\",\"Plan.deleteOne\",\"Plan.deleteMany\",\"Plan.groupBy\",\"Plan.aggregate\",\"User.findUnique\",\"User.findUniqueOrThrow\",\"User.findFirst\",\"User.findFirstOrThrow\",\"User.findMany\",\"User.createOne\",\"User.createMany\",\"User.createManyAndReturn\",\"User.updateOne\",\"User.updateMany\",\"User.updateManyAndReturn\",\"User.upsertOne\",\"User.deleteOne\",\"User.deleteMany\",\"User.groupBy\",\"User.aggregate\",\"AND\",\"OR\",\"NOT\",\"id\",\"supabaseUserId\",\"email\",\"fullName\",\"createdAt\",\"updatedAt\",\"equals\",\"in\",\"notIn\",\"lt\",\"lte\",\"gt\",\"gte\",\"not\",\"contains\",\"startsWith\",\"endsWith\",\"every\",\"some\",\"none\",\"code\",\"name\",\"price\",\"rules\",\"lastUpdatedAt\",\"string_contains\",\"string_starts_with\",\"string_ends_with\",\"array_starts_with\",\"array_ends_with\",\"array_contains\",\"otpHash\",\"otpExpiresAt\",\"otpAttempts\",\"otpLastSentAt\",\"otpResendCount\",\"emailVerifiedAt\",\"completedAt\",\"bookingCode\",\"courtId\",\"bookingDate\",\"startTime\",\"endTime\",\"customerName\",\"customerPhone\",\"CourtBookingStatus\",\"status\",\"DayOfWeek\",\"dayOfWeek\",\"isActive\",\"complexId\",\"sportId\",\"slotDurationMinutes\",\"basePrice\",\"slug\",\"userId\",\"ComplexUserRole\",\"role\",\"complexName\",\"physicalAddress\",\"complexSlug\",\"adminEmail\",\"planCode\",\"courtId_bookingDate_startTime\",\"complexId_userId\",\"is\",\"isNot\",\"connectOrCreate\",\"upsert\",\"createMany\",\"set\",\"disconnect\",\"delete\",\"connect\",\"updateMany\",\"deleteMany\",\"increment\",\"decrement\",\"multiply\",\"divide\"]"), + graph: "ygReoAEOBQAA4wIAIAgAAJwCACAJAADJAgAgtwEAAOICADC4AQAABQAQuQEAAOICADC6AQEAAAABvgFAAJsCACG_AUAAmwIAIfQBAQCaAgAh9QEBANUCACH2AQEAAAAB9wEBAJoCACH4AQEA1QIAIQEAAAABACAJAwAApwIAILcBAACkAgAwuAEAAAMAELkBAACkAgAwzgEBAJoCACHPAQEAmgIAIdABEAClAgAh0QEAAKYCACDSAUAAmwIAIQEAAAADACAOBQAA4wIAIAgAAJwCACAJAADJAgAgtwEAAOICADC4AQAABQAQuQEAAOICADC6AQEAmQIAIb4BQACbAgAhvwFAAJsCACH0AQEAmgIAIfUBAQDVAgAh9gEBAJoCACH3AQEAmgIAIfgBAQDVAgAhBQUAAJoEACAIAAD6AgAgCQAAigQAIPUBAADdAwAg-AEAAN0DACADAAAABQAgAQAABgAwAgAAAQAgAQAAAAUAIAkGAADZAgAgBwAA4QIAILcBAADfAgAwuAEAAAkAELkBAADfAgAwvgFAAJsCACHsAQEAmQIAIfEBAQCZAgAh8wEAAOAC8wEiAgYAAJQEACAHAACZBAAgCgYAANkCACAHAADhAgAgtwEAAN8CADC4AQAACQAQuQEAAN8CADC-AUAAmwIAIewBAQCZAgAh8QEBAJkCACHzAQAA4ALzASL6AQAA3gIAIAMAAAAJACABAAAKADACAAALACADAAAACQAgAQAACgAwAgAACwAgAQAAAAkAIBAGAADZAgAgCgAA2gIAIAwAANsCACANAADcAgAgDgAA3QIAILcBAADYAgAwuAEAAA8AELkBAADYAgAwugEBAJkCACG-AUAAmwIAIb8BQACbAgAhzwEBAJoCACHsAQEAmQIAIe0BAQCZAgAh7gECALECACHvARAApQIAIQUGAACUBAAgCgAAlQQAIAwAAJYEACANAACXBAAgDgAAmAQAIBAGAADZAgAgCgAA2gIAIAwAANsCACANAADcAgAgDgAA3QIAILcBAADYAgAwuAEAAA8AELkBAADYAgAwugEBAAAAAb4BQACbAgAhvwFAAJsCACHPAQEAmgIAIewBAQCZAgAh7QEBAJkCACHuAQIAsQIAIe8BEAClAgAhAwAAAA8AIAEAABAAMAIAABEAIAMAAAAPACABAAAQADACAAARACABAAAADwAgCgsAANICACC3AQAA1gIAMLgBAAAVABC5AQAA1gIAMLoBAQCZAgAhvgFAAJsCACHhAQEAmQIAIeMBAQCaAgAh5AEBAJoCACHqAQAA1wLqASIBCwAAkwQAIAoLAADSAgAgtwEAANYCADC4AQAAFQAQuQEAANYCADC6AQEAAAABvgFAAJsCACHhAQEAmQIAIeMBAQCaAgAh5AEBAJoCACHqAQAA1wLqASIDAAAAFQAgAQAAFgAwAgAAFwAgDQsAANICACC3AQAA0wIAMLgBAAAZABC5AQAA0wIAMLoBAQCZAgAhvgFAAJsCACG_AUAAmwIAIdABEAClAgAh4QEBAJkCACHjAQEA1QIAIeQBAQDVAgAh6gEAANQC6gEj6wEgAMgCACEECwAAkwQAIOMBAADdAwAg5AEAAN0DACDqAQAA3QMAIA0LAADSAgAgtwEAANMCADC4AQAAGQAQuQEAANMCADC6AQEAAAABvgFAAJsCACG_AUAAmwIAIdABEAClAgAh4QEBAJkCACHjAQEA1QIAIeQBAQDVAgAh6gEAANQC6gEj6wEgAMgCACEDAAAAGQAgAQAAGgAwAgAAGwAgDwsAANICACC3AQAA0AIAMLgBAAAdABC5AQAA0AIAMLoBAQCZAgAhvgFAAJsCACG_AUAAmwIAIeABAQCaAgAh4QEBAJkCACHiAUAAmwIAIeMBAQCaAgAh5AEBAJoCACHlAQEAmgIAIeYBAQCaAgAh6AEAANEC6AEiAQsAAJMEACAQCwAA0gIAILcBAADQAgAwuAEAAB0AELkBAADQAgAwugEBAAAAAb4BQACbAgAhvwFAAJsCACHgAQEAAAAB4QEBAJkCACHiAUAAmwIAIeMBAQCaAgAh5AEBAJoCACHlAQEAmgIAIeYBAQCaAgAh6AEAANEC6AEi-QEAAM8CACADAAAAHQAgAQAAHgAwAgAAHwAgAQAAABUAIAEAAAAZACABAAAAHQAgAQAAAAkAIAEAAAAPACABAAAAAQAgAwAAAAUAIAEAAAYAMAIAAAEAIAMAAAAFACABAAAGADACAAABACADAAAABQAgAQAABgAwAgAAAQAgCwUAAJIEACAIAADZAwAgCQAA2gMAILoBAQAAAAG-AUAAAAABvwFAAAAAAfQBAQAAAAH1AQEAAAAB9gEBAAAAAfcBAQAAAAH4AQEAAAABARQAACoAIAi6AQEAAAABvgFAAAAAAb8BQAAAAAH0AQEAAAAB9QEBAAAAAfYBAQAAAAH3AQEAAAAB-AEBAAAAAQEUAAAsADABFAAALAAwAQAAAAMAIAsFAACRBAAgCAAAjgMAIAkAAI8DACC6AQEA5wIAIb4BQADoAgAhvwFAAOgCACH0AQEA5wIAIfUBAQCMAwAh9gEBAOcCACH3AQEA5wIAIfgBAQCMAwAhAgAAAAEAIBQAADAAIAi6AQEA5wIAIb4BQADoAgAhvwFAAOgCACH0AQEA5wIAIfUBAQCMAwAh9gEBAOcCACH3AQEA5wIAIfgBAQCMAwAhAgAAAAUAIBQAADIAIAIAAAAFACAUAAAyACABAAAAAwAgAwAAAAEAIBsAACoAIBwAADAAIAEAAAABACABAAAABQAgBQQAAI4EACAhAACQBAAgIgAAjwQAIPUBAADdAwAg-AEAAN0DACALtwEAAM4CADC4AQAAOgAQuQEAAM4CADC6AQEAjwIAIb4BQACRAgAhvwFAAJECACH0AQEAkAIAIfUBAQC5AgAh9gEBAJACACH3AQEAkAIAIfgBAQC5AgAhAwAAAAUAIAEAADkAMCAAADoAIAMAAAAFACABAAAGADACAAABACABAAAACwAgAQAAAAsAIAMAAAAJACABAAAKADACAAALACADAAAACQAgAQAACgAwAgAACwAgAwAAAAkAIAEAAAoAMAIAAAsAIAYGAAD4AgAgBwAA1wMAIL4BQAAAAAHsAQEAAAAB8QEBAAAAAfMBAAAA8wECARQAAEIAIAS-AUAAAAAB7AEBAAAAAfEBAQAAAAHzAQAAAPMBAgEUAABEADABFAAARAAwBgYAAPYCACAHAADVAwAgvgFAAOgCACHsAQEA5wIAIfEBAQDnAgAh8wEAAPQC8wEiAgAAAAsAIBQAAEcAIAS-AUAA6AIAIewBAQDnAgAh8QEBAOcCACHzAQAA9ALzASICAAAACQAgFAAASQAgAgAAAAkAIBQAAEkAIAMAAAALACAbAABCACAcAABHACABAAAACwAgAQAAAAkAIAMEAACLBAAgIQAAjQQAICIAAIwEACAHtwEAAMoCADC4AQAAUAAQuQEAAMoCADC-AUAAkQIAIewBAQCPAgAh8QEBAI8CACHzAQAAywLzASIDAAAACQAgAQAATwAwIAAAUAAgAwAAAAkAIAEAAAoAMAIAAAsAIAoJAADJAgAgtwEAAMcCADC4AQAAVgAQuQEAAMcCADC6AQEAAAABvgFAAJsCACG_AUAAmwIAIc8BAQAAAAHrASAAyAIAIfABAQAAAAEBAAAAUwAgAQAAAFMAIAoJAADJAgAgtwEAAMcCADC4AQAAVgAQuQEAAMcCADC6AQEAmQIAIb4BQACbAgAhvwFAAJsCACHPAQEAmgIAIesBIADIAgAh8AEBAJoCACEBCQAAigQAIAMAAABWACABAABXADACAABTACADAAAAVgAgAQAAVwAwAgAAUwAgAwAAAFYAIAEAAFcAMAIAAFMAIAcJAACJBAAgugEBAAAAAb4BQAAAAAG_AUAAAAABzwEBAAAAAesBIAAAAAHwAQEAAAABARQAAFsAIAa6AQEAAAABvgFAAAAAAb8BQAAAAAHPAQEAAAAB6wEgAAAAAfABAQAAAAEBFAAAXQAwARQAAF0AMAcJAAD_AwAgugEBAOcCACG-AUAA6AIAIb8BQADoAgAhzwEBAOcCACHrASAAuAMAIfABAQDnAgAhAgAAAFMAIBQAAGAAIAa6AQEA5wIAIb4BQADoAgAhvwFAAOgCACHPAQEA5wIAIesBIAC4AwAh8AEBAOcCACECAAAAVgAgFAAAYgAgAgAAAFYAIBQAAGIAIAMAAABTACAbAABbACAcAABgACABAAAAUwAgAQAAAFYAIAMEAAD8AwAgIQAA_gMAICIAAP0DACAJtwEAAMYCADC4AQAAaQAQuQEAAMYCADC6AQEAjwIAIb4BQACRAgAhvwFAAJECACHPAQEAkAIAIesBIAC6AgAh8AEBAJACACEDAAAAVgAgAQAAaAAwIAAAaQAgAwAAAFYAIAEAAFcAMAIAAFMAIAEAAAARACABAAAAEQAgAwAAAA8AIAEAABAAMAIAABEAIAMAAAAPACABAAAQADACAAARACADAAAADwAgAQAAEAAwAgAAEQAgDQYAAPsDACAKAADJAwAgDAAAygMAIA0AAMsDACAOAADMAwAgugEBAAAAAb4BQAAAAAG_AUAAAAABzwEBAAAAAewBAQAAAAHtAQEAAAAB7gECAAAAAe8BEAAAAAEBFAAAcQAgCLoBAQAAAAG-AUAAAAABvwFAAAAAAc8BAQAAAAHsAQEAAAAB7QEBAAAAAe4BAgAAAAHvARAAAAABARQAAHMAMAEUAABzADANBgAA-gMAIAoAAJwDACAMAACdAwAgDQAAngMAIA4AAJ8DACC6AQEA5wIAIb4BQADoAgAhvwFAAOgCACHPAQEA5wIAIewBAQDnAgAh7QEBAOcCACHuAQIAmgMAIe8BEACAAwAhAgAAABEAIBQAAHYAIAi6AQEA5wIAIb4BQADoAgAhvwFAAOgCACHPAQEA5wIAIewBAQDnAgAh7QEBAOcCACHuAQIAmgMAIe8BEACAAwAhAgAAAA8AIBQAAHgAIAIAAAAPACAUAAB4ACADAAAAEQAgGwAAcQAgHAAAdgAgAQAAABEAIAEAAAAPACAFBAAA9QMAICEAAPgDACAiAAD3AwAgUwAA9gMAIFQAAPkDACALtwEAAMUCADC4AQAAfwAQuQEAAMUCADC6AQEAjwIAIb4BQACRAgAhvwFAAJECACHPAQEAkAIAIewBAQCPAgAh7QEBAI8CACHuAQIAqQIAIe8BEACfAgAhAwAAAA8AIAEAAH4AMCAAAH8AIAMAAAAPACABAAAQADACAAARACABAAAAFwAgAQAAABcAIAMAAAAVACABAAAWADACAAAXACADAAAAFQAgAQAAFgAwAgAAFwAgAwAAABUAIAEAABYAMAIAABcAIAcLAAD0AwAgugEBAAAAAb4BQAAAAAHhAQEAAAAB4wEBAAAAAeQBAQAAAAHqAQAAAOoBAgEUAACHAQAgBroBAQAAAAG-AUAAAAAB4QEBAAAAAeMBAQAAAAHkAQEAAAAB6gEAAADqAQIBFAAAiQEAMAEUAACJAQAwBwsAAPMDACC6AQEA5wIAIb4BQADoAgAh4QEBAOcCACHjAQEA5wIAIeQBAQDnAgAh6gEAAMUD6gEiAgAAABcAIBQAAIwBACAGugEBAOcCACG-AUAA6AIAIeEBAQDnAgAh4wEBAOcCACHkAQEA5wIAIeoBAADFA-oBIgIAAAAVACAUAACOAQAgAgAAABUAIBQAAI4BACADAAAAFwAgGwAAhwEAIBwAAIwBACABAAAAFwAgAQAAABUAIAMEAADwAwAgIQAA8gMAICIAAPEDACAJtwEAAMECADC4AQAAlQEAELkBAADBAgAwugEBAI8CACG-AUAAkQIAIeEBAQCPAgAh4wEBAJACACHkAQEAkAIAIeoBAADCAuoBIgMAAAAVACABAACUAQAwIAAAlQEAIAMAAAAVACABAAAWADACAAAXACABAAAAGwAgAQAAABsAIAMAAAAZACABAAAaADACAAAbACADAAAAGQAgAQAAGgAwAgAAGwAgAwAAABkAIAEAABoAMAIAABsAIAoLAADvAwAgugEBAAAAAb4BQAAAAAG_AUAAAAAB0AEQAAAAAeEBAQAAAAHjAQEAAAAB5AEBAAAAAeoBAAAA6gED6wEgAAAAAQEUAACdAQAgCboBAQAAAAG-AUAAAAABvwFAAAAAAdABEAAAAAHhAQEAAAAB4wEBAAAAAeQBAQAAAAHqAQAAAOoBA-sBIAAAAAEBFAAAnwEAMAEUAACfAQAwCgsAAO4DACC6AQEA5wIAIb4BQADoAgAhvwFAAOgCACHQARAAgAMAIeEBAQDnAgAh4wEBAIwDACHkAQEAjAMAIeoBAAC3A-oBI-sBIAC4AwAhAgAAABsAIBQAAKIBACAJugEBAOcCACG-AUAA6AIAIb8BQADoAgAh0AEQAIADACHhAQEA5wIAIeMBAQCMAwAh5AEBAIwDACHqAQAAtwPqASPrASAAuAMAIQIAAAAZACAUAACkAQAgAgAAABkAIBQAAKQBACADAAAAGwAgGwAAnQEAIBwAAKIBACABAAAAGwAgAQAAABkAIAgEAADpAwAgIQAA7AMAICIAAOsDACBTAADqAwAgVAAA7QMAIOMBAADdAwAg5AEAAN0DACDqAQAA3QMAIAy3AQAAtwIAMLgBAACrAQAQuQEAALcCADC6AQEAjwIAIb4BQACRAgAhvwFAAJECACHQARAAnwIAIeEBAQCPAgAh4wEBALkCACHkAQEAuQIAIeoBAAC4AuoBI-sBIAC6AgAhAwAAABkAIAEAAKoBADAgAACrAQAgAwAAABkAIAEAABoAMAIAABsAIAEAAAAfACABAAAAHwAgAwAAAB0AIAEAAB4AMAIAAB8AIAMAAAAdACABAAAeADACAAAfACADAAAAHQAgAQAAHgAwAgAAHwAgDAsAAOgDACC6AQEAAAABvgFAAAAAAb8BQAAAAAHgAQEAAAAB4QEBAAAAAeIBQAAAAAHjAQEAAAAB5AEBAAAAAeUBAQAAAAHmAQEAAAAB6AEAAADoAQIBFAAAswEAIAu6AQEAAAABvgFAAAAAAb8BQAAAAAHgAQEAAAAB4QEBAAAAAeIBQAAAAAHjAQEAAAAB5AEBAAAAAeUBAQAAAAHmAQEAAAAB6AEAAADoAQIBFAAAtQEAMAEUAAC1AQAwDAsAAOcDACC6AQEA5wIAIb4BQADoAgAhvwFAAOgCACHgAQEA5wIAIeEBAQDnAgAh4gFAAOgCACHjAQEA5wIAIeQBAQDnAgAh5QEBAOcCACHmAQEA5wIAIegBAACqA-gBIgIAAAAfACAUAAC4AQAgC7oBAQDnAgAhvgFAAOgCACG_AUAA6AIAIeABAQDnAgAh4QEBAOcCACHiAUAA6AIAIeMBAQDnAgAh5AEBAOcCACHlAQEA5wIAIeYBAQDnAgAh6AEAAKoD6AEiAgAAAB0AIBQAALoBACACAAAAHQAgFAAAugEAIAMAAAAfACAbAACzAQAgHAAAuAEAIAEAAAAfACABAAAAHQAgAwQAAOQDACAhAADmAwAgIgAA5QMAIA63AQAAswIAMLgBAADBAQAQuQEAALMCADC6AQEAjwIAIb4BQACRAgAhvwFAAJECACHgAQEAkAIAIeEBAQCPAgAh4gFAAJECACHjAQEAkAIAIeQBAQCQAgAh5QEBAJACACHmAQEAkAIAIegBAAC0AugBIgMAAAAdACABAADAAQAwIAAAwQEAIAMAAAAdACABAAAeADACAAAfACAPtwEAALACADC4AQAAxwEAELkBAACwAgAwugEBAAAAAbwBAQCaAgAhvQEBAJoCACG-AUAAmwIAIb8BQACbAgAh2QEBAJoCACHaAUAAmwIAIdsBAgCxAgAh3AFAAJsCACHdAQIAsQIAId4BQACyAgAh3wFAALICACEBAAAAxAEAIAEAAADEAQAgD7cBAACwAgAwuAEAAMcBABC5AQAAsAIAMLoBAQCZAgAhvAEBAJoCACG9AQEAmgIAIb4BQACbAgAhvwFAAJsCACHZAQEAmgIAIdoBQACbAgAh2wECALECACHcAUAAmwIAId0BAgCxAgAh3gFAALICACHfAUAAsgIAIQLeAQAA3QMAIN8BAADdAwAgAwAAAMcBACABAADIAQAwAgAAxAEAIAMAAADHAQAgAQAAyAEAMAIAAMQBACADAAAAxwEAIAEAAMgBADACAADEAQAgDLoBAQAAAAG8AQEAAAABvQEBAAAAAb4BQAAAAAG_AUAAAAAB2QEBAAAAAdoBQAAAAAHbAQIAAAAB3AFAAAAAAd0BAgAAAAHeAUAAAAAB3wFAAAAAAQEUAADMAQAgDLoBAQAAAAG8AQEAAAABvQEBAAAAAb4BQAAAAAG_AUAAAAAB2QEBAAAAAdoBQAAAAAHbAQIAAAAB3AFAAAAAAd0BAgAAAAHeAUAAAAAB3wFAAAAAAQEUAADOAQAwARQAAM4BADAMugEBAOcCACG8AQEA5wIAIb0BAQDnAgAhvgFAAOgCACG_AUAA6AIAIdkBAQDnAgAh2gFAAOgCACHbAQIAmgMAIdwBQADoAgAh3QECAJoDACHeAUAA4wMAId8BQADjAwAhAgAAAMQBACAUAADRAQAgDLoBAQDnAgAhvAEBAOcCACG9AQEA5wIAIb4BQADoAgAhvwFAAOgCACHZAQEA5wIAIdoBQADoAgAh2wECAJoDACHcAUAA6AIAId0BAgCaAwAh3gFAAOMDACHfAUAA4wMAIQIAAADHAQAgFAAA0wEAIAIAAADHAQAgFAAA0wEAIAMAAADEAQAgGwAAzAEAIBwAANEBACABAAAAxAEAIAEAAADHAQAgBwQAAN4DACAhAADhAwAgIgAA4AMAIFMAAN8DACBUAADiAwAg3gEAAN0DACDfAQAA3QMAIA-3AQAAqAIAMLgBAADaAQAQuQEAAKgCADC6AQEAjwIAIbwBAQCQAgAhvQEBAJACACG-AUAAkQIAIb8BQACRAgAh2QEBAJACACHaAUAAkQIAIdsBAgCpAgAh3AFAAJECACHdAQIAqQIAId4BQACqAgAh3wFAAKoCACEDAAAAxwEAIAEAANkBADAgAADaAQAgAwAAAMcBACABAADIAQAwAgAAxAEAIAkDAACnAgAgtwEAAKQCADC4AQAAAwAQuQEAAKQCADDOAQEAAAABzwEBAJoCACHQARAApQIAIdEBAACmAgAg0gFAAJsCACEBAAAA3QEAIAEAAADdAQAgAQMAANwDACADAAAAAwAgAQAA4AEAMAIAAN0BACADAAAAAwAgAQAA4AEAMAIAAN0BACADAAAAAwAgAQAA4AEAMAIAAN0BACAGAwAA2wMAIM4BAQAAAAHPAQEAAAAB0AEQAAAAAdEBgAAAAAHSAUAAAAABARQAAOQBACAFzgEBAAAAAc8BAQAAAAHQARAAAAAB0QGAAAAAAdIBQAAAAAEBFAAA5gEAMAEUAADmAQAwBgMAAIEDACDOAQEA5wIAIc8BAQDnAgAh0AEQAIADACHRAYAAAAAB0gFAAOgCACECAAAA3QEAIBQAAOkBACAFzgEBAOcCACHPAQEA5wIAIdABEACAAwAh0QGAAAAAAdIBQADoAgAhAgAAAAMAIBQAAOsBACACAAAAAwAgFAAA6wEAIAMAAADdAQAgGwAA5AEAIBwAAOkBACABAAAA3QEAIAEAAAADACAFBAAA-wIAICEAAP4CACAiAAD9AgAgUwAA_AIAIFQAAP8CACAItwEAAJ4CADC4AQAA8gEAELkBAACeAgAwzgEBAJACACHPAQEAkAIAIdABEACfAgAh0QEAAKACACDSAUAAkQIAIQMAAAADACABAADxAQAwIAAA8gEAIAMAAAADACABAADgAQAwAgAA3QEAIAoDAACcAgAgtwEAAJgCADC4AQAA-AEAELkBAACYAgAwugEBAAAAAbsBAQAAAAG8AQEAAAABvQEBAJoCACG-AUAAmwIAIb8BQACbAgAhAQAAAPUBACABAAAA9QEAIAoDAACcAgAgtwEAAJgCADC4AQAA-AEAELkBAACYAgAwugEBAJkCACG7AQEAmQIAIbwBAQCaAgAhvQEBAJoCACG-AUAAmwIAIb8BQACbAgAhAQMAAPoCACADAAAA-AEAIAEAAPkBADACAAD1AQAgAwAAAPgBACABAAD5AQAwAgAA9QEAIAMAAAD4AQAgAQAA-QEAMAIAAPUBACAHAwAA-QIAILoBAQAAAAG7AQEAAAABvAEBAAAAAb0BAQAAAAG-AUAAAAABvwFAAAAAAQEUAAD9AQAgBroBAQAAAAG7AQEAAAABvAEBAAAAAb0BAQAAAAG-AUAAAAABvwFAAAAAAQEUAAD_AQAwARQAAP8BADAHAwAA6QIAILoBAQDnAgAhuwEBAOcCACG8AQEA5wIAIb0BAQDnAgAhvgFAAOgCACG_AUAA6AIAIQIAAAD1AQAgFAAAggIAIAa6AQEA5wIAIbsBAQDnAgAhvAEBAOcCACG9AQEA5wIAIb4BQADoAgAhvwFAAOgCACECAAAA-AEAIBQAAIQCACACAAAA-AEAIBQAAIQCACADAAAA9QEAIBsAAP0BACAcAACCAgAgAQAAAPUBACABAAAA-AEAIAMEAADkAgAgIQAA5gIAICIAAOUCACAJtwEAAI4CADC4AQAAiwIAELkBAACOAgAwugEBAI8CACG7AQEAjwIAIbwBAQCQAgAhvQEBAJACACG-AUAAkQIAIb8BQACRAgAhAwAAAPgBACABAACKAgAwIAAAiwIAIAMAAAD4AQAgAQAA-QEAMAIAAPUBACAJtwEAAI4CADC4AQAAiwIAELkBAACOAgAwugEBAI8CACG7AQEAjwIAIbwBAQCQAgAhvQEBAJACACG-AUAAkQIAIb8BQACRAgAhCwQAAJMCACAhAACWAgAgIgAAlgIAIMABAQAAAAHBAQEAAAAEwgEBAAAABMMBAQAAAAHEAQEAAAABxQEBAAAAAcYBAQAAAAHHAQEAlwIAIQ4EAACTAgAgIQAAlgIAICIAAJYCACDAAQEAAAABwQEBAAAABMIBAQAAAATDAQEAAAABxAEBAAAAAcUBAQAAAAHGAQEAAAABxwEBAJUCACHIAQEAAAAByQEBAAAAAcoBAQAAAAELBAAAkwIAICEAAJQCACAiAACUAgAgwAFAAAAAAcEBQAAAAATCAUAAAAAEwwFAAAAAAcQBQAAAAAHFAUAAAAABxgFAAAAAAccBQACSAgAhCwQAAJMCACAhAACUAgAgIgAAlAIAIMABQAAAAAHBAUAAAAAEwgFAAAAABMMBQAAAAAHEAUAAAAABxQFAAAAAAcYBQAAAAAHHAUAAkgIAIQjAAQIAAAABwQECAAAABMIBAgAAAATDAQIAAAABxAECAAAAAcUBAgAAAAHGAQIAAAABxwECAJMCACEIwAFAAAAAAcEBQAAAAATCAUAAAAAEwwFAAAAAAcQBQAAAAAHFAUAAAAABxgFAAAAAAccBQACUAgAhDgQAAJMCACAhAACWAgAgIgAAlgIAIMABAQAAAAHBAQEAAAAEwgEBAAAABMMBAQAAAAHEAQEAAAABxQEBAAAAAcYBAQAAAAHHAQEAlQIAIcgBAQAAAAHJAQEAAAABygEBAAAAAQvAAQEAAAABwQEBAAAABMIBAQAAAATDAQEAAAABxAEBAAAAAcUBAQAAAAHGAQEAAAABxwEBAJYCACHIAQEAAAAByQEBAAAAAcoBAQAAAAELBAAAkwIAICEAAJYCACAiAACWAgAgwAEBAAAAAcEBAQAAAATCAQEAAAAEwwEBAAAAAcQBAQAAAAHFAQEAAAABxgEBAAAAAccBAQCXAgAhCgMAAJwCACC3AQAAmAIAMLgBAAD4AQAQuQEAAJgCADC6AQEAmQIAIbsBAQCZAgAhvAEBAJoCACG9AQEAmgIAIb4BQACbAgAhvwFAAJsCACEIwAEBAAAAAcEBAQAAAATCAQEAAAAEwwEBAAAAAcQBAQAAAAHFAQEAAAABxgEBAAAAAccBAQCdAgAhC8ABAQAAAAHBAQEAAAAEwgEBAAAABMMBAQAAAAHEAQEAAAABxQEBAAAAAcYBAQAAAAHHAQEAlgIAIcgBAQAAAAHJAQEAAAABygEBAAAAAQjAAUAAAAABwQFAAAAABMIBQAAAAATDAUAAAAABxAFAAAAAAcUBQAAAAAHGAUAAAAABxwFAAJQCACEDywEAAAkAIMwBAAAJACDNAQAACQAgCMABAQAAAAHBAQEAAAAEwgEBAAAABMMBAQAAAAHEAQEAAAABxQEBAAAAAcYBAQAAAAHHAQEAnQIAIQi3AQAAngIAMLgBAADyAQAQuQEAAJ4CADDOAQEAkAIAIc8BAQCQAgAh0AEQAJ8CACHRAQAAoAIAINIBQACRAgAhDQQAAJMCACAhAACjAgAgIgAAowIAIFMAAKMCACBUAACjAgAgwAEQAAAAAcEBEAAAAATCARAAAAAEwwEQAAAAAcQBEAAAAAHFARAAAAABxgEQAAAAAccBEACiAgAhDwQAAJMCACAhAAChAgAgIgAAoQIAIMABgAAAAAHDAYAAAAABxAGAAAAAAcUBgAAAAAHGAYAAAAABxwGAAAAAAdMBAQAAAAHUAQEAAAAB1QEBAAAAAdYBgAAAAAHXAYAAAAAB2AGAAAAAAQzAAYAAAAABwwGAAAAAAcQBgAAAAAHFAYAAAAABxgGAAAAAAccBgAAAAAHTAQEAAAAB1AEBAAAAAdUBAQAAAAHWAYAAAAAB1wGAAAAAAdgBgAAAAAENBAAAkwIAICEAAKMCACAiAACjAgAgUwAAowIAIFQAAKMCACDAARAAAAABwQEQAAAABMIBEAAAAATDARAAAAABxAEQAAAAAcUBEAAAAAHGARAAAAABxwEQAKICACEIwAEQAAAAAcEBEAAAAATCARAAAAAEwwEQAAAAAcQBEAAAAAHFARAAAAABxgEQAAAAAccBEACjAgAhCQMAAKcCACC3AQAApAIAMLgBAAADABC5AQAApAIAMM4BAQCaAgAhzwEBAJoCACHQARAApQIAIdEBAACmAgAg0gFAAJsCACEIwAEQAAAAAcEBEAAAAATCARAAAAAEwwEQAAAAAcQBEAAAAAHFARAAAAABxgEQAAAAAccBEACjAgAhDMABgAAAAAHDAYAAAAABxAGAAAAAAcUBgAAAAAHGAYAAAAABxwGAAAAAAdMBAQAAAAHUAQEAAAAB1QEBAAAAAdYBgAAAAAHXAYAAAAAB2AGAAAAAAQPLAQAABQAgzAEAAAUAIM0BAAAFACAPtwEAAKgCADC4AQAA2gEAELkBAACoAgAwugEBAI8CACG8AQEAkAIAIb0BAQCQAgAhvgFAAJECACG_AUAAkQIAIdkBAQCQAgAh2gFAAJECACHbAQIAqQIAIdwBQACRAgAh3QECAKkCACHeAUAAqgIAId8BQACqAgAhDQQAAJMCACAhAACTAgAgIgAAkwIAIFMAAK8CACBUAACTAgAgwAECAAAAAcEBAgAAAATCAQIAAAAEwwECAAAAAcQBAgAAAAHFAQIAAAABxgECAAAAAccBAgCuAgAhCwQAAKwCACAhAACtAgAgIgAArQIAIMABQAAAAAHBAUAAAAAFwgFAAAAABcMBQAAAAAHEAUAAAAABxQFAAAAAAcYBQAAAAAHHAUAAqwIAIQsEAACsAgAgIQAArQIAICIAAK0CACDAAUAAAAABwQFAAAAABcIBQAAAAAXDAUAAAAABxAFAAAAAAcUBQAAAAAHGAUAAAAABxwFAAKsCACEIwAECAAAAAcEBAgAAAAXCAQIAAAAFwwECAAAAAcQBAgAAAAHFAQIAAAABxgECAAAAAccBAgCsAgAhCMABQAAAAAHBAUAAAAAFwgFAAAAABcMBQAAAAAHEAUAAAAABxQFAAAAAAcYBQAAAAAHHAUAArQIAIQ0EAACTAgAgIQAAkwIAICIAAJMCACBTAACvAgAgVAAAkwIAIMABAgAAAAHBAQIAAAAEwgECAAAABMMBAgAAAAHEAQIAAAABxQECAAAAAcYBAgAAAAHHAQIArgIAIQjAAQgAAAABwQEIAAAABMIBCAAAAATDAQgAAAABxAEIAAAAAcUBCAAAAAHGAQgAAAABxwEIAK8CACEPtwEAALACADC4AQAAxwEAELkBAACwAgAwugEBAJkCACG8AQEAmgIAIb0BAQCaAgAhvgFAAJsCACG_AUAAmwIAIdkBAQCaAgAh2gFAAJsCACHbAQIAsQIAIdwBQACbAgAh3QECALECACHeAUAAsgIAId8BQACyAgAhCMABAgAAAAHBAQIAAAAEwgECAAAABMMBAgAAAAHEAQIAAAABxQECAAAAAcYBAgAAAAHHAQIAkwIAIQjAAUAAAAABwQFAAAAABcIBQAAAAAXDAUAAAAABxAFAAAAAAcUBQAAAAAHGAUAAAAABxwFAAK0CACEOtwEAALMCADC4AQAAwQEAELkBAACzAgAwugEBAI8CACG-AUAAkQIAIb8BQACRAgAh4AEBAJACACHhAQEAjwIAIeIBQACRAgAh4wEBAJACACHkAQEAkAIAIeUBAQCQAgAh5gEBAJACACHoAQAAtALoASIHBAAAkwIAICEAALYCACAiAAC2AgAgwAEAAADoAQLBAQAAAOgBCMIBAAAA6AEIxwEAALUC6AEiBwQAAJMCACAhAAC2AgAgIgAAtgIAIMABAAAA6AECwQEAAADoAQjCAQAAAOgBCMcBAAC1AugBIgTAAQAAAOgBAsEBAAAA6AEIwgEAAADoAQjHAQAAtgLoASIMtwEAALcCADC4AQAAqwEAELkBAAC3AgAwugEBAI8CACG-AUAAkQIAIb8BQACRAgAh0AEQAJ8CACHhAQEAjwIAIeMBAQC5AgAh5AEBALkCACHqAQAAuALqASPrASAAugIAIQcEAACsAgAgIQAAwAIAICIAAMACACDAAQAAAOoBA8EBAAAA6gEJwgEAAADqAQnHAQAAvwLqASMOBAAArAIAICEAAL4CACAiAAC-AgAgwAEBAAAAAcEBAQAAAAXCAQEAAAAFwwEBAAAAAcQBAQAAAAHFAQEAAAABxgEBAAAAAccBAQC9AgAhyAEBAAAAAckBAQAAAAHKAQEAAAABBQQAAJMCACAhAAC8AgAgIgAAvAIAIMABIAAAAAHHASAAuwIAIQUEAACTAgAgIQAAvAIAICIAALwCACDAASAAAAABxwEgALsCACECwAEgAAAAAccBIAC8AgAhDgQAAKwCACAhAAC-AgAgIgAAvgIAIMABAQAAAAHBAQEAAAAFwgEBAAAABcMBAQAAAAHEAQEAAAABxQEBAAAAAcYBAQAAAAHHAQEAvQIAIcgBAQAAAAHJAQEAAAABygEBAAAAAQvAAQEAAAABwQEBAAAABcIBAQAAAAXDAQEAAAABxAEBAAAAAcUBAQAAAAHGAQEAAAABxwEBAL4CACHIAQEAAAAByQEBAAAAAcoBAQAAAAEHBAAArAIAICEAAMACACAiAADAAgAgwAEAAADqAQPBAQAAAOoBCcIBAAAA6gEJxwEAAL8C6gEjBMABAAAA6gEDwQEAAADqAQnCAQAAAOoBCccBAADAAuoBIwm3AQAAwQIAMLgBAACVAQAQuQEAAMECADC6AQEAjwIAIb4BQACRAgAh4QEBAI8CACHjAQEAkAIAIeQBAQCQAgAh6gEAAMIC6gEiBwQAAJMCACAhAADEAgAgIgAAxAIAIMABAAAA6gECwQEAAADqAQjCAQAAAOoBCMcBAADDAuoBIgcEAACTAgAgIQAAxAIAICIAAMQCACDAAQAAAOoBAsEBAAAA6gEIwgEAAADqAQjHAQAAwwLqASIEwAEAAADqAQLBAQAAAOoBCMIBAAAA6gEIxwEAAMQC6gEiC7cBAADFAgAwuAEAAH8AELkBAADFAgAwugEBAI8CACG-AUAAkQIAIb8BQACRAgAhzwEBAJACACHsAQEAjwIAIe0BAQCPAgAh7gECAKkCACHvARAAnwIAIQm3AQAAxgIAMLgBAABpABC5AQAAxgIAMLoBAQCPAgAhvgFAAJECACG_AUAAkQIAIc8BAQCQAgAh6wEgALoCACHwAQEAkAIAIQoJAADJAgAgtwEAAMcCADC4AQAAVgAQuQEAAMcCADC6AQEAmQIAIb4BQACbAgAhvwFAAJsCACHPAQEAmgIAIesBIADIAgAh8AEBAJoCACECwAEgAAAAAccBIAC8AgAhA8sBAAAPACDMAQAADwAgzQEAAA8AIAe3AQAAygIAMLgBAABQABC5AQAAygIAML4BQACRAgAh7AEBAI8CACHxAQEAjwIAIfMBAADLAvMBIgcEAACTAgAgIQAAzQIAICIAAM0CACDAAQAAAPMBAsEBAAAA8wEIwgEAAADzAQjHAQAAzALzASIHBAAAkwIAICEAAM0CACAiAADNAgAgwAEAAADzAQLBAQAAAPMBCMIBAAAA8wEIxwEAAMwC8wEiBMABAAAA8wECwQEAAADzAQjCAQAAAPMBCMcBAADNAvMBIgu3AQAAzgIAMLgBAAA6ABC5AQAAzgIAMLoBAQCPAgAhvgFAAJECACG_AUAAkQIAIfQBAQCQAgAh9QEBALkCACH2AQEAkAIAIfcBAQCQAgAh-AEBALkCACED4QEBAAAAAeIBQAAAAAHjAQEAAAABDwsAANICACC3AQAA0AIAMLgBAAAdABC5AQAA0AIAMLoBAQCZAgAhvgFAAJsCACG_AUAAmwIAIeABAQCaAgAh4QEBAJkCACHiAUAAmwIAIeMBAQCaAgAh5AEBAJoCACHlAQEAmgIAIeYBAQCaAgAh6AEAANEC6AEiBMABAAAA6AECwQEAAADoAQjCAQAAAOgBCMcBAAC2AugBIhIGAADZAgAgCgAA2gIAIAwAANsCACANAADcAgAgDgAA3QIAILcBAADYAgAwuAEAAA8AELkBAADYAgAwugEBAJkCACG-AUAAmwIAIb8BQACbAgAhzwEBAJoCACHsAQEAmQIAIe0BAQCZAgAh7gECALECACHvARAApQIAIfsBAAAPACD8AQAADwAgDQsAANICACC3AQAA0wIAMLgBAAAZABC5AQAA0wIAMLoBAQCZAgAhvgFAAJsCACG_AUAAmwIAIdABEAClAgAh4QEBAJkCACHjAQEA1QIAIeQBAQDVAgAh6gEAANQC6gEj6wEgAMgCACEEwAEAAADqAQPBAQAAAOoBCcIBAAAA6gEJxwEAAMAC6gEjC8ABAQAAAAHBAQEAAAAFwgEBAAAABcMBAQAAAAHEAQEAAAABxQEBAAAAAcYBAQAAAAHHAQEAvgIAIcgBAQAAAAHJAQEAAAABygEBAAAAAQoLAADSAgAgtwEAANYCADC4AQAAFQAQuQEAANYCADC6AQEAmQIAIb4BQACbAgAh4QEBAJkCACHjAQEAmgIAIeQBAQCaAgAh6gEAANcC6gEiBMABAAAA6gECwQEAAADqAQjCAQAAAOoBCMcBAADEAuoBIhAGAADZAgAgCgAA2gIAIAwAANsCACANAADcAgAgDgAA3QIAILcBAADYAgAwuAEAAA8AELkBAADYAgAwugEBAJkCACG-AUAAmwIAIb8BQACbAgAhzwEBAJoCACHsAQEAmQIAIe0BAQCZAgAh7gECALECACHvARAApQIAIRAFAADjAgAgCAAAnAIAIAkAAMkCACC3AQAA4gIAMLgBAAAFABC5AQAA4gIAMLoBAQCZAgAhvgFAAJsCACG_AUAAmwIAIfQBAQCaAgAh9QEBANUCACH2AQEAmgIAIfcBAQCaAgAh-AEBANUCACH7AQAABQAg_AEAAAUAIAwJAADJAgAgtwEAAMcCADC4AQAAVgAQuQEAAMcCADC6AQEAmQIAIb4BQACbAgAhvwFAAJsCACHPAQEAmgIAIesBIADIAgAh8AEBAJoCACH7AQAAVgAg_AEAAFYAIAPLAQAAFQAgzAEAABUAIM0BAAAVACADywEAABkAIMwBAAAZACDNAQAAGQAgA8sBAAAdACDMAQAAHQAgzQEAAB0AIALsAQEAAAAB8QEBAAAAAQkGAADZAgAgBwAA4QIAILcBAADfAgAwuAEAAAkAELkBAADfAgAwvgFAAJsCACHsAQEAmQIAIfEBAQCZAgAh8wEAAOAC8wEiBMABAAAA8wECwQEAAADzAQjCAQAAAPMBCMcBAADNAvMBIgwDAACcAgAgtwEAAJgCADC4AQAA-AEAELkBAACYAgAwugEBAJkCACG7AQEAmQIAIbwBAQCaAgAhvQEBAJoCACG-AUAAmwIAIb8BQACbAgAh-wEAAPgBACD8AQAA-AEAIA4FAADjAgAgCAAAnAIAIAkAAMkCACC3AQAA4gIAMLgBAAAFABC5AQAA4gIAMLoBAQCZAgAhvgFAAJsCACG_AUAAmwIAIfQBAQCaAgAh9QEBANUCACH2AQEAmgIAIfcBAQCaAgAh-AEBANUCACELAwAApwIAILcBAACkAgAwuAEAAAMAELkBAACkAgAwzgEBAJoCACHPAQEAmgIAIdABEAClAgAh0QEAAKYCACDSAUAAmwIAIfsBAAADACD8AQAAAwAgAAAAAYACAQAAAAEBgAJAAAAAAQsbAADqAgAwHAAA7wIAMP0BAADrAgAw_gEAAOwCADD_AQAA7QIAIIACAADuAgAwgQIAAO4CADCCAgAA7gIAMIMCAADuAgAwhAIAAPACADCFAgAA8QIAMAQGAAD4AgAgvgFAAAAAAewBAQAAAAHzAQAAAPMBAgIAAAALACAbAAD3AgAgAwAAAAsAIBsAAPcCACAcAAD1AgAgARQAAMoEADAKBgAA2QIAIAcAAOECACC3AQAA3wIAMLgBAAAJABC5AQAA3wIAML4BQACbAgAh7AEBAJkCACHxAQEAmQIAIfMBAADgAvMBIvoBAADeAgAgAgAAAAsAIBQAAPUCACACAAAA8gIAIBQAAPMCACAHtwEAAPECADC4AQAA8gIAELkBAADxAgAwvgFAAJsCACHsAQEAmQIAIfEBAQCZAgAh8wEAAOAC8wEiB7cBAADxAgAwuAEAAPICABC5AQAA8QIAML4BQACbAgAh7AEBAJkCACHxAQEAmQIAIfMBAADgAvMBIgO-AUAA6AIAIewBAQDnAgAh8wEAAPQC8wEiAYACAAAA8wECBAYAAPYCACC-AUAA6AIAIewBAQDnAgAh8wEAAPQC8wEiBRsAAMUEACAcAADIBAAg_QEAAMYEACD-AQAAxwQAIIMCAAABACAEBgAA-AIAIL4BQAAAAAHsAQEAAAAB8wEAAADzAQIDGwAAxQQAIP0BAADGBAAggwIAAAEAIAQbAADqAgAw_QEAAOsCADD_AQAA7QIAIIMCAADuAgAwAAAAAAAABYACEAAAAAGGAhAAAAABhwIQAAAAAYgCEAAAAAGJAhAAAAABCxsAAIIDADAcAACHAwAw_QEAAIMDADD-AQAAhAMAMP8BAACFAwAggAIAAIYDADCBAgAAhgMAMIICAACGAwAwgwIAAIYDADCEAgAAiAMAMIUCAACJAwAwCQgAANkDACAJAADaAwAgugEBAAAAAb4BQAAAAAG_AUAAAAAB9AEBAAAAAfUBAQAAAAH2AQEAAAAB9wEBAAAAAQIAAAABACAbAADYAwAgAwAAAAEAIBsAANgDACAcAACNAwAgARQAAMQEADAOBQAA4wIAIAgAAJwCACAJAADJAgAgtwEAAOICADC4AQAABQAQuQEAAOICADC6AQEAAAABvgFAAJsCACG_AUAAmwIAIfQBAQCaAgAh9QEBANUCACH2AQEAAAAB9wEBAJoCACH4AQEA1QIAIQIAAAABACAUAACNAwAgAgAAAIoDACAUAACLAwAgC7cBAACJAwAwuAEAAIoDABC5AQAAiQMAMLoBAQCZAgAhvgFAAJsCACG_AUAAmwIAIfQBAQCaAgAh9QEBANUCACH2AQEAmgIAIfcBAQCaAgAh-AEBANUCACELtwEAAIkDADC4AQAAigMAELkBAACJAwAwugEBAJkCACG-AUAAmwIAIb8BQACbAgAh9AEBAJoCACH1AQEA1QIAIfYBAQCaAgAh9wEBAJoCACH4AQEA1QIAIQe6AQEA5wIAIb4BQADoAgAhvwFAAOgCACH0AQEA5wIAIfUBAQCMAwAh9gEBAOcCACH3AQEA5wIAIQGAAgEAAAABCQgAAI4DACAJAACPAwAgugEBAOcCACG-AUAA6AIAIb8BQADoAgAh9AEBAOcCACH1AQEAjAMAIfYBAQDnAgAh9wEBAOcCACELGwAAzQMAMBwAANEDADD9AQAAzgMAMP4BAADPAwAw_wEAANADACCAAgAA7gIAMIECAADuAgAwggIAAO4CADCDAgAA7gIAMIQCAADSAwAwhQIAAPECADALGwAAkAMAMBwAAJUDADD9AQAAkQMAMP4BAACSAwAw_wEAAJMDACCAAgAAlAMAMIECAACUAwAwggIAAJQDADCDAgAAlAMAMIQCAACWAwAwhQIAAJcDADALCgAAyQMAIAwAAMoDACANAADLAwAgDgAAzAMAILoBAQAAAAG-AUAAAAABvwFAAAAAAc8BAQAAAAHtAQEAAAAB7gECAAAAAe8BEAAAAAECAAAAEQAgGwAAyAMAIAMAAAARACAbAADIAwAgHAAAmwMAIAEUAADDBAAwEAYAANkCACAKAADaAgAgDAAA2wIAIA0AANwCACAOAADdAgAgtwEAANgCADC4AQAADwAQuQEAANgCADC6AQEAAAABvgFAAJsCACG_AUAAmwIAIc8BAQCaAgAh7AEBAJkCACHtAQEAmQIAIe4BAgCxAgAh7wEQAKUCACECAAAAEQAgFAAAmwMAIAIAAACYAwAgFAAAmQMAIAu3AQAAlwMAMLgBAACYAwAQuQEAAJcDADC6AQEAmQIAIb4BQACbAgAhvwFAAJsCACHPAQEAmgIAIewBAQCZAgAh7QEBAJkCACHuAQIAsQIAIe8BEAClAgAhC7cBAACXAwAwuAEAAJgDABC5AQAAlwMAMLoBAQCZAgAhvgFAAJsCACG_AUAAmwIAIc8BAQCaAgAh7AEBAJkCACHtAQEAmQIAIe4BAgCxAgAh7wEQAKUCACEHugEBAOcCACG-AUAA6AIAIb8BQADoAgAhzwEBAOcCACHtAQEA5wIAIe4BAgCaAwAh7wEQAIADACEFgAICAAAAAYYCAgAAAAGHAgIAAAABiAICAAAAAYkCAgAAAAELCgAAnAMAIAwAAJ0DACANAACeAwAgDgAAnwMAILoBAQDnAgAhvgFAAOgCACG_AUAA6AIAIc8BAQDnAgAh7QEBAOcCACHuAQIAmgMAIe8BEACAAwAhBRsAALsEACAcAADBBAAg_QEAALwEACD-AQAAwAQAIIMCAABTACALGwAAuwMAMBwAAMADADD9AQAAvAMAMP4BAAC9AwAw_wEAAL4DACCAAgAAvwMAMIECAAC_AwAwggIAAL8DADCDAgAAvwMAMIQCAADBAwAwhQIAAMIDADALGwAArQMAMBwAALIDADD9AQAArgMAMP4BAACvAwAw_wEAALADACCAAgAAsQMAMIECAACxAwAwggIAALEDADCDAgAAsQMAMIQCAACzAwAwhQIAALQDADALGwAAoAMAMBwAAKUDADD9AQAAoQMAMP4BAACiAwAw_wEAAKMDACCAAgAApAMAMIECAACkAwAwggIAAKQDADCDAgAApAMAMIQCAACmAwAwhQIAAKcDADAKugEBAAAAAb4BQAAAAAG_AUAAAAAB4AEBAAAAAeIBQAAAAAHjAQEAAAAB5AEBAAAAAeUBAQAAAAHmAQEAAAAB6AEAAADoAQICAAAAHwAgGwAArAMAIAMAAAAfACAbAACsAwAgHAAAqwMAIAEUAAC_BAAwEAsAANICACC3AQAA0AIAMLgBAAAdABC5AQAA0AIAMLoBAQAAAAG-AUAAmwIAIb8BQACbAgAh4AEBAAAAAeEBAQCZAgAh4gFAAJsCACHjAQEAmgIAIeQBAQCaAgAh5QEBAJoCACHmAQEAmgIAIegBAADRAugBIvkBAADPAgAgAgAAAB8AIBQAAKsDACACAAAAqAMAIBQAAKkDACAOtwEAAKcDADC4AQAAqAMAELkBAACnAwAwugEBAJkCACG-AUAAmwIAIb8BQACbAgAh4AEBAJoCACHhAQEAmQIAIeIBQACbAgAh4wEBAJoCACHkAQEAmgIAIeUBAQCaAgAh5gEBAJoCACHoAQAA0QLoASIOtwEAAKcDADC4AQAAqAMAELkBAACnAwAwugEBAJkCACG-AUAAmwIAIb8BQACbAgAh4AEBAJoCACHhAQEAmQIAIeIBQACbAgAh4wEBAJoCACHkAQEAmgIAIeUBAQCaAgAh5gEBAJoCACHoAQAA0QLoASIKugEBAOcCACG-AUAA6AIAIb8BQADoAgAh4AEBAOcCACHiAUAA6AIAIeMBAQDnAgAh5AEBAOcCACHlAQEA5wIAIeYBAQDnAgAh6AEAAKoD6AEiAYACAAAA6AECCroBAQDnAgAhvgFAAOgCACG_AUAA6AIAIeABAQDnAgAh4gFAAOgCACHjAQEA5wIAIeQBAQDnAgAh5QEBAOcCACHmAQEA5wIAIegBAACqA-gBIgq6AQEAAAABvgFAAAAAAb8BQAAAAAHgAQEAAAAB4gFAAAAAAeMBAQAAAAHkAQEAAAAB5QEBAAAAAeYBAQAAAAHoAQAAAOgBAgi6AQEAAAABvgFAAAAAAb8BQAAAAAHQARAAAAAB4wEBAAAAAeQBAQAAAAHqAQAAAOoBA-sBIAAAAAECAAAAGwAgGwAAugMAIAMAAAAbACAbAAC6AwAgHAAAuQMAIAEUAAC-BAAwDQsAANICACC3AQAA0wIAMLgBAAAZABC5AQAA0wIAMLoBAQAAAAG-AUAAmwIAIb8BQACbAgAh0AEQAKUCACHhAQEAmQIAIeMBAQDVAgAh5AEBANUCACHqAQAA1ALqASPrASAAyAIAIQIAAAAbACAUAAC5AwAgAgAAALUDACAUAAC2AwAgDLcBAAC0AwAwuAEAALUDABC5AQAAtAMAMLoBAQCZAgAhvgFAAJsCACG_AUAAmwIAIdABEAClAgAh4QEBAJkCACHjAQEA1QIAIeQBAQDVAgAh6gEAANQC6gEj6wEgAMgCACEMtwEAALQDADC4AQAAtQMAELkBAAC0AwAwugEBAJkCACG-AUAAmwIAIb8BQACbAgAh0AEQAKUCACHhAQEAmQIAIeMBAQDVAgAh5AEBANUCACHqAQAA1ALqASPrASAAyAIAIQi6AQEA5wIAIb4BQADoAgAhvwFAAOgCACHQARAAgAMAIeMBAQCMAwAh5AEBAIwDACHqAQAAtwPqASPrASAAuAMAIQGAAgAAAOoBAwGAAiAAAAABCLoBAQDnAgAhvgFAAOgCACG_AUAA6AIAIdABEACAAwAh4wEBAIwDACHkAQEAjAMAIeoBAAC3A-oBI-sBIAC4AwAhCLoBAQAAAAG-AUAAAAABvwFAAAAAAdABEAAAAAHjAQEAAAAB5AEBAAAAAeoBAAAA6gED6wEgAAAAAQW6AQEAAAABvgFAAAAAAeMBAQAAAAHkAQEAAAAB6gEAAADqAQICAAAAFwAgGwAAxwMAIAMAAAAXACAbAADHAwAgHAAAxgMAIAEUAAC9BAAwCgsAANICACC3AQAA1gIAMLgBAAAVABC5AQAA1gIAMLoBAQAAAAG-AUAAmwIAIeEBAQCZAgAh4wEBAJoCACHkAQEAmgIAIeoBAADXAuoBIgIAAAAXACAUAADGAwAgAgAAAMMDACAUAADEAwAgCbcBAADCAwAwuAEAAMMDABC5AQAAwgMAMLoBAQCZAgAhvgFAAJsCACHhAQEAmQIAIeMBAQCaAgAh5AEBAJoCACHqAQAA1wLqASIJtwEAAMIDADC4AQAAwwMAELkBAADCAwAwugEBAJkCACG-AUAAmwIAIeEBAQCZAgAh4wEBAJoCACHkAQEAmgIAIeoBAADXAuoBIgW6AQEA5wIAIb4BQADoAgAh4wEBAOcCACHkAQEA5wIAIeoBAADFA-oBIgGAAgAAAOoBAgW6AQEA5wIAIb4BQADoAgAh4wEBAOcCACHkAQEA5wIAIeoBAADFA-oBIgW6AQEAAAABvgFAAAAAAeMBAQAAAAHkAQEAAAAB6gEAAADqAQILCgAAyQMAIAwAAMoDACANAADLAwAgDgAAzAMAILoBAQAAAAG-AUAAAAABvwFAAAAAAc8BAQAAAAHtAQEAAAAB7gECAAAAAe8BEAAAAAEDGwAAuwQAIP0BAAC8BAAggwIAAFMAIAQbAAC7AwAw_QEAALwDADD_AQAAvgMAIIMCAAC_AwAwBBsAAK0DADD9AQAArgMAMP8BAACwAwAggwIAALEDADAEGwAAoAMAMP0BAAChAwAw_wEAAKMDACCDAgAApAMAMAQHAADXAwAgvgFAAAAAAfEBAQAAAAHzAQAAAPMBAgIAAAALACAbAADWAwAgAwAAAAsAIBsAANYDACAcAADUAwAgARQAALoEADACAAAACwAgFAAA1AMAIAIAAADyAgAgFAAA0wMAIAO-AUAA6AIAIfEBAQDnAgAh8wEAAPQC8wEiBAcAANUDACC-AUAA6AIAIfEBAQDnAgAh8wEAAPQC8wEiBRsAALUEACAcAAC4BAAg_QEAALYEACD-AQAAtwQAIIMCAAD1AQAgBAcAANcDACC-AUAAAAAB8QEBAAAAAfMBAAAA8wECAxsAALUEACD9AQAAtgQAIIMCAAD1AQAgCQgAANkDACAJAADaAwAgugEBAAAAAb4BQAAAAAG_AUAAAAAB9AEBAAAAAfUBAQAAAAH2AQEAAAAB9wEBAAAAAQQbAADNAwAw_QEAAM4DADD_AQAA0AMAIIMCAADuAgAwBBsAAJADADD9AQAAkQMAMP8BAACTAwAggwIAAJQDADAEGwAAggMAMP0BAACDAwAw_wEAAIUDACCDAgAAhgMAMAAAAAAAAAABgAJAAAAAAQAAAAUbAACwBAAgHAAAswQAIP0BAACxBAAg_gEAALIEACCDAgAAEQAgAxsAALAEACD9AQAAsQQAIIMCAAARACAAAAAAAAUbAACrBAAgHAAArgQAIP0BAACsBAAg_gEAAK0EACCDAgAAEQAgAxsAAKsEACD9AQAArAQAIIMCAAARACAAAAAFGwAApgQAIBwAAKkEACD9AQAApwQAIP4BAACoBAAggwIAABEAIAMbAACmBAAg_QEAAKcEACCDAgAAEQAgAAAAAAAFGwAAoQQAIBwAAKQEACD9AQAAogQAIP4BAACjBAAggwIAAAEAIAMbAAChBAAg_QEAAKIEACCDAgAAAQAgAAAACxsAAIAEADAcAACEBAAw_QEAAIEEADD-AQAAggQAMP8BAACDBAAggAIAAJQDADCBAgAAlAMAMIICAACUAwAwgwIAAJQDADCEAgAAhQQAMIUCAACXAwAwCwYAAPsDACAMAADKAwAgDQAAywMAIA4AAMwDACC6AQEAAAABvgFAAAAAAb8BQAAAAAHPAQEAAAAB7AEBAAAAAe4BAgAAAAHvARAAAAABAgAAABEAIBsAAIgEACADAAAAEQAgGwAAiAQAIBwAAIcEACABFAAAoAQAMAIAAAARACAUAACHBAAgAgAAAJgDACAUAACGBAAgB7oBAQDnAgAhvgFAAOgCACG_AUAA6AIAIc8BAQDnAgAh7AEBAOcCACHuAQIAmgMAIe8BEACAAwAhCwYAAPoDACAMAACdAwAgDQAAngMAIA4AAJ8DACC6AQEA5wIAIb4BQADoAgAhvwFAAOgCACHPAQEA5wIAIewBAQDnAgAh7gECAJoDACHvARAAgAMAIQsGAAD7AwAgDAAAygMAIA0AAMsDACAOAADMAwAgugEBAAAAAb4BQAAAAAG_AUAAAAABzwEBAAAAAewBAQAAAAHuAQIAAAAB7wEQAAAAAQQbAACABAAw_QEAAIEEADD_AQAAgwQAIIMCAACUAwAwAAAAAAAAAAcbAACbBAAgHAAAngQAIP0BAACcBAAg_gEAAJ0EACCBAgAAAwAgggIAAAMAIIMCAADdAQAgAxsAAJsEACD9AQAAnAQAIIMCAADdAQAgBQYAAJQEACAKAACVBAAgDAAAlgQAIA0AAJcEACAOAACYBAAgBQUAAJoEACAIAAD6AgAgCQAAigQAIPUBAADdAwAg-AEAAN0DACABCQAAigQAIAAAAAEDAAD6AgAgAQMAANwDACAFzgEBAAAAAc8BAQAAAAHQARAAAAAB0QGAAAAAAdIBQAAAAAECAAAA3QEAIBsAAJsEACADAAAAAwAgGwAAmwQAIBwAAJ8EACAHAAAAAwAgFAAAnwQAIM4BAQDnAgAhzwEBAOcCACHQARAAgAMAIdEBgAAAAAHSAUAA6AIAIQXOAQEA5wIAIc8BAQDnAgAh0AEQAIADACHRAYAAAAAB0gFAAOgCACEHugEBAAAAAb4BQAAAAAG_AUAAAAABzwEBAAAAAewBAQAAAAHuAQIAAAAB7wEQAAAAAQoFAACSBAAgCAAA2QMAILoBAQAAAAG-AUAAAAABvwFAAAAAAfQBAQAAAAH1AQEAAAAB9gEBAAAAAfcBAQAAAAH4AQEAAAABAgAAAAEAIBsAAKEEACADAAAABQAgGwAAoQQAIBwAAKUEACAMAAAABQAgBQAAkQQAIAgAAI4DACAUAAClBAAgugEBAOcCACG-AUAA6AIAIb8BQADoAgAh9AEBAOcCACH1AQEAjAMAIfYBAQDnAgAh9wEBAOcCACH4AQEAjAMAIQoFAACRBAAgCAAAjgMAILoBAQDnAgAhvgFAAOgCACG_AUAA6AIAIfQBAQDnAgAh9QEBAIwDACH2AQEA5wIAIfcBAQDnAgAh-AEBAIwDACEMBgAA-wMAIAoAAMkDACANAADLAwAgDgAAzAMAILoBAQAAAAG-AUAAAAABvwFAAAAAAc8BAQAAAAHsAQEAAAAB7QEBAAAAAe4BAgAAAAHvARAAAAABAgAAABEAIBsAAKYEACADAAAADwAgGwAApgQAIBwAAKoEACAOAAAADwAgBgAA-gMAIAoAAJwDACANAACeAwAgDgAAnwMAIBQAAKoEACC6AQEA5wIAIb4BQADoAgAhvwFAAOgCACHPAQEA5wIAIewBAQDnAgAh7QEBAOcCACHuAQIAmgMAIe8BEACAAwAhDAYAAPoDACAKAACcAwAgDQAAngMAIA4AAJ8DACC6AQEA5wIAIb4BQADoAgAhvwFAAOgCACHPAQEA5wIAIewBAQDnAgAh7QEBAOcCACHuAQIAmgMAIe8BEACAAwAhDAYAAPsDACAKAADJAwAgDAAAygMAIA4AAMwDACC6AQEAAAABvgFAAAAAAb8BQAAAAAHPAQEAAAAB7AEBAAAAAe0BAQAAAAHuAQIAAAAB7wEQAAAAAQIAAAARACAbAACrBAAgAwAAAA8AIBsAAKsEACAcAACvBAAgDgAAAA8AIAYAAPoDACAKAACcAwAgDAAAnQMAIA4AAJ8DACAUAACvBAAgugEBAOcCACG-AUAA6AIAIb8BQADoAgAhzwEBAOcCACHsAQEA5wIAIe0BAQDnAgAh7gECAJoDACHvARAAgAMAIQwGAAD6AwAgCgAAnAMAIAwAAJ0DACAOAACfAwAgugEBAOcCACG-AUAA6AIAIb8BQADoAgAhzwEBAOcCACHsAQEA5wIAIe0BAQDnAgAh7gECAJoDACHvARAAgAMAIQwGAAD7AwAgCgAAyQMAIAwAAMoDACANAADLAwAgugEBAAAAAb4BQAAAAAG_AUAAAAABzwEBAAAAAewBAQAAAAHtAQEAAAAB7gECAAAAAe8BEAAAAAECAAAAEQAgGwAAsAQAIAMAAAAPACAbAACwBAAgHAAAtAQAIA4AAAAPACAGAAD6AwAgCgAAnAMAIAwAAJ0DACANAACeAwAgFAAAtAQAILoBAQDnAgAhvgFAAOgCACG_AUAA6AIAIc8BAQDnAgAh7AEBAOcCACHtAQEA5wIAIe4BAgCaAwAh7wEQAIADACEMBgAA-gMAIAoAAJwDACAMAACdAwAgDQAAngMAILoBAQDnAgAhvgFAAOgCACG_AUAA6AIAIc8BAQDnAgAh7AEBAOcCACHtAQEA5wIAIe4BAgCaAwAh7wEQAIADACEGugEBAAAAAbsBAQAAAAG8AQEAAAABvQEBAAAAAb4BQAAAAAG_AUAAAAABAgAAAPUBACAbAAC1BAAgAwAAAPgBACAbAAC1BAAgHAAAuQQAIAgAAAD4AQAgFAAAuQQAILoBAQDnAgAhuwEBAOcCACG8AQEA5wIAIb0BAQDnAgAhvgFAAOgCACG_AUAA6AIAIQa6AQEA5wIAIbsBAQDnAgAhvAEBAOcCACG9AQEA5wIAIb4BQADoAgAhvwFAAOgCACEDvgFAAAAAAfEBAQAAAAHzAQAAAPMBAga6AQEAAAABvgFAAAAAAb8BQAAAAAHPAQEAAAAB6wEgAAAAAfABAQAAAAECAAAAUwAgGwAAuwQAIAW6AQEAAAABvgFAAAAAAeMBAQAAAAHkAQEAAAAB6gEAAADqAQIIugEBAAAAAb4BQAAAAAG_AUAAAAAB0AEQAAAAAeMBAQAAAAHkAQEAAAAB6gEAAADqAQPrASAAAAABCroBAQAAAAG-AUAAAAABvwFAAAAAAeABAQAAAAHiAUAAAAAB4wEBAAAAAeQBAQAAAAHlAQEAAAAB5gEBAAAAAegBAAAA6AECAwAAAFYAIBsAALsEACAcAADCBAAgCAAAAFYAIBQAAMIEACC6AQEA5wIAIb4BQADoAgAhvwFAAOgCACHPAQEA5wIAIesBIAC4AwAh8AEBAOcCACEGugEBAOcCACG-AUAA6AIAIb8BQADoAgAhzwEBAOcCACHrASAAuAMAIfABAQDnAgAhB7oBAQAAAAG-AUAAAAABvwFAAAAAAc8BAQAAAAHtAQEAAAAB7gECAAAAAe8BEAAAAAEHugEBAAAAAb4BQAAAAAG_AUAAAAAB9AEBAAAAAfUBAQAAAAH2AQEAAAAB9wEBAAAAAQoFAACSBAAgCQAA2gMAILoBAQAAAAG-AUAAAAABvwFAAAAAAfQBAQAAAAH1AQEAAAAB9gEBAAAAAfcBAQAAAAH4AQEAAAABAgAAAAEAIBsAAMUEACADAAAABQAgGwAAxQQAIBwAAMkEACAMAAAABQAgBQAAkQQAIAkAAI8DACAUAADJBAAgugEBAOcCACG-AUAA6AIAIb8BQADoAgAh9AEBAOcCACH1AQEAjAMAIfYBAQDnAgAh9wEBAOcCACH4AQEAjAMAIQoFAACRBAAgCQAAjwMAILoBAQDnAgAhvgFAAOgCACG_AUAA6AIAIfQBAQDnAgAh9QEBAIwDACH2AQEA5wIAIfcBAQDnAgAh-AEBAIwDACEDvgFAAAAAAewBAQAAAAHzAQAAAPMBAgQEAA4FBAIIDAQJEgcCAwcBBAADAQMIAAIGAAEHAAUCAw0EBAAGAQMOAAYEAA0GAAEKAAgMGAoNHAsOIAwCBAAJCRMHAQkUAAELAAcBCwAHAQsABwMMIQANIgAOIwACCCQACSUAAAEFLwIBBTUCAwQAEyEAFCIAFQAAAAMEABMhABQiABUCBgABBwAFAgYAAQcABQMEABohABsiABwAAAADBAAaIQAbIgAcAAADBAAhIQAiIgAjAAAAAwQAISEAIiIAIwIGAAEKAAgCBgABCgAIBQQAKCEAKyIALFMAKVQAKgAAAAAABQQAKCEAKyIALFMAKVQAKgELAAcBCwAHAwQAMSEAMiIAMwAAAAMEADEhADIiADMBCwAHAQsABwUEADghADsiADxTADlUADoAAAAAAAUEADghADsiADxTADlUADoBCwAHAQsABwMEAEEhAEIiAEMAAAADBABBIQBCIgBDAAAABQQASSEATCIATVMASlQASwAAAAAABQQASSEATCIATVMASlQASwAABQQAUiEAVSIAVlMAU1QAVAAAAAAABQQAUiEAVSIAVlMAU1QAVAAAAwQAWyEAXCIAXQAAAAMEAFshAFwiAF0PAgEQJgERJwESKAETKQEVKwEWLQ8XLhAYMQEZMw8aNBEdNgEeNwEfOA8jOxIkPBYlPQQmPgQnPwQoQAQpQQQqQwQrRQ8sRhctSAQuSg8vSxgwTAQxTQQyTg8zURk0Uh01VAg2VQg3WAg4WQg5Wgg6XAg7Xg88Xx49YQg-Yw8_ZB9AZQhBZghCZw9DaiBEayRFbAdGbQdHbgdIbwdJcAdKcgdLdA9MdSVNdwdOeQ9PeiZQewdRfAdSfQ9VgAEnVoEBLVeCAQpYgwEKWYQBClqFAQpbhgEKXIgBCl2KAQ9eiwEuX40BCmCPAQ9hkAEvYpEBCmOSAQpkkwEPZZYBMGaXATRnmAELaJkBC2maAQtqmwELa5wBC2yeAQttoAEPbqEBNW-jAQtwpQEPcaYBNnKnAQtzqAELdKkBD3WsATd2rQE9d64BDHivAQx5sAEMerEBDHuyAQx8tAEMfbYBD363AT5_uQEMgAG7AQ-BAbwBP4IBvQEMgwG-AQyEAb8BD4UBwgFAhgHDAUSHAcUBRYgBxgFFiQHJAUWKAcoBRYsBywFFjAHNAUWNAc8BD44B0AFGjwHSAUWQAdQBD5EB1QFHkgHWAUWTAdcBRZQB2AEPlQHbAUiWAdwBTpcB3gECmAHfAQKZAeEBApoB4gECmwHjAQKcAeUBAp0B5wEPngHoAU-fAeoBAqAB7AEPoQHtAVCiAe4BAqMB7wECpAHwAQ-lAfMBUaYB9AFXpwH2AQWoAfcBBakB-gEFqgH7AQWrAfwBBawB_gEFrQGAAg-uAYECWK8BgwIFsAGFAg-xAYYCWbIBhwIFswGIAgW0AYkCD7UBjAJatgGNAl4" +} + +async function decodeBase64AsWasm(wasmBase64: string): Promise { + const { Buffer } = await import('node:buffer') + const wasmArray = Buffer.from(wasmBase64, 'base64') + return new WebAssembly.Module(wasmArray) +} + +config.compilerWasm = { + getRuntime: async () => await import("@prisma/client/runtime/query_compiler_fast_bg.postgresql.mjs"), + + getQueryCompilerWasmModule: async () => { + const { wasm } = await import("@prisma/client/runtime/query_compiler_fast_bg.postgresql.wasm-base64.mjs") + return await decodeBase64AsWasm(wasm) + }, + + importName: "./query_compiler_fast_bg.js" +} + + + +export type LogOptions = + 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array ? Prisma.GetEvents : never : never + +export interface PrismaClientConstructor { + /** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient({ + * adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL }) + * }) + * // Fetch zero or more Complexes + * const complexes = await prisma.complex.findMany() + * ``` + * + * Read more in our [docs](https://pris.ly/d/client). + */ + + new < + Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, + LogOpts extends LogOptions = LogOptions, + OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'], + ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs + >(options: Prisma.Subset ): PrismaClient +} + +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient({ + * adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL }) + * }) + * // Fetch zero or more Complexes + * const complexes = await prisma.complex.findMany() + * ``` + * + * Read more in our [docs](https://pris.ly/d/client). + */ + +export interface PrismaClient< + in LogOpts extends Prisma.LogLevel = never, + in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = undefined, + in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs +> { + [K: symbol]: { types: Prisma.TypeMap['other'] } + + $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient; + + /** + * Connect with the database + */ + $connect(): runtime.Types.Utils.JsPromise; + + /** + * Disconnect from the database + */ + $disconnect(): runtime.Types.Utils.JsPromise; + +/** + * Executes a prepared raw query and returns the number of affected rows. + * @example + * ``` + * const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};` + * ``` + * + * Read more in our [docs](https://pris.ly/d/raw-queries). + */ + $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; + + /** + * Executes a raw query and returns the number of affected rows. + * Susceptible to SQL injections, see documentation. + * @example + * ``` + * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com') + * ``` + * + * Read more in our [docs](https://pris.ly/d/raw-queries). + */ + $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; + + /** + * Performs a prepared raw query and returns the `SELECT` data. + * @example + * ``` + * const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};` + * ``` + * + * Read more in our [docs](https://pris.ly/d/raw-queries). + */ + $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; + + /** + * Performs a raw query and returns the `SELECT` data. + * Susceptible to SQL injections, see documentation. + * @example + * ``` + * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com') + * ``` + * + * Read more in our [docs](https://pris.ly/d/raw-queries). + */ + $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; + + + /** + * Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole. + * @example + * ``` + * const [george, bob, alice] = await prisma.$transaction([ + * prisma.user.create({ data: { name: 'George' } }), + * prisma.user.create({ data: { name: 'Bob' } }), + * prisma.user.create({ data: { name: 'Alice' } }), + * ]) + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/orm/prisma-client/queries/transactions). + */ + $transaction

[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise> + + $transaction(fn: (prisma: Omit) => runtime.Types.Utils.JsPromise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise + + $extends: runtime.Types.Extensions.ExtendsHook<"extends", Prisma.TypeMapCb, ExtArgs, runtime.Types.Utils.Call, { + extArgs: ExtArgs + }>> + + /** + * `prisma.complex`: Exposes CRUD operations for the **Complex** model. + * Example usage: + * ```ts + * // Fetch zero or more Complexes + * const complexes = await prisma.complex.findMany() + * ``` + */ + get complex(): Prisma.ComplexDelegate; + + /** + * `prisma.complexUser`: Exposes CRUD operations for the **ComplexUser** model. + * Example usage: + * ```ts + * // Fetch zero or more ComplexUsers + * const complexUsers = await prisma.complexUser.findMany() + * ``` + */ + get complexUser(): Prisma.ComplexUserDelegate; + + /** + * `prisma.sport`: Exposes CRUD operations for the **Sport** model. + * Example usage: + * ```ts + * // Fetch zero or more Sports + * const sports = await prisma.sport.findMany() + * ``` + */ + get sport(): Prisma.SportDelegate; + + /** + * `prisma.court`: Exposes CRUD operations for the **Court** model. + * Example usage: + * ```ts + * // Fetch zero or more Courts + * const courts = await prisma.court.findMany() + * ``` + */ + get court(): Prisma.CourtDelegate; + + /** + * `prisma.courtAvailability`: Exposes CRUD operations for the **CourtAvailability** model. + * Example usage: + * ```ts + * // Fetch zero or more CourtAvailabilities + * const courtAvailabilities = await prisma.courtAvailability.findMany() + * ``` + */ + get courtAvailability(): Prisma.CourtAvailabilityDelegate; + + /** + * `prisma.courtPriceRule`: Exposes CRUD operations for the **CourtPriceRule** model. + * Example usage: + * ```ts + * // Fetch zero or more CourtPriceRules + * const courtPriceRules = await prisma.courtPriceRule.findMany() + * ``` + */ + get courtPriceRule(): Prisma.CourtPriceRuleDelegate; + + /** + * `prisma.courtBooking`: Exposes CRUD operations for the **CourtBooking** model. + * Example usage: + * ```ts + * // Fetch zero or more CourtBookings + * const courtBookings = await prisma.courtBooking.findMany() + * ``` + */ + get courtBooking(): Prisma.CourtBookingDelegate; + + /** + * `prisma.onboardingRequest`: Exposes CRUD operations for the **OnboardingRequest** model. + * Example usage: + * ```ts + * // Fetch zero or more OnboardingRequests + * const onboardingRequests = await prisma.onboardingRequest.findMany() + * ``` + */ + get onboardingRequest(): Prisma.OnboardingRequestDelegate; + + /** + * `prisma.plan`: Exposes CRUD operations for the **Plan** model. + * Example usage: + * ```ts + * // Fetch zero or more Plans + * const plans = await prisma.plan.findMany() + * ``` + */ + get plan(): Prisma.PlanDelegate; + + /** + * `prisma.user`: Exposes CRUD operations for the **User** model. + * Example usage: + * ```ts + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + */ + get user(): Prisma.UserDelegate; +} + +export function getPrismaClientClass(): PrismaClientConstructor { + return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor +} diff --git a/apps/backend/src/generated/prisma/internal/prismaNamespace.ts b/apps/backend/src/generated/prisma/internal/prismaNamespace.ts new file mode 100644 index 0000000..3a1d910 --- /dev/null +++ b/apps/backend/src/generated/prisma/internal/prismaNamespace.ts @@ -0,0 +1,1675 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * All exports from this file are wrapped under a `Prisma` namespace object in the client.ts file. + * While this enables partial backward compatibility, it is not part of the stable public API. + * + * If you are looking for your Models, Enums, and Input Types, please import them from the respective + * model files in the `model` directory! + */ + +import * as runtime from "@prisma/client/runtime/client" +import type * as Prisma from "../models" +import { type PrismaClient } from "./class" + +export type * from '../models' + +export type DMMF = typeof runtime.DMMF + +export type PrismaPromise = runtime.Types.Public.PrismaPromise + +/** + * Prisma Errors + */ + +export const PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError +export type PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError + +export const PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError +export type PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError + +export const PrismaClientRustPanicError = runtime.PrismaClientRustPanicError +export type PrismaClientRustPanicError = runtime.PrismaClientRustPanicError + +export const PrismaClientInitializationError = runtime.PrismaClientInitializationError +export type PrismaClientInitializationError = runtime.PrismaClientInitializationError + +export const PrismaClientValidationError = runtime.PrismaClientValidationError +export type PrismaClientValidationError = runtime.PrismaClientValidationError + +/** + * Re-export of sql-template-tag + */ +export const sql = runtime.sqltag +export const empty = runtime.empty +export const join = runtime.join +export const raw = runtime.raw +export const Sql = runtime.Sql +export type Sql = runtime.Sql + + + +/** + * Decimal.js + */ +export const Decimal = runtime.Decimal +export type Decimal = runtime.Decimal + +export type DecimalJsLike = runtime.DecimalJsLike + +/** +* Extensions +*/ +export type Extension = runtime.Types.Extensions.UserArgs +export const getExtensionContext = runtime.Extensions.getExtensionContext +export type Args = runtime.Types.Public.Args +export type Payload = runtime.Types.Public.Payload +export type Result = runtime.Types.Public.Result +export type Exact = runtime.Types.Public.Exact + +export type PrismaVersion = { + client: string + engine: string +} + +/** + * Prisma Client JS version: 7.6.0 + * Query Engine version: 75cbdc1eb7150937890ad5465d861175c6624711 + */ +export const prismaVersion: PrismaVersion = { + client: "7.6.0", + engine: "75cbdc1eb7150937890ad5465d861175c6624711" +} + +/** + * Utility Types + */ + +export type Bytes = runtime.Bytes +export type JsonObject = runtime.JsonObject +export type JsonArray = runtime.JsonArray +export type JsonValue = runtime.JsonValue +export type InputJsonObject = runtime.InputJsonObject +export type InputJsonArray = runtime.InputJsonArray +export type InputJsonValue = runtime.InputJsonValue + + +export const NullTypes = { + DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull), + JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull), + AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull), +} +/** + * Helper for filtering JSON entries that have `null` on the database (empty on the db) + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ +export const DbNull = runtime.DbNull + +/** + * Helper for filtering JSON entries that have JSON `null` values (not empty on the db) + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ +export const JsonNull = runtime.JsonNull + +/** + * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull` + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ +export const AnyNull = runtime.AnyNull + + +type SelectAndInclude = { + select: any + include: any +} + +type SelectAndOmit = { + select: any + omit: any +} + +/** + * From T, pick a set of properties whose keys are in the union K + */ +type Prisma__Pick = { + [P in K]: T[P]; +}; + +export type Enumerable = T | Array; + +/** + * Subset + * @desc From `T` pick properties that exist in `U`. Simple version of Intersection + */ +export type Subset = { + [key in keyof T]: key extends keyof U ? T[key] : never; +}; + +/** + * SelectSubset + * @desc From `T` pick properties that exist in `U`. Simple version of Intersection. + * Additionally, it validates, if both select and include are present. If the case, it errors. + */ +export type SelectSubset = { + [key in keyof T]: key extends keyof U ? T[key] : never +} & + (T extends SelectAndInclude + ? 'Please either choose `select` or `include`.' + : T extends SelectAndOmit + ? 'Please either choose `select` or `omit`.' + : {}) + +/** + * Subset + Intersection + * @desc From `T` pick properties that exist in `U` and intersect `K` + */ +export type SubsetIntersection = { + [key in keyof T]: key extends keyof U ? T[key] : never +} & + K + +type Without = { [P in Exclude]?: never }; + +/** + * XOR is needed to have a real mutually exclusive union type + * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types + */ +export type XOR = + T extends object ? + U extends object ? + (Without & U) | (Without & T) + : U : T + + +/** + * Is T a Record? + */ +type IsObject = T extends Array +? False +: T extends Date +? False +: T extends Uint8Array +? False +: T extends BigInt +? False +: T extends object +? True +: False + + +/** + * If it's T[], return T + */ +export type UnEnumerate = T extends Array ? U : T + +/** + * From ts-toolbelt + */ + +type __Either = Omit & + { + // Merge all but K + [P in K]: Prisma__Pick // With K possibilities + }[K] + +type EitherStrict = Strict<__Either> + +type EitherLoose = ComputeRaw<__Either> + +type _Either< + O extends object, + K extends Key, + strict extends Boolean +> = { + 1: EitherStrict + 0: EitherLoose +}[strict] + +export type Either< + O extends object, + K extends Key, + strict extends Boolean = 1 +> = O extends unknown ? _Either : never + +export type Union = any + +export type PatchUndefined = { + [K in keyof O]: O[K] extends undefined ? At : O[K] +} & {} + +/** Helper Types for "Merge" **/ +export type IntersectOf = ( + U extends unknown ? (k: U) => void : never +) extends (k: infer I) => void + ? I + : never + +export type Overwrite = { + [K in keyof O]: K extends keyof O1 ? O1[K] : O[K]; +} & {}; + +type _Merge = IntersectOf; +}>>; + +type Key = string | number | symbol; +type AtStrict = O[K & keyof O]; +type AtLoose = O extends unknown ? AtStrict : never; +export type At = { + 1: AtStrict; + 0: AtLoose; +}[strict]; + +export type ComputeRaw = A extends Function ? A : { + [K in keyof A]: A[K]; +} & {}; + +export type OptionalFlat = { + [K in keyof O]?: O[K]; +} & {}; + +type _Record = { + [P in K]: T; +}; + +// cause typescript not to expand types and preserve names +type NoExpand = T extends unknown ? T : never; + +// this type assumes the passed object is entirely optional +export type AtLeast = NoExpand< + O extends unknown + ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) + | {[P in keyof O as P extends K ? P : never]-?: O[P]} & O + : never>; + +type _Strict = U extends unknown ? U & OptionalFlat<_Record, keyof U>, never>> : never; + +export type Strict = ComputeRaw<_Strict>; +/** End Helper Types for "Merge" **/ + +export type Merge = ComputeRaw<_Merge>>; + +export type Boolean = True | False + +export type True = 1 + +export type False = 0 + +export type Not = { + 0: 1 + 1: 0 +}[B] + +export type Extends = [A1] extends [never] + ? 0 // anything `never` is false + : A1 extends A2 + ? 1 + : 0 + +export type Has = Not< + Extends, U1> +> + +export type Or = { + 0: { + 0: 0 + 1: 1 + } + 1: { + 0: 1 + 1: 1 + } +}[B1][B2] + +export type Keys = U extends unknown ? keyof U : never + +export type GetScalarType = O extends object ? { + [P in keyof T]: P extends keyof O + ? O[P] + : never +} : never + +type FieldPaths< + T, + U = Omit +> = IsObject extends True ? U : T + +export type GetHavingFields = { + [K in keyof T]: Or< + Or, Extends<'AND', K>>, + Extends<'NOT', K> + > extends True + ? // infer is only needed to not hit TS limit + // based on the brilliant idea of Pierre-Antoine Mills + // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437 + T[K] extends infer TK + ? GetHavingFields extends object ? Merge> : never> + : never + : {} extends FieldPaths + ? never + : K +}[keyof T] + +/** + * Convert tuple to union + */ +type _TupleToUnion = T extends (infer E)[] ? E : never +type TupleToUnion = _TupleToUnion +export type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T + +/** + * Like `Pick`, but additionally can also accept an array of keys + */ +export type PickEnumerable | keyof T> = Prisma__Pick> + +/** + * Exclude all keys with underscores + */ +export type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T + + +export type FieldRef = runtime.FieldRef + +type FieldRefInputType = Model extends never ? never : FieldRef + + +export const ModelName = { + Complex: 'Complex', + ComplexUser: 'ComplexUser', + Sport: 'Sport', + Court: 'Court', + CourtAvailability: 'CourtAvailability', + CourtPriceRule: 'CourtPriceRule', + CourtBooking: 'CourtBooking', + OnboardingRequest: 'OnboardingRequest', + Plan: 'Plan', + User: 'User' +} as const + +export type ModelName = (typeof ModelName)[keyof typeof ModelName] + + + +export interface TypeMapCb extends runtime.Types.Utils.Fn<{extArgs: runtime.Types.Extensions.InternalArgs }, runtime.Types.Utils.Record> { + returns: TypeMap +} + +export type TypeMap = { + globalOmitOptions: { + omit: GlobalOmitOptions + } + meta: { + modelProps: "complex" | "complexUser" | "sport" | "court" | "courtAvailability" | "courtPriceRule" | "courtBooking" | "onboardingRequest" | "plan" | "user" + txIsolationLevel: TransactionIsolationLevel + } + model: { + Complex: { + payload: Prisma.$ComplexPayload + fields: Prisma.ComplexFieldRefs + operations: { + findUnique: { + args: Prisma.ComplexFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.ComplexFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.ComplexFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.ComplexFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.ComplexFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.ComplexCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.ComplexCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.ComplexCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.ComplexDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.ComplexUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.ComplexDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.ComplexUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.ComplexUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.ComplexUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.ComplexAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.ComplexGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.ComplexCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + ComplexUser: { + payload: Prisma.$ComplexUserPayload + fields: Prisma.ComplexUserFieldRefs + operations: { + findUnique: { + args: Prisma.ComplexUserFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.ComplexUserFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.ComplexUserFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.ComplexUserFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.ComplexUserFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.ComplexUserCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.ComplexUserCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.ComplexUserCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.ComplexUserDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.ComplexUserUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.ComplexUserDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.ComplexUserUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.ComplexUserUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.ComplexUserUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.ComplexUserAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.ComplexUserGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.ComplexUserCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Sport: { + payload: Prisma.$SportPayload + fields: Prisma.SportFieldRefs + operations: { + findUnique: { + args: Prisma.SportFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.SportFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.SportFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.SportFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.SportFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.SportCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.SportCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.SportCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.SportDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.SportUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.SportDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.SportUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.SportUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.SportUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.SportAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.SportGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.SportCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Court: { + payload: Prisma.$CourtPayload + fields: Prisma.CourtFieldRefs + operations: { + findUnique: { + args: Prisma.CourtFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.CourtFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.CourtFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.CourtFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.CourtFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.CourtCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.CourtCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.CourtCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.CourtDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.CourtUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.CourtDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.CourtUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.CourtUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.CourtUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.CourtAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.CourtGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.CourtCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + CourtAvailability: { + payload: Prisma.$CourtAvailabilityPayload + fields: Prisma.CourtAvailabilityFieldRefs + operations: { + findUnique: { + args: Prisma.CourtAvailabilityFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.CourtAvailabilityFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.CourtAvailabilityFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.CourtAvailabilityFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.CourtAvailabilityFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.CourtAvailabilityCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.CourtAvailabilityCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.CourtAvailabilityCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.CourtAvailabilityDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.CourtAvailabilityUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.CourtAvailabilityDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.CourtAvailabilityUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.CourtAvailabilityUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.CourtAvailabilityUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.CourtAvailabilityAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.CourtAvailabilityGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.CourtAvailabilityCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + CourtPriceRule: { + payload: Prisma.$CourtPriceRulePayload + fields: Prisma.CourtPriceRuleFieldRefs + operations: { + findUnique: { + args: Prisma.CourtPriceRuleFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.CourtPriceRuleFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.CourtPriceRuleFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.CourtPriceRuleFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.CourtPriceRuleFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.CourtPriceRuleCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.CourtPriceRuleCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.CourtPriceRuleCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.CourtPriceRuleDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.CourtPriceRuleUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.CourtPriceRuleDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.CourtPriceRuleUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.CourtPriceRuleUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.CourtPriceRuleUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.CourtPriceRuleAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.CourtPriceRuleGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.CourtPriceRuleCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + CourtBooking: { + payload: Prisma.$CourtBookingPayload + fields: Prisma.CourtBookingFieldRefs + operations: { + findUnique: { + args: Prisma.CourtBookingFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.CourtBookingFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.CourtBookingFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.CourtBookingFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.CourtBookingFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.CourtBookingCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.CourtBookingCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.CourtBookingCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.CourtBookingDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.CourtBookingUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.CourtBookingDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.CourtBookingUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.CourtBookingUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.CourtBookingUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.CourtBookingAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.CourtBookingGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.CourtBookingCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + OnboardingRequest: { + payload: Prisma.$OnboardingRequestPayload + fields: Prisma.OnboardingRequestFieldRefs + operations: { + findUnique: { + args: Prisma.OnboardingRequestFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.OnboardingRequestFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.OnboardingRequestFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.OnboardingRequestFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.OnboardingRequestFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.OnboardingRequestCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.OnboardingRequestCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.OnboardingRequestCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.OnboardingRequestDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.OnboardingRequestUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.OnboardingRequestDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.OnboardingRequestUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.OnboardingRequestUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.OnboardingRequestUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.OnboardingRequestAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.OnboardingRequestGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.OnboardingRequestCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Plan: { + payload: Prisma.$PlanPayload + fields: Prisma.PlanFieldRefs + operations: { + findUnique: { + args: Prisma.PlanFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.PlanFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.PlanFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.PlanFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.PlanFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.PlanCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.PlanCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.PlanCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.PlanDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.PlanUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.PlanDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.PlanUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.PlanUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.PlanUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.PlanAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.PlanGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.PlanCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + User: { + payload: Prisma.$UserPayload + fields: Prisma.UserFieldRefs + operations: { + findUnique: { + args: Prisma.UserFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.UserFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.UserFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.UserFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.UserFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.UserCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.UserCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.UserCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.UserDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.UserUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.UserDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.UserUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.UserUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.UserUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.UserAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.UserGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.UserCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + } +} & { + other: { + payload: any + operations: { + $executeRaw: { + args: [query: TemplateStringsArray | Sql, ...values: any[]], + result: any + } + $executeRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + $queryRaw: { + args: [query: TemplateStringsArray | Sql, ...values: any[]], + result: any + } + $queryRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + } + } +} + +/** + * Enums + */ + +export const TransactionIsolationLevel = runtime.makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const ComplexScalarFieldEnum = { + id: 'id', + complexName: 'complexName', + physicalAddress: 'physicalAddress', + complexSlug: 'complexSlug', + adminEmail: 'adminEmail', + planCode: 'planCode', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type ComplexScalarFieldEnum = (typeof ComplexScalarFieldEnum)[keyof typeof ComplexScalarFieldEnum] + + +export const ComplexUserScalarFieldEnum = { + complexId: 'complexId', + userId: 'userId', + role: 'role', + createdAt: 'createdAt' +} as const + +export type ComplexUserScalarFieldEnum = (typeof ComplexUserScalarFieldEnum)[keyof typeof ComplexUserScalarFieldEnum] + + +export const SportScalarFieldEnum = { + id: 'id', + name: 'name', + slug: 'slug', + isActive: 'isActive', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type SportScalarFieldEnum = (typeof SportScalarFieldEnum)[keyof typeof SportScalarFieldEnum] + + +export const CourtScalarFieldEnum = { + id: 'id', + complexId: 'complexId', + sportId: 'sportId', + name: 'name', + slotDurationMinutes: 'slotDurationMinutes', + basePrice: 'basePrice', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type CourtScalarFieldEnum = (typeof CourtScalarFieldEnum)[keyof typeof CourtScalarFieldEnum] + + +export const CourtAvailabilityScalarFieldEnum = { + id: 'id', + courtId: 'courtId', + dayOfWeek: 'dayOfWeek', + startTime: 'startTime', + endTime: 'endTime', + createdAt: 'createdAt' +} as const + +export type CourtAvailabilityScalarFieldEnum = (typeof CourtAvailabilityScalarFieldEnum)[keyof typeof CourtAvailabilityScalarFieldEnum] + + +export const CourtPriceRuleScalarFieldEnum = { + id: 'id', + courtId: 'courtId', + dayOfWeek: 'dayOfWeek', + startTime: 'startTime', + endTime: 'endTime', + price: 'price', + isActive: 'isActive', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type CourtPriceRuleScalarFieldEnum = (typeof CourtPriceRuleScalarFieldEnum)[keyof typeof CourtPriceRuleScalarFieldEnum] + + +export const CourtBookingScalarFieldEnum = { + id: 'id', + bookingCode: 'bookingCode', + courtId: 'courtId', + bookingDate: 'bookingDate', + startTime: 'startTime', + endTime: 'endTime', + customerName: 'customerName', + customerPhone: 'customerPhone', + status: 'status', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type CourtBookingScalarFieldEnum = (typeof CourtBookingScalarFieldEnum)[keyof typeof CourtBookingScalarFieldEnum] + + +export const OnboardingRequestScalarFieldEnum = { + id: 'id', + fullName: 'fullName', + email: 'email', + otpHash: 'otpHash', + otpExpiresAt: 'otpExpiresAt', + otpAttempts: 'otpAttempts', + otpLastSentAt: 'otpLastSentAt', + otpResendCount: 'otpResendCount', + emailVerifiedAt: 'emailVerifiedAt', + completedAt: 'completedAt', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type OnboardingRequestScalarFieldEnum = (typeof OnboardingRequestScalarFieldEnum)[keyof typeof OnboardingRequestScalarFieldEnum] + + +export const PlanScalarFieldEnum = { + code: 'code', + name: 'name', + price: 'price', + rules: 'rules', + lastUpdatedAt: 'lastUpdatedAt' +} as const + +export type PlanScalarFieldEnum = (typeof PlanScalarFieldEnum)[keyof typeof PlanScalarFieldEnum] + + +export const UserScalarFieldEnum = { + id: 'id', + supabaseUserId: 'supabaseUserId', + email: 'email', + fullName: 'fullName', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const JsonNullValueInput = { + JsonNull: JsonNull +} as const + +export type JsonNullValueInput = (typeof JsonNullValueInput)[keyof typeof JsonNullValueInput] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + + +export const JsonNullValueFilter = { + DbNull: DbNull, + JsonNull: JsonNull, + AnyNull: AnyNull +} as const + +export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter] + + + +/** + * Field references + */ + + +/** + * Reference to a field of type 'String' + */ +export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> + + + +/** + * Reference to a field of type 'String[]' + */ +export type ListStringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String[]'> + + + +/** + * Reference to a field of type 'DateTime' + */ +export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime'> + + + +/** + * Reference to a field of type 'DateTime[]' + */ +export type ListDateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime[]'> + + + +/** + * Reference to a field of type 'ComplexUserRole' + */ +export type EnumComplexUserRoleFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'ComplexUserRole'> + + + +/** + * Reference to a field of type 'ComplexUserRole[]' + */ +export type ListEnumComplexUserRoleFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'ComplexUserRole[]'> + + + +/** + * Reference to a field of type 'Boolean' + */ +export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> + + + +/** + * Reference to a field of type 'Int' + */ +export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> + + + +/** + * Reference to a field of type 'Int[]' + */ +export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'> + + + +/** + * Reference to a field of type 'Decimal' + */ +export type DecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Decimal'> + + + +/** + * Reference to a field of type 'Decimal[]' + */ +export type ListDecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Decimal[]'> + + + +/** + * Reference to a field of type 'DayOfWeek' + */ +export type EnumDayOfWeekFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DayOfWeek'> + + + +/** + * Reference to a field of type 'DayOfWeek[]' + */ +export type ListEnumDayOfWeekFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DayOfWeek[]'> + + + +/** + * Reference to a field of type 'CourtBookingStatus' + */ +export type EnumCourtBookingStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'CourtBookingStatus'> + + + +/** + * Reference to a field of type 'CourtBookingStatus[]' + */ +export type ListEnumCourtBookingStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'CourtBookingStatus[]'> + + + +/** + * Reference to a field of type 'Json' + */ +export type JsonFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Json'> + + + +/** + * Reference to a field of type 'QueryMode' + */ +export type EnumQueryModeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'QueryMode'> + + + +/** + * Reference to a field of type 'Float' + */ +export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'> + + + +/** + * Reference to a field of type 'Float[]' + */ +export type ListFloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float[]'> + + +/** + * Batch Payload for updateMany & deleteMany & createMany + */ +export type BatchPayload = { + count: number +} + +export const defineExtension = runtime.Extensions.defineExtension as unknown as runtime.Types.Extensions.ExtendsHook<"define", TypeMapCb, runtime.Types.Extensions.DefaultArgs> +export type DefaultPrismaClient = PrismaClient +export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' +export type PrismaClientOptions = ({ + /** + * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-pg`. + */ + adapter: runtime.SqlDriverAdapterFactory + accelerateUrl?: never +} | { + /** + * Prisma Accelerate URL allowing the client to connect through Accelerate instead of a direct database. + */ + accelerateUrl: string + adapter?: never +}) & { + /** + * @default "colorless" + */ + errorFormat?: ErrorFormat + /** + * @example + * ``` + * // Shorthand for `emit: 'stdout'` + * log: ['query', 'info', 'warn', 'error'] + * + * // Emit as events only + * log: [ + * { emit: 'event', level: 'query' }, + * { emit: 'event', level: 'info' }, + * { emit: 'event', level: 'warn' } + * { emit: 'event', level: 'error' } + * ] + * + * / Emit as events and log to stdout + * og: [ + * { emit: 'stdout', level: 'query' }, + * { emit: 'stdout', level: 'info' }, + * { emit: 'stdout', level: 'warn' } + * { emit: 'stdout', level: 'error' } + * + * ``` + * Read more in our [docs](https://pris.ly/d/logging). + */ + log?: (LogLevel | LogDefinition)[] + /** + * The default values for transactionOptions + * maxWait ?= 2000 + * timeout ?= 5000 + */ + transactionOptions?: { + maxWait?: number + timeout?: number + isolationLevel?: TransactionIsolationLevel + } + /** + * Global configuration for omitting model fields by default. + * + * @example + * ``` + * const prisma = new PrismaClient({ + * omit: { + * user: { + * password: true + * } + * } + * }) + * ``` + */ + omit?: GlobalOmitConfig + /** + * SQL commenter plugins that add metadata to SQL queries as comments. + * Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/ + * + * @example + * ``` + * const prisma = new PrismaClient({ + * adapter, + * comments: [ + * traceContext(), + * queryInsights(), + * ], + * }) + * ``` + */ + comments?: runtime.SqlCommenterPlugin[] +} +export type GlobalOmitConfig = { + complex?: Prisma.ComplexOmit + complexUser?: Prisma.ComplexUserOmit + sport?: Prisma.SportOmit + court?: Prisma.CourtOmit + courtAvailability?: Prisma.CourtAvailabilityOmit + courtPriceRule?: Prisma.CourtPriceRuleOmit + courtBooking?: Prisma.CourtBookingOmit + onboardingRequest?: Prisma.OnboardingRequestOmit + plan?: Prisma.PlanOmit + user?: Prisma.UserOmit +} + +/* Types for Logging */ +export type LogLevel = 'info' | 'query' | 'warn' | 'error' +export type LogDefinition = { + level: LogLevel + emit: 'stdout' | 'event' +} + +export type CheckIsLogLevel = T extends LogLevel ? T : never; + +export type GetLogType = CheckIsLogLevel< + T extends LogDefinition ? T['level'] : T +>; + +export type GetEvents = T extends Array + ? GetLogType + : never; + +export type QueryEvent = { + timestamp: Date + query: string + params: string + duration: number + target: string +} + +export type LogEvent = { + timestamp: Date + message: string + target: string +} +/* End Types for Logging */ + + +export type PrismaAction = + | 'findUnique' + | 'findUniqueOrThrow' + | 'findMany' + | 'findFirst' + | 'findFirstOrThrow' + | 'create' + | 'createMany' + | 'createManyAndReturn' + | 'update' + | 'updateMany' + | 'updateManyAndReturn' + | 'upsert' + | 'delete' + | 'deleteMany' + | 'executeRaw' + | 'queryRaw' + | 'aggregate' + | 'count' + | 'runCommandRaw' + | 'findRaw' + | 'groupBy' + +/** + * `PrismaClient` proxy available in interactive transactions. + */ +export type TransactionClient = Omit + diff --git a/apps/backend/src/generated/prisma/internal/prismaNamespaceBrowser.ts b/apps/backend/src/generated/prisma/internal/prismaNamespaceBrowser.ts new file mode 100644 index 0000000..cf734c5 --- /dev/null +++ b/apps/backend/src/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -0,0 +1,255 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * All exports from this file are wrapped under a `Prisma` namespace object in the browser.ts file. + * While this enables partial backward compatibility, it is not part of the stable public API. + * + * If you are looking for your Models, Enums, and Input Types, please import them from the respective + * model files in the `model` directory! + */ + +import * as runtime from "@prisma/client/runtime/index-browser" + +export type * from '../models' +export type * from './prismaNamespace' + +export const Decimal = runtime.Decimal + + +export const NullTypes = { + DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull), + JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull), + AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull), +} +/** + * Helper for filtering JSON entries that have `null` on the database (empty on the db) + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ +export const DbNull = runtime.DbNull + +/** + * Helper for filtering JSON entries that have JSON `null` values (not empty on the db) + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ +export const JsonNull = runtime.JsonNull + +/** + * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull` + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ +export const AnyNull = runtime.AnyNull + + +export const ModelName = { + Complex: 'Complex', + ComplexUser: 'ComplexUser', + Sport: 'Sport', + Court: 'Court', + CourtAvailability: 'CourtAvailability', + CourtPriceRule: 'CourtPriceRule', + CourtBooking: 'CourtBooking', + OnboardingRequest: 'OnboardingRequest', + Plan: 'Plan', + User: 'User' +} as const + +export type ModelName = (typeof ModelName)[keyof typeof ModelName] + +/* + * Enums + */ + +export const TransactionIsolationLevel = runtime.makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const ComplexScalarFieldEnum = { + id: 'id', + complexName: 'complexName', + physicalAddress: 'physicalAddress', + complexSlug: 'complexSlug', + adminEmail: 'adminEmail', + planCode: 'planCode', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type ComplexScalarFieldEnum = (typeof ComplexScalarFieldEnum)[keyof typeof ComplexScalarFieldEnum] + + +export const ComplexUserScalarFieldEnum = { + complexId: 'complexId', + userId: 'userId', + role: 'role', + createdAt: 'createdAt' +} as const + +export type ComplexUserScalarFieldEnum = (typeof ComplexUserScalarFieldEnum)[keyof typeof ComplexUserScalarFieldEnum] + + +export const SportScalarFieldEnum = { + id: 'id', + name: 'name', + slug: 'slug', + isActive: 'isActive', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type SportScalarFieldEnum = (typeof SportScalarFieldEnum)[keyof typeof SportScalarFieldEnum] + + +export const CourtScalarFieldEnum = { + id: 'id', + complexId: 'complexId', + sportId: 'sportId', + name: 'name', + slotDurationMinutes: 'slotDurationMinutes', + basePrice: 'basePrice', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type CourtScalarFieldEnum = (typeof CourtScalarFieldEnum)[keyof typeof CourtScalarFieldEnum] + + +export const CourtAvailabilityScalarFieldEnum = { + id: 'id', + courtId: 'courtId', + dayOfWeek: 'dayOfWeek', + startTime: 'startTime', + endTime: 'endTime', + createdAt: 'createdAt' +} as const + +export type CourtAvailabilityScalarFieldEnum = (typeof CourtAvailabilityScalarFieldEnum)[keyof typeof CourtAvailabilityScalarFieldEnum] + + +export const CourtPriceRuleScalarFieldEnum = { + id: 'id', + courtId: 'courtId', + dayOfWeek: 'dayOfWeek', + startTime: 'startTime', + endTime: 'endTime', + price: 'price', + isActive: 'isActive', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type CourtPriceRuleScalarFieldEnum = (typeof CourtPriceRuleScalarFieldEnum)[keyof typeof CourtPriceRuleScalarFieldEnum] + + +export const CourtBookingScalarFieldEnum = { + id: 'id', + bookingCode: 'bookingCode', + courtId: 'courtId', + bookingDate: 'bookingDate', + startTime: 'startTime', + endTime: 'endTime', + customerName: 'customerName', + customerPhone: 'customerPhone', + status: 'status', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type CourtBookingScalarFieldEnum = (typeof CourtBookingScalarFieldEnum)[keyof typeof CourtBookingScalarFieldEnum] + + +export const OnboardingRequestScalarFieldEnum = { + id: 'id', + fullName: 'fullName', + email: 'email', + otpHash: 'otpHash', + otpExpiresAt: 'otpExpiresAt', + otpAttempts: 'otpAttempts', + otpLastSentAt: 'otpLastSentAt', + otpResendCount: 'otpResendCount', + emailVerifiedAt: 'emailVerifiedAt', + completedAt: 'completedAt', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type OnboardingRequestScalarFieldEnum = (typeof OnboardingRequestScalarFieldEnum)[keyof typeof OnboardingRequestScalarFieldEnum] + + +export const PlanScalarFieldEnum = { + code: 'code', + name: 'name', + price: 'price', + rules: 'rules', + lastUpdatedAt: 'lastUpdatedAt' +} as const + +export type PlanScalarFieldEnum = (typeof PlanScalarFieldEnum)[keyof typeof PlanScalarFieldEnum] + + +export const UserScalarFieldEnum = { + id: 'id', + supabaseUserId: 'supabaseUserId', + email: 'email', + fullName: 'fullName', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const JsonNullValueInput = { + JsonNull: JsonNull +} as const + +export type JsonNullValueInput = (typeof JsonNullValueInput)[keyof typeof JsonNullValueInput] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + + +export const JsonNullValueFilter = { + DbNull: DbNull, + JsonNull: JsonNull, + AnyNull: AnyNull +} as const + +export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter] + diff --git a/apps/backend/src/generated/prisma/models.ts b/apps/backend/src/generated/prisma/models.ts new file mode 100644 index 0000000..2dbe217 --- /dev/null +++ b/apps/backend/src/generated/prisma/models.ts @@ -0,0 +1,21 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This is a barrel export file for all models and their related types. + * + * 🟢 You can import this file directly. + */ +export type * from './models/Complex' +export type * from './models/ComplexUser' +export type * from './models/Sport' +export type * from './models/Court' +export type * from './models/CourtAvailability' +export type * from './models/CourtPriceRule' +export type * from './models/CourtBooking' +export type * from './models/OnboardingRequest' +export type * from './models/Plan' +export type * from './models/User' +export type * from './commonInputTypes' \ No newline at end of file diff --git a/apps/backend/src/generated/prisma/models/Complex.ts b/apps/backend/src/generated/prisma/models/Complex.ts new file mode 100644 index 0000000..f7aa14a --- /dev/null +++ b/apps/backend/src/generated/prisma/models/Complex.ts @@ -0,0 +1,1760 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Complex` 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" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model Complex + * + */ +export type ComplexModel = runtime.Types.Result.DefaultSelection + +export type AggregateComplex = { + _count: ComplexCountAggregateOutputType | null + _min: ComplexMinAggregateOutputType | null + _max: ComplexMaxAggregateOutputType | null +} + +export type ComplexMinAggregateOutputType = { + id: string | null + complexName: string | null + physicalAddress: string | null + complexSlug: string | null + adminEmail: string | null + planCode: string | null + createdAt: Date | null + updatedAt: Date | null +} + +export type ComplexMaxAggregateOutputType = { + id: string | null + complexName: string | null + physicalAddress: string | null + complexSlug: string | null + adminEmail: string | null + planCode: string | null + createdAt: Date | null + updatedAt: Date | null +} + +export type ComplexCountAggregateOutputType = { + id: number + complexName: number + physicalAddress: number + complexSlug: number + adminEmail: number + planCode: number + createdAt: number + updatedAt: number + _all: number +} + + +export type ComplexMinAggregateInputType = { + id?: true + complexName?: true + physicalAddress?: true + complexSlug?: true + adminEmail?: true + planCode?: true + createdAt?: true + updatedAt?: true +} + +export type ComplexMaxAggregateInputType = { + id?: true + complexName?: true + physicalAddress?: true + complexSlug?: true + adminEmail?: true + planCode?: true + createdAt?: true + updatedAt?: true +} + +export type ComplexCountAggregateInputType = { + id?: true + complexName?: true + physicalAddress?: true + complexSlug?: true + adminEmail?: true + planCode?: true + createdAt?: true + updatedAt?: true + _all?: true +} + +export type ComplexAggregateArgs = { + /** + * Filter which Complex to aggregate. + */ + where?: Prisma.ComplexWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Complexes to fetch. + */ + orderBy?: Prisma.ComplexOrderByWithRelationInput | Prisma.ComplexOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.ComplexWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Complexes 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` Complexes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Complexes + **/ + _count?: true | ComplexCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: ComplexMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: ComplexMaxAggregateInputType +} + +export type GetComplexAggregateType = { + [P in keyof T & keyof AggregateComplex]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type ComplexGroupByArgs = { + where?: Prisma.ComplexWhereInput + orderBy?: Prisma.ComplexOrderByWithAggregationInput | Prisma.ComplexOrderByWithAggregationInput[] + by: Prisma.ComplexScalarFieldEnum[] | Prisma.ComplexScalarFieldEnum + having?: Prisma.ComplexScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: ComplexCountAggregateInputType | true + _min?: ComplexMinAggregateInputType + _max?: ComplexMaxAggregateInputType +} + +export type ComplexGroupByOutputType = { + id: string + complexName: string + physicalAddress: string | null + complexSlug: string + adminEmail: string + planCode: string | null + createdAt: Date + updatedAt: Date + _count: ComplexCountAggregateOutputType | null + _min: ComplexMinAggregateOutputType | null + _max: ComplexMaxAggregateOutputType | null +} + +export type GetComplexGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof ComplexGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type ComplexWhereInput = { + AND?: Prisma.ComplexWhereInput | Prisma.ComplexWhereInput[] + OR?: Prisma.ComplexWhereInput[] + NOT?: Prisma.ComplexWhereInput | Prisma.ComplexWhereInput[] + id?: Prisma.UuidFilter<"Complex"> | string + complexName?: Prisma.StringFilter<"Complex"> | string + physicalAddress?: Prisma.StringNullableFilter<"Complex"> | string | null + complexSlug?: Prisma.StringFilter<"Complex"> | string + adminEmail?: Prisma.StringFilter<"Complex"> | string + planCode?: Prisma.StringNullableFilter<"Complex"> | string | null + createdAt?: Prisma.DateTimeFilter<"Complex"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Complex"> | Date | string + plan?: Prisma.XOR | null + users?: Prisma.ComplexUserListRelationFilter + courts?: Prisma.CourtListRelationFilter +} + +export type ComplexOrderByWithRelationInput = { + id?: Prisma.SortOrder + complexName?: Prisma.SortOrder + physicalAddress?: Prisma.SortOrderInput | Prisma.SortOrder + complexSlug?: Prisma.SortOrder + adminEmail?: Prisma.SortOrder + planCode?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + plan?: Prisma.PlanOrderByWithRelationInput + users?: Prisma.ComplexUserOrderByRelationAggregateInput + courts?: Prisma.CourtOrderByRelationAggregateInput +} + +export type ComplexWhereUniqueInput = Prisma.AtLeast<{ + id?: string + complexSlug?: string + AND?: Prisma.ComplexWhereInput | Prisma.ComplexWhereInput[] + OR?: Prisma.ComplexWhereInput[] + NOT?: Prisma.ComplexWhereInput | Prisma.ComplexWhereInput[] + complexName?: Prisma.StringFilter<"Complex"> | string + physicalAddress?: Prisma.StringNullableFilter<"Complex"> | string | null + adminEmail?: Prisma.StringFilter<"Complex"> | string + planCode?: Prisma.StringNullableFilter<"Complex"> | string | null + createdAt?: Prisma.DateTimeFilter<"Complex"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Complex"> | Date | string + plan?: Prisma.XOR | null + users?: Prisma.ComplexUserListRelationFilter + courts?: Prisma.CourtListRelationFilter +}, "id" | "complexSlug"> + +export type ComplexOrderByWithAggregationInput = { + id?: Prisma.SortOrder + complexName?: Prisma.SortOrder + physicalAddress?: Prisma.SortOrderInput | Prisma.SortOrder + complexSlug?: Prisma.SortOrder + adminEmail?: Prisma.SortOrder + planCode?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + _count?: Prisma.ComplexCountOrderByAggregateInput + _max?: Prisma.ComplexMaxOrderByAggregateInput + _min?: Prisma.ComplexMinOrderByAggregateInput +} + +export type ComplexScalarWhereWithAggregatesInput = { + AND?: Prisma.ComplexScalarWhereWithAggregatesInput | Prisma.ComplexScalarWhereWithAggregatesInput[] + OR?: Prisma.ComplexScalarWhereWithAggregatesInput[] + NOT?: Prisma.ComplexScalarWhereWithAggregatesInput | Prisma.ComplexScalarWhereWithAggregatesInput[] + id?: Prisma.UuidWithAggregatesFilter<"Complex"> | string + complexName?: Prisma.StringWithAggregatesFilter<"Complex"> | string + physicalAddress?: Prisma.StringNullableWithAggregatesFilter<"Complex"> | string | null + complexSlug?: Prisma.StringWithAggregatesFilter<"Complex"> | string + adminEmail?: Prisma.StringWithAggregatesFilter<"Complex"> | string + planCode?: Prisma.StringNullableWithAggregatesFilter<"Complex"> | string | null + createdAt?: Prisma.DateTimeWithAggregatesFilter<"Complex"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Complex"> | Date | string +} + +export type ComplexCreateInput = { + id: string + complexName: string + physicalAddress?: string | null + complexSlug: string + adminEmail: string + createdAt?: Date | string + updatedAt?: Date | string + plan?: Prisma.PlanCreateNestedOneWithoutComplexesInput + users?: Prisma.ComplexUserCreateNestedManyWithoutComplexInput + courts?: Prisma.CourtCreateNestedManyWithoutComplexInput +} + +export type ComplexUncheckedCreateInput = { + id: string + complexName: string + physicalAddress?: string | null + complexSlug: string + adminEmail: string + planCode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + users?: Prisma.ComplexUserUncheckedCreateNestedManyWithoutComplexInput + courts?: Prisma.CourtUncheckedCreateNestedManyWithoutComplexInput +} + +export type ComplexUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexName?: Prisma.StringFieldUpdateOperationsInput | string + physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + complexSlug?: Prisma.StringFieldUpdateOperationsInput | string + adminEmail?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + plan?: Prisma.PlanUpdateOneWithoutComplexesNestedInput + users?: Prisma.ComplexUserUpdateManyWithoutComplexNestedInput + courts?: Prisma.CourtUpdateManyWithoutComplexNestedInput +} + +export type ComplexUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexName?: Prisma.StringFieldUpdateOperationsInput | string + physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + complexSlug?: Prisma.StringFieldUpdateOperationsInput | string + adminEmail?: Prisma.StringFieldUpdateOperationsInput | string + planCode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + users?: Prisma.ComplexUserUncheckedUpdateManyWithoutComplexNestedInput + courts?: Prisma.CourtUncheckedUpdateManyWithoutComplexNestedInput +} + +export type ComplexCreateManyInput = { + id: string + complexName: string + physicalAddress?: string | null + complexSlug: string + adminEmail: string + planCode?: string | null + createdAt?: Date | string + updatedAt?: Date | string +} + +export type ComplexUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexName?: Prisma.StringFieldUpdateOperationsInput | string + physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + complexSlug?: Prisma.StringFieldUpdateOperationsInput | string + adminEmail?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type ComplexUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexName?: Prisma.StringFieldUpdateOperationsInput | string + physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + complexSlug?: Prisma.StringFieldUpdateOperationsInput | string + adminEmail?: Prisma.StringFieldUpdateOperationsInput | string + planCode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type ComplexCountOrderByAggregateInput = { + id?: Prisma.SortOrder + complexName?: Prisma.SortOrder + physicalAddress?: Prisma.SortOrder + complexSlug?: Prisma.SortOrder + adminEmail?: Prisma.SortOrder + planCode?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type ComplexMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + complexName?: Prisma.SortOrder + physicalAddress?: Prisma.SortOrder + complexSlug?: Prisma.SortOrder + adminEmail?: Prisma.SortOrder + planCode?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type ComplexMinOrderByAggregateInput = { + id?: Prisma.SortOrder + complexName?: Prisma.SortOrder + physicalAddress?: Prisma.SortOrder + complexSlug?: Prisma.SortOrder + adminEmail?: Prisma.SortOrder + planCode?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type ComplexScalarRelationFilter = { + is?: Prisma.ComplexWhereInput + isNot?: Prisma.ComplexWhereInput +} + +export type ComplexListRelationFilter = { + every?: Prisma.ComplexWhereInput + some?: Prisma.ComplexWhereInput + none?: Prisma.ComplexWhereInput +} + +export type ComplexOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type StringFieldUpdateOperationsInput = { + set?: string +} + +export type NullableStringFieldUpdateOperationsInput = { + set?: string | null +} + +export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string +} + +export type ComplexCreateNestedOneWithoutUsersInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutUsersInput + connect?: Prisma.ComplexWhereUniqueInput +} + +export type ComplexUpdateOneRequiredWithoutUsersNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutUsersInput + upsert?: Prisma.ComplexUpsertWithoutUsersInput + connect?: Prisma.ComplexWhereUniqueInput + update?: Prisma.XOR, Prisma.ComplexUncheckedUpdateWithoutUsersInput> +} + +export type ComplexCreateNestedOneWithoutCourtsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutCourtsInput + connect?: Prisma.ComplexWhereUniqueInput +} + +export type ComplexUpdateOneRequiredWithoutCourtsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutCourtsInput + upsert?: Prisma.ComplexUpsertWithoutCourtsInput + connect?: Prisma.ComplexWhereUniqueInput + update?: Prisma.XOR, Prisma.ComplexUncheckedUpdateWithoutCourtsInput> +} + +export type ComplexCreateNestedManyWithoutPlanInput = { + create?: Prisma.XOR | Prisma.ComplexCreateWithoutPlanInput[] | Prisma.ComplexUncheckedCreateWithoutPlanInput[] + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutPlanInput | Prisma.ComplexCreateOrConnectWithoutPlanInput[] + createMany?: Prisma.ComplexCreateManyPlanInputEnvelope + connect?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] +} + +export type ComplexUncheckedCreateNestedManyWithoutPlanInput = { + create?: Prisma.XOR | Prisma.ComplexCreateWithoutPlanInput[] | Prisma.ComplexUncheckedCreateWithoutPlanInput[] + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutPlanInput | Prisma.ComplexCreateOrConnectWithoutPlanInput[] + createMany?: Prisma.ComplexCreateManyPlanInputEnvelope + connect?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] +} + +export type ComplexUpdateManyWithoutPlanNestedInput = { + create?: Prisma.XOR | Prisma.ComplexCreateWithoutPlanInput[] | Prisma.ComplexUncheckedCreateWithoutPlanInput[] + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutPlanInput | Prisma.ComplexCreateOrConnectWithoutPlanInput[] + upsert?: Prisma.ComplexUpsertWithWhereUniqueWithoutPlanInput | Prisma.ComplexUpsertWithWhereUniqueWithoutPlanInput[] + createMany?: Prisma.ComplexCreateManyPlanInputEnvelope + set?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + disconnect?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + delete?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + connect?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + update?: Prisma.ComplexUpdateWithWhereUniqueWithoutPlanInput | Prisma.ComplexUpdateWithWhereUniqueWithoutPlanInput[] + updateMany?: Prisma.ComplexUpdateManyWithWhereWithoutPlanInput | Prisma.ComplexUpdateManyWithWhereWithoutPlanInput[] + deleteMany?: Prisma.ComplexScalarWhereInput | Prisma.ComplexScalarWhereInput[] +} + +export type ComplexUncheckedUpdateManyWithoutPlanNestedInput = { + create?: Prisma.XOR | Prisma.ComplexCreateWithoutPlanInput[] | Prisma.ComplexUncheckedCreateWithoutPlanInput[] + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutPlanInput | Prisma.ComplexCreateOrConnectWithoutPlanInput[] + upsert?: Prisma.ComplexUpsertWithWhereUniqueWithoutPlanInput | Prisma.ComplexUpsertWithWhereUniqueWithoutPlanInput[] + createMany?: Prisma.ComplexCreateManyPlanInputEnvelope + set?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + disconnect?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + delete?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + connect?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + update?: Prisma.ComplexUpdateWithWhereUniqueWithoutPlanInput | Prisma.ComplexUpdateWithWhereUniqueWithoutPlanInput[] + updateMany?: Prisma.ComplexUpdateManyWithWhereWithoutPlanInput | Prisma.ComplexUpdateManyWithWhereWithoutPlanInput[] + deleteMany?: Prisma.ComplexScalarWhereInput | Prisma.ComplexScalarWhereInput[] +} + +export type ComplexCreateWithoutUsersInput = { + id: string + complexName: string + physicalAddress?: string | null + complexSlug: string + adminEmail: string + createdAt?: Date | string + updatedAt?: Date | string + plan?: Prisma.PlanCreateNestedOneWithoutComplexesInput + courts?: Prisma.CourtCreateNestedManyWithoutComplexInput +} + +export type ComplexUncheckedCreateWithoutUsersInput = { + id: string + complexName: string + physicalAddress?: string | null + complexSlug: string + adminEmail: string + planCode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + courts?: Prisma.CourtUncheckedCreateNestedManyWithoutComplexInput +} + +export type ComplexCreateOrConnectWithoutUsersInput = { + where: Prisma.ComplexWhereUniqueInput + create: Prisma.XOR +} + +export type ComplexUpsertWithoutUsersInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ComplexWhereInput +} + +export type ComplexUpdateToOneWithWhereWithoutUsersInput = { + where?: Prisma.ComplexWhereInput + data: Prisma.XOR +} + +export type ComplexUpdateWithoutUsersInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexName?: Prisma.StringFieldUpdateOperationsInput | string + physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + complexSlug?: Prisma.StringFieldUpdateOperationsInput | string + adminEmail?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + plan?: Prisma.PlanUpdateOneWithoutComplexesNestedInput + courts?: Prisma.CourtUpdateManyWithoutComplexNestedInput +} + +export type ComplexUncheckedUpdateWithoutUsersInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexName?: Prisma.StringFieldUpdateOperationsInput | string + physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + complexSlug?: Prisma.StringFieldUpdateOperationsInput | string + adminEmail?: Prisma.StringFieldUpdateOperationsInput | string + planCode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + courts?: Prisma.CourtUncheckedUpdateManyWithoutComplexNestedInput +} + +export type ComplexCreateWithoutCourtsInput = { + id: string + complexName: string + physicalAddress?: string | null + complexSlug: string + adminEmail: string + createdAt?: Date | string + updatedAt?: Date | string + plan?: Prisma.PlanCreateNestedOneWithoutComplexesInput + users?: Prisma.ComplexUserCreateNestedManyWithoutComplexInput +} + +export type ComplexUncheckedCreateWithoutCourtsInput = { + id: string + complexName: string + physicalAddress?: string | null + complexSlug: string + adminEmail: string + planCode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + users?: Prisma.ComplexUserUncheckedCreateNestedManyWithoutComplexInput +} + +export type ComplexCreateOrConnectWithoutCourtsInput = { + where: Prisma.ComplexWhereUniqueInput + create: Prisma.XOR +} + +export type ComplexUpsertWithoutCourtsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ComplexWhereInput +} + +export type ComplexUpdateToOneWithWhereWithoutCourtsInput = { + where?: Prisma.ComplexWhereInput + data: Prisma.XOR +} + +export type ComplexUpdateWithoutCourtsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexName?: Prisma.StringFieldUpdateOperationsInput | string + physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + complexSlug?: Prisma.StringFieldUpdateOperationsInput | string + adminEmail?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + plan?: Prisma.PlanUpdateOneWithoutComplexesNestedInput + users?: Prisma.ComplexUserUpdateManyWithoutComplexNestedInput +} + +export type ComplexUncheckedUpdateWithoutCourtsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexName?: Prisma.StringFieldUpdateOperationsInput | string + physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + complexSlug?: Prisma.StringFieldUpdateOperationsInput | string + adminEmail?: Prisma.StringFieldUpdateOperationsInput | string + planCode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + users?: Prisma.ComplexUserUncheckedUpdateManyWithoutComplexNestedInput +} + +export type ComplexCreateWithoutPlanInput = { + id: string + complexName: string + physicalAddress?: string | null + complexSlug: string + adminEmail: string + createdAt?: Date | string + updatedAt?: Date | string + users?: Prisma.ComplexUserCreateNestedManyWithoutComplexInput + courts?: Prisma.CourtCreateNestedManyWithoutComplexInput +} + +export type ComplexUncheckedCreateWithoutPlanInput = { + id: string + complexName: string + physicalAddress?: string | null + complexSlug: string + adminEmail: string + createdAt?: Date | string + updatedAt?: Date | string + users?: Prisma.ComplexUserUncheckedCreateNestedManyWithoutComplexInput + courts?: Prisma.CourtUncheckedCreateNestedManyWithoutComplexInput +} + +export type ComplexCreateOrConnectWithoutPlanInput = { + where: Prisma.ComplexWhereUniqueInput + create: Prisma.XOR +} + +export type ComplexCreateManyPlanInputEnvelope = { + data: Prisma.ComplexCreateManyPlanInput | Prisma.ComplexCreateManyPlanInput[] + skipDuplicates?: boolean +} + +export type ComplexUpsertWithWhereUniqueWithoutPlanInput = { + where: Prisma.ComplexWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type ComplexUpdateWithWhereUniqueWithoutPlanInput = { + where: Prisma.ComplexWhereUniqueInput + data: Prisma.XOR +} + +export type ComplexUpdateManyWithWhereWithoutPlanInput = { + where: Prisma.ComplexScalarWhereInput + data: Prisma.XOR +} + +export type ComplexScalarWhereInput = { + AND?: Prisma.ComplexScalarWhereInput | Prisma.ComplexScalarWhereInput[] + OR?: Prisma.ComplexScalarWhereInput[] + NOT?: Prisma.ComplexScalarWhereInput | Prisma.ComplexScalarWhereInput[] + id?: Prisma.UuidFilter<"Complex"> | string + complexName?: Prisma.StringFilter<"Complex"> | string + physicalAddress?: Prisma.StringNullableFilter<"Complex"> | string | null + complexSlug?: Prisma.StringFilter<"Complex"> | string + adminEmail?: Prisma.StringFilter<"Complex"> | string + planCode?: Prisma.StringNullableFilter<"Complex"> | string | null + createdAt?: Prisma.DateTimeFilter<"Complex"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Complex"> | Date | string +} + +export type ComplexCreateManyPlanInput = { + id: string + complexName: string + physicalAddress?: string | null + complexSlug: string + adminEmail: string + createdAt?: Date | string + updatedAt?: Date | string +} + +export type ComplexUpdateWithoutPlanInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexName?: Prisma.StringFieldUpdateOperationsInput | string + physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + complexSlug?: Prisma.StringFieldUpdateOperationsInput | string + adminEmail?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + users?: Prisma.ComplexUserUpdateManyWithoutComplexNestedInput + courts?: Prisma.CourtUpdateManyWithoutComplexNestedInput +} + +export type ComplexUncheckedUpdateWithoutPlanInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexName?: Prisma.StringFieldUpdateOperationsInput | string + physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + complexSlug?: Prisma.StringFieldUpdateOperationsInput | string + adminEmail?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + users?: Prisma.ComplexUserUncheckedUpdateManyWithoutComplexNestedInput + courts?: Prisma.CourtUncheckedUpdateManyWithoutComplexNestedInput +} + +export type ComplexUncheckedUpdateManyWithoutPlanInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexName?: Prisma.StringFieldUpdateOperationsInput | string + physicalAddress?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + complexSlug?: Prisma.StringFieldUpdateOperationsInput | string + adminEmail?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + +/** + * Count Type ComplexCountOutputType + */ + +export type ComplexCountOutputType = { + users: number + courts: number +} + +export type ComplexCountOutputTypeSelect = { + users?: boolean | ComplexCountOutputTypeCountUsersArgs + courts?: boolean | ComplexCountOutputTypeCountCourtsArgs +} + +/** + * ComplexCountOutputType without action + */ +export type ComplexCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the ComplexCountOutputType + */ + select?: Prisma.ComplexCountOutputTypeSelect | null +} + +/** + * ComplexCountOutputType without action + */ +export type ComplexCountOutputTypeCountUsersArgs = { + where?: Prisma.ComplexUserWhereInput +} + +/** + * ComplexCountOutputType without action + */ +export type ComplexCountOutputTypeCountCourtsArgs = { + where?: Prisma.CourtWhereInput +} + + +export type ComplexSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + complexName?: boolean + physicalAddress?: boolean + complexSlug?: boolean + adminEmail?: boolean + planCode?: boolean + createdAt?: boolean + updatedAt?: boolean + plan?: boolean | Prisma.Complex$planArgs + users?: boolean | Prisma.Complex$usersArgs + courts?: boolean | Prisma.Complex$courtsArgs + _count?: boolean | Prisma.ComplexCountOutputTypeDefaultArgs +}, ExtArgs["result"]["complex"]> + +export type ComplexSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + complexName?: boolean + physicalAddress?: boolean + complexSlug?: boolean + adminEmail?: boolean + planCode?: boolean + createdAt?: boolean + updatedAt?: boolean + plan?: boolean | Prisma.Complex$planArgs +}, ExtArgs["result"]["complex"]> + +export type ComplexSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + complexName?: boolean + physicalAddress?: boolean + complexSlug?: boolean + adminEmail?: boolean + planCode?: boolean + createdAt?: boolean + updatedAt?: boolean + plan?: boolean | Prisma.Complex$planArgs +}, ExtArgs["result"]["complex"]> + +export type ComplexSelectScalar = { + id?: boolean + complexName?: boolean + physicalAddress?: boolean + complexSlug?: boolean + adminEmail?: boolean + planCode?: boolean + createdAt?: boolean + updatedAt?: boolean +} + +export type ComplexOmit = runtime.Types.Extensions.GetOmit<"id" | "complexName" | "physicalAddress" | "complexSlug" | "adminEmail" | "planCode" | "createdAt" | "updatedAt", ExtArgs["result"]["complex"]> +export type ComplexInclude = { + plan?: boolean | Prisma.Complex$planArgs + users?: boolean | Prisma.Complex$usersArgs + courts?: boolean | Prisma.Complex$courtsArgs + _count?: boolean | Prisma.ComplexCountOutputTypeDefaultArgs +} +export type ComplexIncludeCreateManyAndReturn = { + plan?: boolean | Prisma.Complex$planArgs +} +export type ComplexIncludeUpdateManyAndReturn = { + plan?: boolean | Prisma.Complex$planArgs +} + +export type $ComplexPayload = { + name: "Complex" + objects: { + plan: Prisma.$PlanPayload | null + users: Prisma.$ComplexUserPayload[] + courts: Prisma.$CourtPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + complexName: string + physicalAddress: string | null + complexSlug: string + adminEmail: string + planCode: string | null + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["complex"]> + composites: {} +} + +export type ComplexGetPayload = runtime.Types.Result.GetResult + +export type ComplexCountArgs = + Omit & { + select?: ComplexCountAggregateInputType | true + } + +export interface ComplexDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Complex'], meta: { name: 'Complex' } } + /** + * Find zero or one Complex that matches the filter. + * @param {ComplexFindUniqueArgs} args - Arguments to find a Complex + * @example + * // Get one Complex + * const complex = await prisma.complex.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Complex that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {ComplexFindUniqueOrThrowArgs} args - Arguments to find a Complex + * @example + * // Get one Complex + * const complex = await prisma.complex.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Complex 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 {ComplexFindFirstArgs} args - Arguments to find a Complex + * @example + * // Get one Complex + * const complex = await prisma.complex.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Complex 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 {ComplexFindFirstOrThrowArgs} args - Arguments to find a Complex + * @example + * // Get one Complex + * const complex = await prisma.complex.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Complexes 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 {ComplexFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Complexes + * const complexes = await prisma.complex.findMany() + * + * // Get first 10 Complexes + * const complexes = await prisma.complex.findMany({ take: 10 }) + * + * // Only select the `id` + * const complexWithIdOnly = await prisma.complex.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Complex. + * @param {ComplexCreateArgs} args - Arguments to create a Complex. + * @example + * // Create one Complex + * const Complex = await prisma.complex.create({ + * data: { + * // ... data to create a Complex + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Complexes. + * @param {ComplexCreateManyArgs} args - Arguments to create many Complexes. + * @example + * // Create many Complexes + * const complex = await prisma.complex.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Complexes and returns the data saved in the database. + * @param {ComplexCreateManyAndReturnArgs} args - Arguments to create many Complexes. + * @example + * // Create many Complexes + * const complex = await prisma.complex.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Complexes and only return the `id` + * const complexWithIdOnly = await prisma.complex.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 Complex. + * @param {ComplexDeleteArgs} args - Arguments to delete one Complex. + * @example + * // Delete one Complex + * const Complex = await prisma.complex.delete({ + * where: { + * // ... filter to delete one Complex + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Complex. + * @param {ComplexUpdateArgs} args - Arguments to update one Complex. + * @example + * // Update one Complex + * const complex = await prisma.complex.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Complexes. + * @param {ComplexDeleteManyArgs} args - Arguments to filter Complexes to delete. + * @example + * // Delete a few Complexes + * const { count } = await prisma.complex.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Complexes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Complexes + * const complex = await prisma.complex.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Complexes and returns the data updated in the database. + * @param {ComplexUpdateManyAndReturnArgs} args - Arguments to update many Complexes. + * @example + * // Update many Complexes + * const complex = await prisma.complex.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Complexes and only return the `id` + * const complexWithIdOnly = await prisma.complex.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 Complex. + * @param {ComplexUpsertArgs} args - Arguments to update or create a Complex. + * @example + * // Update or create a Complex + * const complex = await prisma.complex.upsert({ + * create: { + * // ... data to create a Complex + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Complex we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Complexes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexCountArgs} args - Arguments to filter Complexes to count. + * @example + * // Count the number of Complexes + * const count = await prisma.complex.count({ + * where: { + * // ... the filter for the Complexes 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 Complex. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexAggregateArgs} 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 Complex. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexGroupByArgs} 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 ComplexGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: ComplexGroupByArgs['orderBy'] } + : { orderBy?: ComplexGroupByArgs['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 ? GetComplexGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Complex model + */ +readonly fields: ComplexFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Complex. + * 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__ComplexClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + plan = {}>(args?: Prisma.Subset>): Prisma.Prisma__PlanClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + users = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + courts = {}>(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 Complex model + */ +export interface ComplexFieldRefs { + readonly id: Prisma.FieldRef<"Complex", 'String'> + readonly complexName: Prisma.FieldRef<"Complex", 'String'> + readonly physicalAddress: Prisma.FieldRef<"Complex", 'String'> + readonly complexSlug: Prisma.FieldRef<"Complex", 'String'> + readonly adminEmail: Prisma.FieldRef<"Complex", 'String'> + readonly planCode: Prisma.FieldRef<"Complex", 'String'> + readonly createdAt: Prisma.FieldRef<"Complex", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"Complex", 'DateTime'> +} + + +// Custom InputTypes +/** + * Complex findUnique + */ +export type ComplexFindUniqueArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * Filter, which Complex to fetch. + */ + where: Prisma.ComplexWhereUniqueInput +} + +/** + * Complex findUniqueOrThrow + */ +export type ComplexFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * Filter, which Complex to fetch. + */ + where: Prisma.ComplexWhereUniqueInput +} + +/** + * Complex findFirst + */ +export type ComplexFindFirstArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * Filter, which Complex to fetch. + */ + where?: Prisma.ComplexWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Complexes to fetch. + */ + orderBy?: Prisma.ComplexOrderByWithRelationInput | Prisma.ComplexOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Complexes. + */ + cursor?: Prisma.ComplexWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Complexes 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` Complexes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Complexes. + */ + distinct?: Prisma.ComplexScalarFieldEnum | Prisma.ComplexScalarFieldEnum[] +} + +/** + * Complex findFirstOrThrow + */ +export type ComplexFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * Filter, which Complex to fetch. + */ + where?: Prisma.ComplexWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Complexes to fetch. + */ + orderBy?: Prisma.ComplexOrderByWithRelationInput | Prisma.ComplexOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Complexes. + */ + cursor?: Prisma.ComplexWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Complexes 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` Complexes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Complexes. + */ + distinct?: Prisma.ComplexScalarFieldEnum | Prisma.ComplexScalarFieldEnum[] +} + +/** + * Complex findMany + */ +export type ComplexFindManyArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * Filter, which Complexes to fetch. + */ + where?: Prisma.ComplexWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Complexes to fetch. + */ + orderBy?: Prisma.ComplexOrderByWithRelationInput | Prisma.ComplexOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Complexes. + */ + cursor?: Prisma.ComplexWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Complexes 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` Complexes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Complexes. + */ + distinct?: Prisma.ComplexScalarFieldEnum | Prisma.ComplexScalarFieldEnum[] +} + +/** + * Complex create + */ +export type ComplexCreateArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * The data needed to create a Complex. + */ + data: Prisma.XOR +} + +/** + * Complex createMany + */ +export type ComplexCreateManyArgs = { + /** + * The data used to create many Complexes. + */ + data: Prisma.ComplexCreateManyInput | Prisma.ComplexCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Complex createManyAndReturn + */ +export type ComplexCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * The data used to create many Complexes. + */ + data: Prisma.ComplexCreateManyInput | Prisma.ComplexCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexIncludeCreateManyAndReturn | null +} + +/** + * Complex update + */ +export type ComplexUpdateArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * The data needed to update a Complex. + */ + data: Prisma.XOR + /** + * Choose, which Complex to update. + */ + where: Prisma.ComplexWhereUniqueInput +} + +/** + * Complex updateMany + */ +export type ComplexUpdateManyArgs = { + /** + * The data used to update Complexes. + */ + data: Prisma.XOR + /** + * Filter which Complexes to update + */ + where?: Prisma.ComplexWhereInput + /** + * Limit how many Complexes to update. + */ + limit?: number +} + +/** + * Complex updateManyAndReturn + */ +export type ComplexUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * The data used to update Complexes. + */ + data: Prisma.XOR + /** + * Filter which Complexes to update + */ + where?: Prisma.ComplexWhereInput + /** + * Limit how many Complexes to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexIncludeUpdateManyAndReturn | null +} + +/** + * Complex upsert + */ +export type ComplexUpsertArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * The filter to search for the Complex to update in case it exists. + */ + where: Prisma.ComplexWhereUniqueInput + /** + * In case the Complex found by the `where` argument doesn't exist, create a new Complex with this data. + */ + create: Prisma.XOR + /** + * In case the Complex was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Complex delete + */ +export type ComplexDeleteArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * Filter which Complex to delete. + */ + where: Prisma.ComplexWhereUniqueInput +} + +/** + * Complex deleteMany + */ +export type ComplexDeleteManyArgs = { + /** + * Filter which Complexes to delete + */ + where?: Prisma.ComplexWhereInput + /** + * Limit how many Complexes to delete. + */ + limit?: number +} + +/** + * Complex.plan + */ +export type Complex$planArgs = { + /** + * Select specific fields to fetch from the Plan + */ + select?: Prisma.PlanSelect | null + /** + * Omit specific fields from the Plan + */ + omit?: Prisma.PlanOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PlanInclude | null + where?: Prisma.PlanWhereInput +} + +/** + * Complex.users + */ +export type Complex$usersArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelect | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserInclude | null + where?: Prisma.ComplexUserWhereInput + orderBy?: Prisma.ComplexUserOrderByWithRelationInput | Prisma.ComplexUserOrderByWithRelationInput[] + cursor?: Prisma.ComplexUserWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.ComplexUserScalarFieldEnum | Prisma.ComplexUserScalarFieldEnum[] +} + +/** + * Complex.courts + */ +export type Complex$courtsArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelect | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtInclude | null + where?: Prisma.CourtWhereInput + orderBy?: Prisma.CourtOrderByWithRelationInput | Prisma.CourtOrderByWithRelationInput[] + cursor?: Prisma.CourtWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.CourtScalarFieldEnum | Prisma.CourtScalarFieldEnum[] +} + +/** + * Complex without action + */ +export type ComplexDefaultArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null +} diff --git a/apps/backend/src/generated/prisma/models/ComplexUser.ts b/apps/backend/src/generated/prisma/models/ComplexUser.ts new file mode 100644 index 0000000..a7cf65d --- /dev/null +++ b/apps/backend/src/generated/prisma/models/ComplexUser.ts @@ -0,0 +1,1434 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `ComplexUser` 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" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model ComplexUser + * + */ +export type ComplexUserModel = runtime.Types.Result.DefaultSelection + +export type AggregateComplexUser = { + _count: ComplexUserCountAggregateOutputType | null + _min: ComplexUserMinAggregateOutputType | null + _max: ComplexUserMaxAggregateOutputType | null +} + +export type ComplexUserMinAggregateOutputType = { + complexId: string | null + userId: string | null + role: $Enums.ComplexUserRole | null + createdAt: Date | null +} + +export type ComplexUserMaxAggregateOutputType = { + complexId: string | null + userId: string | null + role: $Enums.ComplexUserRole | null + createdAt: Date | null +} + +export type ComplexUserCountAggregateOutputType = { + complexId: number + userId: number + role: number + createdAt: number + _all: number +} + + +export type ComplexUserMinAggregateInputType = { + complexId?: true + userId?: true + role?: true + createdAt?: true +} + +export type ComplexUserMaxAggregateInputType = { + complexId?: true + userId?: true + role?: true + createdAt?: true +} + +export type ComplexUserCountAggregateInputType = { + complexId?: true + userId?: true + role?: true + createdAt?: true + _all?: true +} + +export type ComplexUserAggregateArgs = { + /** + * Filter which ComplexUser to aggregate. + */ + where?: Prisma.ComplexUserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of ComplexUsers to fetch. + */ + orderBy?: Prisma.ComplexUserOrderByWithRelationInput | Prisma.ComplexUserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.ComplexUserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` ComplexUsers 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` ComplexUsers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned ComplexUsers + **/ + _count?: true | ComplexUserCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: ComplexUserMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: ComplexUserMaxAggregateInputType +} + +export type GetComplexUserAggregateType = { + [P in keyof T & keyof AggregateComplexUser]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type ComplexUserGroupByArgs = { + where?: Prisma.ComplexUserWhereInput + orderBy?: Prisma.ComplexUserOrderByWithAggregationInput | Prisma.ComplexUserOrderByWithAggregationInput[] + by: Prisma.ComplexUserScalarFieldEnum[] | Prisma.ComplexUserScalarFieldEnum + having?: Prisma.ComplexUserScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: ComplexUserCountAggregateInputType | true + _min?: ComplexUserMinAggregateInputType + _max?: ComplexUserMaxAggregateInputType +} + +export type ComplexUserGroupByOutputType = { + complexId: string + userId: string + role: $Enums.ComplexUserRole + createdAt: Date + _count: ComplexUserCountAggregateOutputType | null + _min: ComplexUserMinAggregateOutputType | null + _max: ComplexUserMaxAggregateOutputType | null +} + +export type GetComplexUserGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof ComplexUserGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type ComplexUserWhereInput = { + AND?: Prisma.ComplexUserWhereInput | Prisma.ComplexUserWhereInput[] + OR?: Prisma.ComplexUserWhereInput[] + NOT?: Prisma.ComplexUserWhereInput | Prisma.ComplexUserWhereInput[] + complexId?: Prisma.UuidFilter<"ComplexUser"> | string + userId?: Prisma.UuidFilter<"ComplexUser"> | string + role?: Prisma.EnumComplexUserRoleFilter<"ComplexUser"> | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string + complex?: Prisma.XOR + user?: Prisma.XOR +} + +export type ComplexUserOrderByWithRelationInput = { + complexId?: Prisma.SortOrder + userId?: Prisma.SortOrder + role?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + complex?: Prisma.ComplexOrderByWithRelationInput + user?: Prisma.UserOrderByWithRelationInput +} + +export type ComplexUserWhereUniqueInput = Prisma.AtLeast<{ + complexId_userId?: Prisma.ComplexUserComplexIdUserIdCompoundUniqueInput + AND?: Prisma.ComplexUserWhereInput | Prisma.ComplexUserWhereInput[] + OR?: Prisma.ComplexUserWhereInput[] + NOT?: Prisma.ComplexUserWhereInput | Prisma.ComplexUserWhereInput[] + complexId?: Prisma.UuidFilter<"ComplexUser"> | string + userId?: Prisma.UuidFilter<"ComplexUser"> | string + role?: Prisma.EnumComplexUserRoleFilter<"ComplexUser"> | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string + complex?: Prisma.XOR + user?: Prisma.XOR +}, "complexId_userId"> + +export type ComplexUserOrderByWithAggregationInput = { + complexId?: Prisma.SortOrder + userId?: Prisma.SortOrder + role?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + _count?: Prisma.ComplexUserCountOrderByAggregateInput + _max?: Prisma.ComplexUserMaxOrderByAggregateInput + _min?: Prisma.ComplexUserMinOrderByAggregateInput +} + +export type ComplexUserScalarWhereWithAggregatesInput = { + AND?: Prisma.ComplexUserScalarWhereWithAggregatesInput | Prisma.ComplexUserScalarWhereWithAggregatesInput[] + OR?: Prisma.ComplexUserScalarWhereWithAggregatesInput[] + NOT?: Prisma.ComplexUserScalarWhereWithAggregatesInput | Prisma.ComplexUserScalarWhereWithAggregatesInput[] + complexId?: Prisma.UuidWithAggregatesFilter<"ComplexUser"> | string + userId?: Prisma.UuidWithAggregatesFilter<"ComplexUser"> | string + role?: Prisma.EnumComplexUserRoleWithAggregatesFilter<"ComplexUser"> | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeWithAggregatesFilter<"ComplexUser"> | Date | string +} + +export type ComplexUserCreateInput = { + role?: $Enums.ComplexUserRole + createdAt?: Date | string + complex: Prisma.ComplexCreateNestedOneWithoutUsersInput + user: Prisma.UserCreateNestedOneWithoutComplexesInput +} + +export type ComplexUserUncheckedCreateInput = { + complexId: string + userId: string + role?: $Enums.ComplexUserRole + createdAt?: Date | string +} + +export type ComplexUserUpdateInput = { + role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutUsersNestedInput + user?: Prisma.UserUpdateOneRequiredWithoutComplexesNestedInput +} + +export type ComplexUserUncheckedUpdateInput = { + complexId?: Prisma.StringFieldUpdateOperationsInput | string + userId?: Prisma.StringFieldUpdateOperationsInput | string + role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type ComplexUserCreateManyInput = { + complexId: string + userId: string + role?: $Enums.ComplexUserRole + createdAt?: Date | string +} + +export type ComplexUserUpdateManyMutationInput = { + role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type ComplexUserUncheckedUpdateManyInput = { + complexId?: Prisma.StringFieldUpdateOperationsInput | string + userId?: Prisma.StringFieldUpdateOperationsInput | string + role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type ComplexUserListRelationFilter = { + every?: Prisma.ComplexUserWhereInput + some?: Prisma.ComplexUserWhereInput + none?: Prisma.ComplexUserWhereInput +} + +export type ComplexUserOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type ComplexUserComplexIdUserIdCompoundUniqueInput = { + complexId: string + userId: string +} + +export type ComplexUserCountOrderByAggregateInput = { + complexId?: Prisma.SortOrder + userId?: Prisma.SortOrder + role?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type ComplexUserMaxOrderByAggregateInput = { + complexId?: Prisma.SortOrder + userId?: Prisma.SortOrder + role?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type ComplexUserMinOrderByAggregateInput = { + complexId?: Prisma.SortOrder + userId?: Prisma.SortOrder + role?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type ComplexUserCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.ComplexUserCreateWithoutComplexInput[] | Prisma.ComplexUserUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutComplexInput | Prisma.ComplexUserCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.ComplexUserCreateManyComplexInputEnvelope + connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] +} + +export type ComplexUserUncheckedCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.ComplexUserCreateWithoutComplexInput[] | Prisma.ComplexUserUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutComplexInput | Prisma.ComplexUserCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.ComplexUserCreateManyComplexInputEnvelope + connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] +} + +export type ComplexUserUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.ComplexUserCreateWithoutComplexInput[] | Prisma.ComplexUserUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutComplexInput | Prisma.ComplexUserCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.ComplexUserUpsertWithWhereUniqueWithoutComplexInput | Prisma.ComplexUserUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.ComplexUserCreateManyComplexInputEnvelope + set?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + disconnect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + delete?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + update?: Prisma.ComplexUserUpdateWithWhereUniqueWithoutComplexInput | Prisma.ComplexUserUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.ComplexUserUpdateManyWithWhereWithoutComplexInput | Prisma.ComplexUserUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[] +} + +export type ComplexUserUncheckedUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.ComplexUserCreateWithoutComplexInput[] | Prisma.ComplexUserUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutComplexInput | Prisma.ComplexUserCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.ComplexUserUpsertWithWhereUniqueWithoutComplexInput | Prisma.ComplexUserUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.ComplexUserCreateManyComplexInputEnvelope + set?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + disconnect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + delete?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + update?: Prisma.ComplexUserUpdateWithWhereUniqueWithoutComplexInput | Prisma.ComplexUserUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.ComplexUserUpdateManyWithWhereWithoutComplexInput | Prisma.ComplexUserUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[] +} + +export type EnumComplexUserRoleFieldUpdateOperationsInput = { + set?: $Enums.ComplexUserRole +} + +export type ComplexUserCreateNestedManyWithoutUserInput = { + create?: Prisma.XOR | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[] + createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope + connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] +} + +export type ComplexUserUncheckedCreateNestedManyWithoutUserInput = { + create?: Prisma.XOR | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[] + createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope + connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] +} + +export type ComplexUserUpdateManyWithoutUserNestedInput = { + create?: Prisma.XOR | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[] + upsert?: Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput[] + createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope + set?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + disconnect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + delete?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + update?: Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput | Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput[] + deleteMany?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[] +} + +export type ComplexUserUncheckedUpdateManyWithoutUserNestedInput = { + create?: Prisma.XOR | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[] + upsert?: Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput[] + createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope + set?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + disconnect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + delete?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[] + update?: Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput | Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput[] + deleteMany?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[] +} + +export type ComplexUserCreateWithoutComplexInput = { + role?: $Enums.ComplexUserRole + createdAt?: Date | string + user: Prisma.UserCreateNestedOneWithoutComplexesInput +} + +export type ComplexUserUncheckedCreateWithoutComplexInput = { + userId: string + role?: $Enums.ComplexUserRole + createdAt?: Date | string +} + +export type ComplexUserCreateOrConnectWithoutComplexInput = { + where: Prisma.ComplexUserWhereUniqueInput + create: Prisma.XOR +} + +export type ComplexUserCreateManyComplexInputEnvelope = { + data: Prisma.ComplexUserCreateManyComplexInput | Prisma.ComplexUserCreateManyComplexInput[] + skipDuplicates?: boolean +} + +export type ComplexUserUpsertWithWhereUniqueWithoutComplexInput = { + where: Prisma.ComplexUserWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type ComplexUserUpdateWithWhereUniqueWithoutComplexInput = { + where: Prisma.ComplexUserWhereUniqueInput + data: Prisma.XOR +} + +export type ComplexUserUpdateManyWithWhereWithoutComplexInput = { + where: Prisma.ComplexUserScalarWhereInput + data: Prisma.XOR +} + +export type ComplexUserScalarWhereInput = { + AND?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[] + OR?: Prisma.ComplexUserScalarWhereInput[] + NOT?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[] + complexId?: Prisma.UuidFilter<"ComplexUser"> | string + userId?: Prisma.UuidFilter<"ComplexUser"> | string + role?: Prisma.EnumComplexUserRoleFilter<"ComplexUser"> | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string +} + +export type ComplexUserCreateWithoutUserInput = { + role?: $Enums.ComplexUserRole + createdAt?: Date | string + complex: Prisma.ComplexCreateNestedOneWithoutUsersInput +} + +export type ComplexUserUncheckedCreateWithoutUserInput = { + complexId: string + role?: $Enums.ComplexUserRole + createdAt?: Date | string +} + +export type ComplexUserCreateOrConnectWithoutUserInput = { + where: Prisma.ComplexUserWhereUniqueInput + create: Prisma.XOR +} + +export type ComplexUserCreateManyUserInputEnvelope = { + data: Prisma.ComplexUserCreateManyUserInput | Prisma.ComplexUserCreateManyUserInput[] + skipDuplicates?: boolean +} + +export type ComplexUserUpsertWithWhereUniqueWithoutUserInput = { + where: Prisma.ComplexUserWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type ComplexUserUpdateWithWhereUniqueWithoutUserInput = { + where: Prisma.ComplexUserWhereUniqueInput + data: Prisma.XOR +} + +export type ComplexUserUpdateManyWithWhereWithoutUserInput = { + where: Prisma.ComplexUserScalarWhereInput + data: Prisma.XOR +} + +export type ComplexUserCreateManyComplexInput = { + userId: string + role?: $Enums.ComplexUserRole + createdAt?: Date | string +} + +export type ComplexUserUpdateWithoutComplexInput = { + role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user?: Prisma.UserUpdateOneRequiredWithoutComplexesNestedInput +} + +export type ComplexUserUncheckedUpdateWithoutComplexInput = { + userId?: Prisma.StringFieldUpdateOperationsInput | string + role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type ComplexUserUncheckedUpdateManyWithoutComplexInput = { + userId?: Prisma.StringFieldUpdateOperationsInput | string + role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type ComplexUserCreateManyUserInput = { + complexId: string + role?: $Enums.ComplexUserRole + createdAt?: Date | string +} + +export type ComplexUserUpdateWithoutUserInput = { + role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutUsersNestedInput +} + +export type ComplexUserUncheckedUpdateWithoutUserInput = { + complexId?: Prisma.StringFieldUpdateOperationsInput | string + role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type ComplexUserUncheckedUpdateManyWithoutUserInput = { + complexId?: Prisma.StringFieldUpdateOperationsInput | string + role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + + +export type ComplexUserSelect = runtime.Types.Extensions.GetSelect<{ + complexId?: boolean + userId?: boolean + role?: boolean + createdAt?: boolean + complex?: boolean | Prisma.ComplexDefaultArgs + user?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["complexUser"]> + +export type ComplexUserSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + complexId?: boolean + userId?: boolean + role?: boolean + createdAt?: boolean + complex?: boolean | Prisma.ComplexDefaultArgs + user?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["complexUser"]> + +export type ComplexUserSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + complexId?: boolean + userId?: boolean + role?: boolean + createdAt?: boolean + complex?: boolean | Prisma.ComplexDefaultArgs + user?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["complexUser"]> + +export type ComplexUserSelectScalar = { + complexId?: boolean + userId?: boolean + role?: boolean + createdAt?: boolean +} + +export type ComplexUserOmit = runtime.Types.Extensions.GetOmit<"complexId" | "userId" | "role" | "createdAt", ExtArgs["result"]["complexUser"]> +export type ComplexUserInclude = { + complex?: boolean | Prisma.ComplexDefaultArgs + user?: boolean | Prisma.UserDefaultArgs +} +export type ComplexUserIncludeCreateManyAndReturn = { + complex?: boolean | Prisma.ComplexDefaultArgs + user?: boolean | Prisma.UserDefaultArgs +} +export type ComplexUserIncludeUpdateManyAndReturn = { + complex?: boolean | Prisma.ComplexDefaultArgs + user?: boolean | Prisma.UserDefaultArgs +} + +export type $ComplexUserPayload = { + name: "ComplexUser" + objects: { + complex: Prisma.$ComplexPayload + user: Prisma.$UserPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + complexId: string + userId: string + role: $Enums.ComplexUserRole + createdAt: Date + }, ExtArgs["result"]["complexUser"]> + composites: {} +} + +export type ComplexUserGetPayload = runtime.Types.Result.GetResult + +export type ComplexUserCountArgs = + Omit & { + select?: ComplexUserCountAggregateInputType | true + } + +export interface ComplexUserDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['ComplexUser'], meta: { name: 'ComplexUser' } } + /** + * Find zero or one ComplexUser that matches the filter. + * @param {ComplexUserFindUniqueArgs} args - Arguments to find a ComplexUser + * @example + * // Get one ComplexUser + * const complexUser = await prisma.complexUser.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexUserClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one ComplexUser that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {ComplexUserFindUniqueOrThrowArgs} args - Arguments to find a ComplexUser + * @example + * // Get one ComplexUser + * const complexUser = await prisma.complexUser.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexUserClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first ComplexUser 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 {ComplexUserFindFirstArgs} args - Arguments to find a ComplexUser + * @example + * // Get one ComplexUser + * const complexUser = await prisma.complexUser.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__ComplexUserClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first ComplexUser 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 {ComplexUserFindFirstOrThrowArgs} args - Arguments to find a ComplexUser + * @example + * // Get one ComplexUser + * const complexUser = await prisma.complexUser.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__ComplexUserClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more ComplexUsers 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 {ComplexUserFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all ComplexUsers + * const complexUsers = await prisma.complexUser.findMany() + * + * // Get first 10 ComplexUsers + * const complexUsers = await prisma.complexUser.findMany({ take: 10 }) + * + * // Only select the `complexId` + * const complexUserWithComplexIdOnly = await prisma.complexUser.findMany({ select: { complexId: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a ComplexUser. + * @param {ComplexUserCreateArgs} args - Arguments to create a ComplexUser. + * @example + * // Create one ComplexUser + * const ComplexUser = await prisma.complexUser.create({ + * data: { + * // ... data to create a ComplexUser + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexUserClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many ComplexUsers. + * @param {ComplexUserCreateManyArgs} args - Arguments to create many ComplexUsers. + * @example + * // Create many ComplexUsers + * const complexUser = await prisma.complexUser.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many ComplexUsers and returns the data saved in the database. + * @param {ComplexUserCreateManyAndReturnArgs} args - Arguments to create many ComplexUsers. + * @example + * // Create many ComplexUsers + * const complexUser = await prisma.complexUser.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many ComplexUsers and only return the `complexId` + * const complexUserWithComplexIdOnly = await prisma.complexUser.createManyAndReturn({ + * select: { complexId: 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 ComplexUser. + * @param {ComplexUserDeleteArgs} args - Arguments to delete one ComplexUser. + * @example + * // Delete one ComplexUser + * const ComplexUser = await prisma.complexUser.delete({ + * where: { + * // ... filter to delete one ComplexUser + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexUserClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one ComplexUser. + * @param {ComplexUserUpdateArgs} args - Arguments to update one ComplexUser. + * @example + * // Update one ComplexUser + * const complexUser = await prisma.complexUser.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexUserClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more ComplexUsers. + * @param {ComplexUserDeleteManyArgs} args - Arguments to filter ComplexUsers to delete. + * @example + * // Delete a few ComplexUsers + * const { count } = await prisma.complexUser.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more ComplexUsers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexUserUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many ComplexUsers + * const complexUser = await prisma.complexUser.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more ComplexUsers and returns the data updated in the database. + * @param {ComplexUserUpdateManyAndReturnArgs} args - Arguments to update many ComplexUsers. + * @example + * // Update many ComplexUsers + * const complexUser = await prisma.complexUser.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more ComplexUsers and only return the `complexId` + * const complexUserWithComplexIdOnly = await prisma.complexUser.updateManyAndReturn({ + * select: { complexId: 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 ComplexUser. + * @param {ComplexUserUpsertArgs} args - Arguments to update or create a ComplexUser. + * @example + * // Update or create a ComplexUser + * const complexUser = await prisma.complexUser.upsert({ + * create: { + * // ... data to create a ComplexUser + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the ComplexUser we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexUserClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of ComplexUsers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexUserCountArgs} args - Arguments to filter ComplexUsers to count. + * @example + * // Count the number of ComplexUsers + * const count = await prisma.complexUser.count({ + * where: { + * // ... the filter for the ComplexUsers 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 ComplexUser. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexUserAggregateArgs} 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 ComplexUser. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexUserGroupByArgs} 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 ComplexUserGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: ComplexUserGroupByArgs['orderBy'] } + : { orderBy?: ComplexUserGroupByArgs['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 ? GetComplexUserGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the ComplexUser model + */ +readonly fields: ComplexUserFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for ComplexUser. + * 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__ComplexUserClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + complex = {}>(args?: Prisma.Subset>): Prisma.Prisma__ComplexClient, 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. + * @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 ComplexUser model + */ +export interface ComplexUserFieldRefs { + readonly complexId: Prisma.FieldRef<"ComplexUser", 'String'> + readonly userId: Prisma.FieldRef<"ComplexUser", 'String'> + readonly role: Prisma.FieldRef<"ComplexUser", 'ComplexUserRole'> + readonly createdAt: Prisma.FieldRef<"ComplexUser", 'DateTime'> +} + + +// Custom InputTypes +/** + * ComplexUser findUnique + */ +export type ComplexUserFindUniqueArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelect | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserInclude | null + /** + * Filter, which ComplexUser to fetch. + */ + where: Prisma.ComplexUserWhereUniqueInput +} + +/** + * ComplexUser findUniqueOrThrow + */ +export type ComplexUserFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelect | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserInclude | null + /** + * Filter, which ComplexUser to fetch. + */ + where: Prisma.ComplexUserWhereUniqueInput +} + +/** + * ComplexUser findFirst + */ +export type ComplexUserFindFirstArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelect | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserInclude | null + /** + * Filter, which ComplexUser to fetch. + */ + where?: Prisma.ComplexUserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of ComplexUsers to fetch. + */ + orderBy?: Prisma.ComplexUserOrderByWithRelationInput | Prisma.ComplexUserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for ComplexUsers. + */ + cursor?: Prisma.ComplexUserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` ComplexUsers 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` ComplexUsers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of ComplexUsers. + */ + distinct?: Prisma.ComplexUserScalarFieldEnum | Prisma.ComplexUserScalarFieldEnum[] +} + +/** + * ComplexUser findFirstOrThrow + */ +export type ComplexUserFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelect | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserInclude | null + /** + * Filter, which ComplexUser to fetch. + */ + where?: Prisma.ComplexUserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of ComplexUsers to fetch. + */ + orderBy?: Prisma.ComplexUserOrderByWithRelationInput | Prisma.ComplexUserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for ComplexUsers. + */ + cursor?: Prisma.ComplexUserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` ComplexUsers 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` ComplexUsers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of ComplexUsers. + */ + distinct?: Prisma.ComplexUserScalarFieldEnum | Prisma.ComplexUserScalarFieldEnum[] +} + +/** + * ComplexUser findMany + */ +export type ComplexUserFindManyArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelect | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserInclude | null + /** + * Filter, which ComplexUsers to fetch. + */ + where?: Prisma.ComplexUserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of ComplexUsers to fetch. + */ + orderBy?: Prisma.ComplexUserOrderByWithRelationInput | Prisma.ComplexUserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing ComplexUsers. + */ + cursor?: Prisma.ComplexUserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` ComplexUsers 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` ComplexUsers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of ComplexUsers. + */ + distinct?: Prisma.ComplexUserScalarFieldEnum | Prisma.ComplexUserScalarFieldEnum[] +} + +/** + * ComplexUser create + */ +export type ComplexUserCreateArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelect | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserInclude | null + /** + * The data needed to create a ComplexUser. + */ + data: Prisma.XOR +} + +/** + * ComplexUser createMany + */ +export type ComplexUserCreateManyArgs = { + /** + * The data used to create many ComplexUsers. + */ + data: Prisma.ComplexUserCreateManyInput | Prisma.ComplexUserCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * ComplexUser createManyAndReturn + */ +export type ComplexUserCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelectCreateManyAndReturn | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * The data used to create many ComplexUsers. + */ + data: Prisma.ComplexUserCreateManyInput | Prisma.ComplexUserCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserIncludeCreateManyAndReturn | null +} + +/** + * ComplexUser update + */ +export type ComplexUserUpdateArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelect | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserInclude | null + /** + * The data needed to update a ComplexUser. + */ + data: Prisma.XOR + /** + * Choose, which ComplexUser to update. + */ + where: Prisma.ComplexUserWhereUniqueInput +} + +/** + * ComplexUser updateMany + */ +export type ComplexUserUpdateManyArgs = { + /** + * The data used to update ComplexUsers. + */ + data: Prisma.XOR + /** + * Filter which ComplexUsers to update + */ + where?: Prisma.ComplexUserWhereInput + /** + * Limit how many ComplexUsers to update. + */ + limit?: number +} + +/** + * ComplexUser updateManyAndReturn + */ +export type ComplexUserUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * The data used to update ComplexUsers. + */ + data: Prisma.XOR + /** + * Filter which ComplexUsers to update + */ + where?: Prisma.ComplexUserWhereInput + /** + * Limit how many ComplexUsers to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserIncludeUpdateManyAndReturn | null +} + +/** + * ComplexUser upsert + */ +export type ComplexUserUpsertArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelect | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserInclude | null + /** + * The filter to search for the ComplexUser to update in case it exists. + */ + where: Prisma.ComplexUserWhereUniqueInput + /** + * In case the ComplexUser found by the `where` argument doesn't exist, create a new ComplexUser with this data. + */ + create: Prisma.XOR + /** + * In case the ComplexUser was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * ComplexUser delete + */ +export type ComplexUserDeleteArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelect | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserInclude | null + /** + * Filter which ComplexUser to delete. + */ + where: Prisma.ComplexUserWhereUniqueInput +} + +/** + * ComplexUser deleteMany + */ +export type ComplexUserDeleteManyArgs = { + /** + * Filter which ComplexUsers to delete + */ + where?: Prisma.ComplexUserWhereInput + /** + * Limit how many ComplexUsers to delete. + */ + limit?: number +} + +/** + * ComplexUser without action + */ +export type ComplexUserDefaultArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelect | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserInclude | null +} diff --git a/apps/backend/src/generated/prisma/models/Court.ts b/apps/backend/src/generated/prisma/models/Court.ts new file mode 100644 index 0000000..fc388ba --- /dev/null +++ b/apps/backend/src/generated/prisma/models/Court.ts @@ -0,0 +1,2083 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Court` 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" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model Court + * + */ +export type CourtModel = runtime.Types.Result.DefaultSelection + +export type AggregateCourt = { + _count: CourtCountAggregateOutputType | null + _avg: CourtAvgAggregateOutputType | null + _sum: CourtSumAggregateOutputType | null + _min: CourtMinAggregateOutputType | null + _max: CourtMaxAggregateOutputType | null +} + +export type CourtAvgAggregateOutputType = { + slotDurationMinutes: number | null + basePrice: runtime.Decimal | null +} + +export type CourtSumAggregateOutputType = { + slotDurationMinutes: number | null + basePrice: runtime.Decimal | null +} + +export type CourtMinAggregateOutputType = { + id: string | null + complexId: string | null + sportId: string | null + name: string | null + slotDurationMinutes: number | null + basePrice: runtime.Decimal | null + createdAt: Date | null + updatedAt: Date | null +} + +export type CourtMaxAggregateOutputType = { + id: string | null + complexId: string | null + sportId: string | null + name: string | null + slotDurationMinutes: number | null + basePrice: runtime.Decimal | null + createdAt: Date | null + updatedAt: Date | null +} + +export type CourtCountAggregateOutputType = { + id: number + complexId: number + sportId: number + name: number + slotDurationMinutes: number + basePrice: number + createdAt: number + updatedAt: number + _all: number +} + + +export type CourtAvgAggregateInputType = { + slotDurationMinutes?: true + basePrice?: true +} + +export type CourtSumAggregateInputType = { + slotDurationMinutes?: true + basePrice?: true +} + +export type CourtMinAggregateInputType = { + id?: true + complexId?: true + sportId?: true + name?: true + slotDurationMinutes?: true + basePrice?: true + createdAt?: true + updatedAt?: true +} + +export type CourtMaxAggregateInputType = { + id?: true + complexId?: true + sportId?: true + name?: true + slotDurationMinutes?: true + basePrice?: true + createdAt?: true + updatedAt?: true +} + +export type CourtCountAggregateInputType = { + id?: true + complexId?: true + sportId?: true + name?: true + slotDurationMinutes?: true + basePrice?: true + createdAt?: true + updatedAt?: true + _all?: true +} + +export type CourtAggregateArgs = { + /** + * Filter which Court to aggregate. + */ + where?: Prisma.CourtWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Courts to fetch. + */ + orderBy?: Prisma.CourtOrderByWithRelationInput | Prisma.CourtOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.CourtWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Courts 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` Courts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Courts + **/ + _count?: true | CourtCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: CourtAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: CourtSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: CourtMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: CourtMaxAggregateInputType +} + +export type GetCourtAggregateType = { + [P in keyof T & keyof AggregateCourt]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type CourtGroupByArgs = { + where?: Prisma.CourtWhereInput + orderBy?: Prisma.CourtOrderByWithAggregationInput | Prisma.CourtOrderByWithAggregationInput[] + by: Prisma.CourtScalarFieldEnum[] | Prisma.CourtScalarFieldEnum + having?: Prisma.CourtScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: CourtCountAggregateInputType | true + _avg?: CourtAvgAggregateInputType + _sum?: CourtSumAggregateInputType + _min?: CourtMinAggregateInputType + _max?: CourtMaxAggregateInputType +} + +export type CourtGroupByOutputType = { + id: string + complexId: string + sportId: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal + createdAt: Date + updatedAt: Date + _count: CourtCountAggregateOutputType | null + _avg: CourtAvgAggregateOutputType | null + _sum: CourtSumAggregateOutputType | null + _min: CourtMinAggregateOutputType | null + _max: CourtMaxAggregateOutputType | null +} + +export type GetCourtGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof CourtGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type CourtWhereInput = { + AND?: Prisma.CourtWhereInput | Prisma.CourtWhereInput[] + OR?: Prisma.CourtWhereInput[] + NOT?: Prisma.CourtWhereInput | Prisma.CourtWhereInput[] + id?: Prisma.UuidFilter<"Court"> | string + complexId?: Prisma.UuidFilter<"Court"> | string + sportId?: Prisma.UuidFilter<"Court"> | string + name?: Prisma.StringFilter<"Court"> | string + slotDurationMinutes?: Prisma.IntFilter<"Court"> | number + basePrice?: Prisma.DecimalFilter<"Court"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"Court"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Court"> | Date | string + complex?: Prisma.XOR + sport?: Prisma.XOR + availabilities?: Prisma.CourtAvailabilityListRelationFilter + priceRules?: Prisma.CourtPriceRuleListRelationFilter + bookings?: Prisma.CourtBookingListRelationFilter +} + +export type CourtOrderByWithRelationInput = { + id?: Prisma.SortOrder + complexId?: Prisma.SortOrder + sportId?: Prisma.SortOrder + name?: Prisma.SortOrder + slotDurationMinutes?: Prisma.SortOrder + basePrice?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + complex?: Prisma.ComplexOrderByWithRelationInput + sport?: Prisma.SportOrderByWithRelationInput + availabilities?: Prisma.CourtAvailabilityOrderByRelationAggregateInput + priceRules?: Prisma.CourtPriceRuleOrderByRelationAggregateInput + bookings?: Prisma.CourtBookingOrderByRelationAggregateInput +} + +export type CourtWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.CourtWhereInput | Prisma.CourtWhereInput[] + OR?: Prisma.CourtWhereInput[] + NOT?: Prisma.CourtWhereInput | Prisma.CourtWhereInput[] + complexId?: Prisma.UuidFilter<"Court"> | string + sportId?: Prisma.UuidFilter<"Court"> | string + name?: Prisma.StringFilter<"Court"> | string + slotDurationMinutes?: Prisma.IntFilter<"Court"> | number + basePrice?: Prisma.DecimalFilter<"Court"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"Court"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Court"> | Date | string + complex?: Prisma.XOR + sport?: Prisma.XOR + availabilities?: Prisma.CourtAvailabilityListRelationFilter + priceRules?: Prisma.CourtPriceRuleListRelationFilter + bookings?: Prisma.CourtBookingListRelationFilter +}, "id"> + +export type CourtOrderByWithAggregationInput = { + id?: Prisma.SortOrder + complexId?: Prisma.SortOrder + sportId?: Prisma.SortOrder + name?: Prisma.SortOrder + slotDurationMinutes?: Prisma.SortOrder + basePrice?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + _count?: Prisma.CourtCountOrderByAggregateInput + _avg?: Prisma.CourtAvgOrderByAggregateInput + _max?: Prisma.CourtMaxOrderByAggregateInput + _min?: Prisma.CourtMinOrderByAggregateInput + _sum?: Prisma.CourtSumOrderByAggregateInput +} + +export type CourtScalarWhereWithAggregatesInput = { + AND?: Prisma.CourtScalarWhereWithAggregatesInput | Prisma.CourtScalarWhereWithAggregatesInput[] + OR?: Prisma.CourtScalarWhereWithAggregatesInput[] + NOT?: Prisma.CourtScalarWhereWithAggregatesInput | Prisma.CourtScalarWhereWithAggregatesInput[] + id?: Prisma.UuidWithAggregatesFilter<"Court"> | string + complexId?: Prisma.UuidWithAggregatesFilter<"Court"> | string + sportId?: Prisma.UuidWithAggregatesFilter<"Court"> | string + name?: Prisma.StringWithAggregatesFilter<"Court"> | string + slotDurationMinutes?: Prisma.IntWithAggregatesFilter<"Court"> | number + basePrice?: Prisma.DecimalWithAggregatesFilter<"Court"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeWithAggregatesFilter<"Court"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Court"> | Date | string +} + +export type CourtCreateInput = { + id: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + complex: Prisma.ComplexCreateNestedOneWithoutCourtsInput + sport: Prisma.SportCreateNestedOneWithoutCourtsInput + availabilities?: Prisma.CourtAvailabilityCreateNestedManyWithoutCourtInput + priceRules?: Prisma.CourtPriceRuleCreateNestedManyWithoutCourtInput + bookings?: Prisma.CourtBookingCreateNestedManyWithoutCourtInput +} + +export type CourtUncheckedCreateInput = { + id: string + complexId: string + sportId: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + availabilities?: Prisma.CourtAvailabilityUncheckedCreateNestedManyWithoutCourtInput + priceRules?: Prisma.CourtPriceRuleUncheckedCreateNestedManyWithoutCourtInput + bookings?: Prisma.CourtBookingUncheckedCreateNestedManyWithoutCourtInput +} + +export type CourtUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutCourtsNestedInput + sport?: Prisma.SportUpdateOneRequiredWithoutCourtsNestedInput + availabilities?: Prisma.CourtAvailabilityUpdateManyWithoutCourtNestedInput + priceRules?: Prisma.CourtPriceRuleUpdateManyWithoutCourtNestedInput + bookings?: Prisma.CourtBookingUpdateManyWithoutCourtNestedInput +} + +export type CourtUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexId?: Prisma.StringFieldUpdateOperationsInput | string + sportId?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + availabilities?: Prisma.CourtAvailabilityUncheckedUpdateManyWithoutCourtNestedInput + priceRules?: Prisma.CourtPriceRuleUncheckedUpdateManyWithoutCourtNestedInput + bookings?: Prisma.CourtBookingUncheckedUpdateManyWithoutCourtNestedInput +} + +export type CourtCreateManyInput = { + id: string + complexId: string + sportId: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string +} + +export type CourtUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexId?: Prisma.StringFieldUpdateOperationsInput | string + sportId?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtListRelationFilter = { + every?: Prisma.CourtWhereInput + some?: Prisma.CourtWhereInput + none?: Prisma.CourtWhereInput +} + +export type CourtOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type CourtCountOrderByAggregateInput = { + id?: Prisma.SortOrder + complexId?: Prisma.SortOrder + sportId?: Prisma.SortOrder + name?: Prisma.SortOrder + slotDurationMinutes?: Prisma.SortOrder + basePrice?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type CourtAvgOrderByAggregateInput = { + slotDurationMinutes?: Prisma.SortOrder + basePrice?: Prisma.SortOrder +} + +export type CourtMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + complexId?: Prisma.SortOrder + sportId?: Prisma.SortOrder + name?: Prisma.SortOrder + slotDurationMinutes?: Prisma.SortOrder + basePrice?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type CourtMinOrderByAggregateInput = { + id?: Prisma.SortOrder + complexId?: Prisma.SortOrder + sportId?: Prisma.SortOrder + name?: Prisma.SortOrder + slotDurationMinutes?: Prisma.SortOrder + basePrice?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type CourtSumOrderByAggregateInput = { + slotDurationMinutes?: Prisma.SortOrder + basePrice?: Prisma.SortOrder +} + +export type CourtScalarRelationFilter = { + is?: Prisma.CourtWhereInput + isNot?: Prisma.CourtWhereInput +} + +export type CourtCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.CourtCreateWithoutComplexInput[] | Prisma.CourtUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutComplexInput | Prisma.CourtCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.CourtCreateManyComplexInputEnvelope + connect?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] +} + +export type CourtUncheckedCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.CourtCreateWithoutComplexInput[] | Prisma.CourtUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutComplexInput | Prisma.CourtCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.CourtCreateManyComplexInputEnvelope + connect?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] +} + +export type CourtUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.CourtCreateWithoutComplexInput[] | Prisma.CourtUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutComplexInput | Prisma.CourtCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.CourtUpsertWithWhereUniqueWithoutComplexInput | Prisma.CourtUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.CourtCreateManyComplexInputEnvelope + set?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + disconnect?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + delete?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + connect?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + update?: Prisma.CourtUpdateWithWhereUniqueWithoutComplexInput | Prisma.CourtUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.CourtUpdateManyWithWhereWithoutComplexInput | Prisma.CourtUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.CourtScalarWhereInput | Prisma.CourtScalarWhereInput[] +} + +export type CourtUncheckedUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.CourtCreateWithoutComplexInput[] | Prisma.CourtUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutComplexInput | Prisma.CourtCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.CourtUpsertWithWhereUniqueWithoutComplexInput | Prisma.CourtUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.CourtCreateManyComplexInputEnvelope + set?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + disconnect?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + delete?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + connect?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + update?: Prisma.CourtUpdateWithWhereUniqueWithoutComplexInput | Prisma.CourtUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.CourtUpdateManyWithWhereWithoutComplexInput | Prisma.CourtUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.CourtScalarWhereInput | Prisma.CourtScalarWhereInput[] +} + +export type CourtCreateNestedManyWithoutSportInput = { + create?: Prisma.XOR | Prisma.CourtCreateWithoutSportInput[] | Prisma.CourtUncheckedCreateWithoutSportInput[] + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutSportInput | Prisma.CourtCreateOrConnectWithoutSportInput[] + createMany?: Prisma.CourtCreateManySportInputEnvelope + connect?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] +} + +export type CourtUncheckedCreateNestedManyWithoutSportInput = { + create?: Prisma.XOR | Prisma.CourtCreateWithoutSportInput[] | Prisma.CourtUncheckedCreateWithoutSportInput[] + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutSportInput | Prisma.CourtCreateOrConnectWithoutSportInput[] + createMany?: Prisma.CourtCreateManySportInputEnvelope + connect?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] +} + +export type CourtUpdateManyWithoutSportNestedInput = { + create?: Prisma.XOR | Prisma.CourtCreateWithoutSportInput[] | Prisma.CourtUncheckedCreateWithoutSportInput[] + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutSportInput | Prisma.CourtCreateOrConnectWithoutSportInput[] + upsert?: Prisma.CourtUpsertWithWhereUniqueWithoutSportInput | Prisma.CourtUpsertWithWhereUniqueWithoutSportInput[] + createMany?: Prisma.CourtCreateManySportInputEnvelope + set?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + disconnect?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + delete?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + connect?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + update?: Prisma.CourtUpdateWithWhereUniqueWithoutSportInput | Prisma.CourtUpdateWithWhereUniqueWithoutSportInput[] + updateMany?: Prisma.CourtUpdateManyWithWhereWithoutSportInput | Prisma.CourtUpdateManyWithWhereWithoutSportInput[] + deleteMany?: Prisma.CourtScalarWhereInput | Prisma.CourtScalarWhereInput[] +} + +export type CourtUncheckedUpdateManyWithoutSportNestedInput = { + create?: Prisma.XOR | Prisma.CourtCreateWithoutSportInput[] | Prisma.CourtUncheckedCreateWithoutSportInput[] + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutSportInput | Prisma.CourtCreateOrConnectWithoutSportInput[] + upsert?: Prisma.CourtUpsertWithWhereUniqueWithoutSportInput | Prisma.CourtUpsertWithWhereUniqueWithoutSportInput[] + createMany?: Prisma.CourtCreateManySportInputEnvelope + set?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + disconnect?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + delete?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + connect?: Prisma.CourtWhereUniqueInput | Prisma.CourtWhereUniqueInput[] + update?: Prisma.CourtUpdateWithWhereUniqueWithoutSportInput | Prisma.CourtUpdateWithWhereUniqueWithoutSportInput[] + updateMany?: Prisma.CourtUpdateManyWithWhereWithoutSportInput | Prisma.CourtUpdateManyWithWhereWithoutSportInput[] + deleteMany?: Prisma.CourtScalarWhereInput | Prisma.CourtScalarWhereInput[] +} + +export type IntFieldUpdateOperationsInput = { + set?: number + increment?: number + decrement?: number + multiply?: number + divide?: number +} + +export type DecimalFieldUpdateOperationsInput = { + set?: runtime.Decimal | runtime.DecimalJsLike | number | string + increment?: runtime.Decimal | runtime.DecimalJsLike | number | string + decrement?: runtime.Decimal | runtime.DecimalJsLike | number | string + multiply?: runtime.Decimal | runtime.DecimalJsLike | number | string + divide?: runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type CourtCreateNestedOneWithoutAvailabilitiesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutAvailabilitiesInput + connect?: Prisma.CourtWhereUniqueInput +} + +export type CourtUpdateOneRequiredWithoutAvailabilitiesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutAvailabilitiesInput + upsert?: Prisma.CourtUpsertWithoutAvailabilitiesInput + connect?: Prisma.CourtWhereUniqueInput + update?: Prisma.XOR, Prisma.CourtUncheckedUpdateWithoutAvailabilitiesInput> +} + +export type CourtCreateNestedOneWithoutPriceRulesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutPriceRulesInput + connect?: Prisma.CourtWhereUniqueInput +} + +export type CourtUpdateOneRequiredWithoutPriceRulesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutPriceRulesInput + upsert?: Prisma.CourtUpsertWithoutPriceRulesInput + connect?: Prisma.CourtWhereUniqueInput + update?: Prisma.XOR, Prisma.CourtUncheckedUpdateWithoutPriceRulesInput> +} + +export type CourtCreateNestedOneWithoutBookingsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutBookingsInput + connect?: Prisma.CourtWhereUniqueInput +} + +export type CourtUpdateOneRequiredWithoutBookingsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CourtCreateOrConnectWithoutBookingsInput + upsert?: Prisma.CourtUpsertWithoutBookingsInput + connect?: Prisma.CourtWhereUniqueInput + update?: Prisma.XOR, Prisma.CourtUncheckedUpdateWithoutBookingsInput> +} + +export type CourtCreateWithoutComplexInput = { + id: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + sport: Prisma.SportCreateNestedOneWithoutCourtsInput + availabilities?: Prisma.CourtAvailabilityCreateNestedManyWithoutCourtInput + priceRules?: Prisma.CourtPriceRuleCreateNestedManyWithoutCourtInput + bookings?: Prisma.CourtBookingCreateNestedManyWithoutCourtInput +} + +export type CourtUncheckedCreateWithoutComplexInput = { + id: string + sportId: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + availabilities?: Prisma.CourtAvailabilityUncheckedCreateNestedManyWithoutCourtInput + priceRules?: Prisma.CourtPriceRuleUncheckedCreateNestedManyWithoutCourtInput + bookings?: Prisma.CourtBookingUncheckedCreateNestedManyWithoutCourtInput +} + +export type CourtCreateOrConnectWithoutComplexInput = { + where: Prisma.CourtWhereUniqueInput + create: Prisma.XOR +} + +export type CourtCreateManyComplexInputEnvelope = { + data: Prisma.CourtCreateManyComplexInput | Prisma.CourtCreateManyComplexInput[] + skipDuplicates?: boolean +} + +export type CourtUpsertWithWhereUniqueWithoutComplexInput = { + where: Prisma.CourtWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type CourtUpdateWithWhereUniqueWithoutComplexInput = { + where: Prisma.CourtWhereUniqueInput + data: Prisma.XOR +} + +export type CourtUpdateManyWithWhereWithoutComplexInput = { + where: Prisma.CourtScalarWhereInput + data: Prisma.XOR +} + +export type CourtScalarWhereInput = { + AND?: Prisma.CourtScalarWhereInput | Prisma.CourtScalarWhereInput[] + OR?: Prisma.CourtScalarWhereInput[] + NOT?: Prisma.CourtScalarWhereInput | Prisma.CourtScalarWhereInput[] + id?: Prisma.UuidFilter<"Court"> | string + complexId?: Prisma.UuidFilter<"Court"> | string + sportId?: Prisma.UuidFilter<"Court"> | string + name?: Prisma.StringFilter<"Court"> | string + slotDurationMinutes?: Prisma.IntFilter<"Court"> | number + basePrice?: Prisma.DecimalFilter<"Court"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"Court"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Court"> | Date | string +} + +export type CourtCreateWithoutSportInput = { + id: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + complex: Prisma.ComplexCreateNestedOneWithoutCourtsInput + availabilities?: Prisma.CourtAvailabilityCreateNestedManyWithoutCourtInput + priceRules?: Prisma.CourtPriceRuleCreateNestedManyWithoutCourtInput + bookings?: Prisma.CourtBookingCreateNestedManyWithoutCourtInput +} + +export type CourtUncheckedCreateWithoutSportInput = { + id: string + complexId: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + availabilities?: Prisma.CourtAvailabilityUncheckedCreateNestedManyWithoutCourtInput + priceRules?: Prisma.CourtPriceRuleUncheckedCreateNestedManyWithoutCourtInput + bookings?: Prisma.CourtBookingUncheckedCreateNestedManyWithoutCourtInput +} + +export type CourtCreateOrConnectWithoutSportInput = { + where: Prisma.CourtWhereUniqueInput + create: Prisma.XOR +} + +export type CourtCreateManySportInputEnvelope = { + data: Prisma.CourtCreateManySportInput | Prisma.CourtCreateManySportInput[] + skipDuplicates?: boolean +} + +export type CourtUpsertWithWhereUniqueWithoutSportInput = { + where: Prisma.CourtWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type CourtUpdateWithWhereUniqueWithoutSportInput = { + where: Prisma.CourtWhereUniqueInput + data: Prisma.XOR +} + +export type CourtUpdateManyWithWhereWithoutSportInput = { + where: Prisma.CourtScalarWhereInput + data: Prisma.XOR +} + +export type CourtCreateWithoutAvailabilitiesInput = { + id: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + complex: Prisma.ComplexCreateNestedOneWithoutCourtsInput + sport: Prisma.SportCreateNestedOneWithoutCourtsInput + priceRules?: Prisma.CourtPriceRuleCreateNestedManyWithoutCourtInput + bookings?: Prisma.CourtBookingCreateNestedManyWithoutCourtInput +} + +export type CourtUncheckedCreateWithoutAvailabilitiesInput = { + id: string + complexId: string + sportId: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + priceRules?: Prisma.CourtPriceRuleUncheckedCreateNestedManyWithoutCourtInput + bookings?: Prisma.CourtBookingUncheckedCreateNestedManyWithoutCourtInput +} + +export type CourtCreateOrConnectWithoutAvailabilitiesInput = { + where: Prisma.CourtWhereUniqueInput + create: Prisma.XOR +} + +export type CourtUpsertWithoutAvailabilitiesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.CourtWhereInput +} + +export type CourtUpdateToOneWithWhereWithoutAvailabilitiesInput = { + where?: Prisma.CourtWhereInput + data: Prisma.XOR +} + +export type CourtUpdateWithoutAvailabilitiesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutCourtsNestedInput + sport?: Prisma.SportUpdateOneRequiredWithoutCourtsNestedInput + priceRules?: Prisma.CourtPriceRuleUpdateManyWithoutCourtNestedInput + bookings?: Prisma.CourtBookingUpdateManyWithoutCourtNestedInput +} + +export type CourtUncheckedUpdateWithoutAvailabilitiesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexId?: Prisma.StringFieldUpdateOperationsInput | string + sportId?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + priceRules?: Prisma.CourtPriceRuleUncheckedUpdateManyWithoutCourtNestedInput + bookings?: Prisma.CourtBookingUncheckedUpdateManyWithoutCourtNestedInput +} + +export type CourtCreateWithoutPriceRulesInput = { + id: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + complex: Prisma.ComplexCreateNestedOneWithoutCourtsInput + sport: Prisma.SportCreateNestedOneWithoutCourtsInput + availabilities?: Prisma.CourtAvailabilityCreateNestedManyWithoutCourtInput + bookings?: Prisma.CourtBookingCreateNestedManyWithoutCourtInput +} + +export type CourtUncheckedCreateWithoutPriceRulesInput = { + id: string + complexId: string + sportId: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + availabilities?: Prisma.CourtAvailabilityUncheckedCreateNestedManyWithoutCourtInput + bookings?: Prisma.CourtBookingUncheckedCreateNestedManyWithoutCourtInput +} + +export type CourtCreateOrConnectWithoutPriceRulesInput = { + where: Prisma.CourtWhereUniqueInput + create: Prisma.XOR +} + +export type CourtUpsertWithoutPriceRulesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.CourtWhereInput +} + +export type CourtUpdateToOneWithWhereWithoutPriceRulesInput = { + where?: Prisma.CourtWhereInput + data: Prisma.XOR +} + +export type CourtUpdateWithoutPriceRulesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutCourtsNestedInput + sport?: Prisma.SportUpdateOneRequiredWithoutCourtsNestedInput + availabilities?: Prisma.CourtAvailabilityUpdateManyWithoutCourtNestedInput + bookings?: Prisma.CourtBookingUpdateManyWithoutCourtNestedInput +} + +export type CourtUncheckedUpdateWithoutPriceRulesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexId?: Prisma.StringFieldUpdateOperationsInput | string + sportId?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + availabilities?: Prisma.CourtAvailabilityUncheckedUpdateManyWithoutCourtNestedInput + bookings?: Prisma.CourtBookingUncheckedUpdateManyWithoutCourtNestedInput +} + +export type CourtCreateWithoutBookingsInput = { + id: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + complex: Prisma.ComplexCreateNestedOneWithoutCourtsInput + sport: Prisma.SportCreateNestedOneWithoutCourtsInput + availabilities?: Prisma.CourtAvailabilityCreateNestedManyWithoutCourtInput + priceRules?: Prisma.CourtPriceRuleCreateNestedManyWithoutCourtInput +} + +export type CourtUncheckedCreateWithoutBookingsInput = { + id: string + complexId: string + sportId: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + availabilities?: Prisma.CourtAvailabilityUncheckedCreateNestedManyWithoutCourtInput + priceRules?: Prisma.CourtPriceRuleUncheckedCreateNestedManyWithoutCourtInput +} + +export type CourtCreateOrConnectWithoutBookingsInput = { + where: Prisma.CourtWhereUniqueInput + create: Prisma.XOR +} + +export type CourtUpsertWithoutBookingsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.CourtWhereInput +} + +export type CourtUpdateToOneWithWhereWithoutBookingsInput = { + where?: Prisma.CourtWhereInput + data: Prisma.XOR +} + +export type CourtUpdateWithoutBookingsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutCourtsNestedInput + sport?: Prisma.SportUpdateOneRequiredWithoutCourtsNestedInput + availabilities?: Prisma.CourtAvailabilityUpdateManyWithoutCourtNestedInput + priceRules?: Prisma.CourtPriceRuleUpdateManyWithoutCourtNestedInput +} + +export type CourtUncheckedUpdateWithoutBookingsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexId?: Prisma.StringFieldUpdateOperationsInput | string + sportId?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + availabilities?: Prisma.CourtAvailabilityUncheckedUpdateManyWithoutCourtNestedInput + priceRules?: Prisma.CourtPriceRuleUncheckedUpdateManyWithoutCourtNestedInput +} + +export type CourtCreateManyComplexInput = { + id: string + sportId: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string +} + +export type CourtUpdateWithoutComplexInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + sport?: Prisma.SportUpdateOneRequiredWithoutCourtsNestedInput + availabilities?: Prisma.CourtAvailabilityUpdateManyWithoutCourtNestedInput + priceRules?: Prisma.CourtPriceRuleUpdateManyWithoutCourtNestedInput + bookings?: Prisma.CourtBookingUpdateManyWithoutCourtNestedInput +} + +export type CourtUncheckedUpdateWithoutComplexInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + sportId?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + availabilities?: Prisma.CourtAvailabilityUncheckedUpdateManyWithoutCourtNestedInput + priceRules?: Prisma.CourtPriceRuleUncheckedUpdateManyWithoutCourtNestedInput + bookings?: Prisma.CourtBookingUncheckedUpdateManyWithoutCourtNestedInput +} + +export type CourtUncheckedUpdateManyWithoutComplexInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + sportId?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtCreateManySportInput = { + id: string + complexId: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string +} + +export type CourtUpdateWithoutSportInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutCourtsNestedInput + availabilities?: Prisma.CourtAvailabilityUpdateManyWithoutCourtNestedInput + priceRules?: Prisma.CourtPriceRuleUpdateManyWithoutCourtNestedInput + bookings?: Prisma.CourtBookingUpdateManyWithoutCourtNestedInput +} + +export type CourtUncheckedUpdateWithoutSportInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexId?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + availabilities?: Prisma.CourtAvailabilityUncheckedUpdateManyWithoutCourtNestedInput + priceRules?: Prisma.CourtPriceRuleUncheckedUpdateManyWithoutCourtNestedInput + bookings?: Prisma.CourtBookingUncheckedUpdateManyWithoutCourtNestedInput +} + +export type CourtUncheckedUpdateManyWithoutSportInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + complexId?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slotDurationMinutes?: Prisma.IntFieldUpdateOperationsInput | number + basePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + +/** + * Count Type CourtCountOutputType + */ + +export type CourtCountOutputType = { + availabilities: number + priceRules: number + bookings: number +} + +export type CourtCountOutputTypeSelect = { + availabilities?: boolean | CourtCountOutputTypeCountAvailabilitiesArgs + priceRules?: boolean | CourtCountOutputTypeCountPriceRulesArgs + bookings?: boolean | CourtCountOutputTypeCountBookingsArgs +} + +/** + * CourtCountOutputType without action + */ +export type CourtCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the CourtCountOutputType + */ + select?: Prisma.CourtCountOutputTypeSelect | null +} + +/** + * CourtCountOutputType without action + */ +export type CourtCountOutputTypeCountAvailabilitiesArgs = { + where?: Prisma.CourtAvailabilityWhereInput +} + +/** + * CourtCountOutputType without action + */ +export type CourtCountOutputTypeCountPriceRulesArgs = { + where?: Prisma.CourtPriceRuleWhereInput +} + +/** + * CourtCountOutputType without action + */ +export type CourtCountOutputTypeCountBookingsArgs = { + where?: Prisma.CourtBookingWhereInput +} + + +export type CourtSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + complexId?: boolean + sportId?: boolean + name?: boolean + slotDurationMinutes?: boolean + basePrice?: boolean + createdAt?: boolean + updatedAt?: boolean + complex?: boolean | Prisma.ComplexDefaultArgs + sport?: boolean | Prisma.SportDefaultArgs + availabilities?: boolean | Prisma.Court$availabilitiesArgs + priceRules?: boolean | Prisma.Court$priceRulesArgs + bookings?: boolean | Prisma.Court$bookingsArgs + _count?: boolean | Prisma.CourtCountOutputTypeDefaultArgs +}, ExtArgs["result"]["court"]> + +export type CourtSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + complexId?: boolean + sportId?: boolean + name?: boolean + slotDurationMinutes?: boolean + basePrice?: boolean + createdAt?: boolean + updatedAt?: boolean + complex?: boolean | Prisma.ComplexDefaultArgs + sport?: boolean | Prisma.SportDefaultArgs +}, ExtArgs["result"]["court"]> + +export type CourtSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + complexId?: boolean + sportId?: boolean + name?: boolean + slotDurationMinutes?: boolean + basePrice?: boolean + createdAt?: boolean + updatedAt?: boolean + complex?: boolean | Prisma.ComplexDefaultArgs + sport?: boolean | Prisma.SportDefaultArgs +}, ExtArgs["result"]["court"]> + +export type CourtSelectScalar = { + id?: boolean + complexId?: boolean + sportId?: boolean + name?: boolean + slotDurationMinutes?: boolean + basePrice?: boolean + createdAt?: boolean + updatedAt?: boolean +} + +export type CourtOmit = runtime.Types.Extensions.GetOmit<"id" | "complexId" | "sportId" | "name" | "slotDurationMinutes" | "basePrice" | "createdAt" | "updatedAt", ExtArgs["result"]["court"]> +export type CourtInclude = { + complex?: boolean | Prisma.ComplexDefaultArgs + sport?: boolean | Prisma.SportDefaultArgs + availabilities?: boolean | Prisma.Court$availabilitiesArgs + priceRules?: boolean | Prisma.Court$priceRulesArgs + bookings?: boolean | Prisma.Court$bookingsArgs + _count?: boolean | Prisma.CourtCountOutputTypeDefaultArgs +} +export type CourtIncludeCreateManyAndReturn = { + complex?: boolean | Prisma.ComplexDefaultArgs + sport?: boolean | Prisma.SportDefaultArgs +} +export type CourtIncludeUpdateManyAndReturn = { + complex?: boolean | Prisma.ComplexDefaultArgs + sport?: boolean | Prisma.SportDefaultArgs +} + +export type $CourtPayload = { + name: "Court" + objects: { + complex: Prisma.$ComplexPayload + sport: Prisma.$SportPayload + availabilities: Prisma.$CourtAvailabilityPayload[] + priceRules: Prisma.$CourtPriceRulePayload[] + bookings: Prisma.$CourtBookingPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + complexId: string + sportId: string + name: string + slotDurationMinutes: number + basePrice: runtime.Decimal + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["court"]> + composites: {} +} + +export type CourtGetPayload = runtime.Types.Result.GetResult + +export type CourtCountArgs = + Omit & { + select?: CourtCountAggregateInputType | true + } + +export interface CourtDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Court'], meta: { name: 'Court' } } + /** + * Find zero or one Court that matches the filter. + * @param {CourtFindUniqueArgs} args - Arguments to find a Court + * @example + * // Get one Court + * const court = await prisma.court.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__CourtClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Court that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {CourtFindUniqueOrThrowArgs} args - Arguments to find a Court + * @example + * // Get one Court + * const court = await prisma.court.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__CourtClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Court 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 {CourtFindFirstArgs} args - Arguments to find a Court + * @example + * // Get one Court + * const court = await prisma.court.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__CourtClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Court 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 {CourtFindFirstOrThrowArgs} args - Arguments to find a Court + * @example + * // Get one Court + * const court = await prisma.court.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__CourtClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Courts 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 {CourtFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Courts + * const courts = await prisma.court.findMany() + * + * // Get first 10 Courts + * const courts = await prisma.court.findMany({ take: 10 }) + * + * // Only select the `id` + * const courtWithIdOnly = await prisma.court.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Court. + * @param {CourtCreateArgs} args - Arguments to create a Court. + * @example + * // Create one Court + * const Court = await prisma.court.create({ + * data: { + * // ... data to create a Court + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__CourtClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Courts. + * @param {CourtCreateManyArgs} args - Arguments to create many Courts. + * @example + * // Create many Courts + * const court = await prisma.court.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Courts and returns the data saved in the database. + * @param {CourtCreateManyAndReturnArgs} args - Arguments to create many Courts. + * @example + * // Create many Courts + * const court = await prisma.court.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Courts and only return the `id` + * const courtWithIdOnly = await prisma.court.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 Court. + * @param {CourtDeleteArgs} args - Arguments to delete one Court. + * @example + * // Delete one Court + * const Court = await prisma.court.delete({ + * where: { + * // ... filter to delete one Court + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__CourtClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Court. + * @param {CourtUpdateArgs} args - Arguments to update one Court. + * @example + * // Update one Court + * const court = await prisma.court.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__CourtClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Courts. + * @param {CourtDeleteManyArgs} args - Arguments to filter Courts to delete. + * @example + * // Delete a few Courts + * const { count } = await prisma.court.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Courts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Courts + * const court = await prisma.court.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Courts and returns the data updated in the database. + * @param {CourtUpdateManyAndReturnArgs} args - Arguments to update many Courts. + * @example + * // Update many Courts + * const court = await prisma.court.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Courts and only return the `id` + * const courtWithIdOnly = await prisma.court.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 Court. + * @param {CourtUpsertArgs} args - Arguments to update or create a Court. + * @example + * // Update or create a Court + * const court = await prisma.court.upsert({ + * create: { + * // ... data to create a Court + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Court we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__CourtClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Courts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtCountArgs} args - Arguments to filter Courts to count. + * @example + * // Count the number of Courts + * const count = await prisma.court.count({ + * where: { + * // ... the filter for the Courts 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 Court. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtAggregateArgs} 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 Court. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtGroupByArgs} 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 CourtGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: CourtGroupByArgs['orderBy'] } + : { orderBy?: CourtGroupByArgs['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 ? GetCourtGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Court model + */ +readonly fields: CourtFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Court. + * 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__CourtClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + complex = {}>(args?: Prisma.Subset>): Prisma.Prisma__ComplexClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + sport = {}>(args?: Prisma.Subset>): Prisma.Prisma__SportClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + availabilities = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + priceRules = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + bookings = {}>(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 Court model + */ +export interface CourtFieldRefs { + readonly id: Prisma.FieldRef<"Court", 'String'> + readonly complexId: Prisma.FieldRef<"Court", 'String'> + readonly sportId: Prisma.FieldRef<"Court", 'String'> + readonly name: Prisma.FieldRef<"Court", 'String'> + readonly slotDurationMinutes: Prisma.FieldRef<"Court", 'Int'> + readonly basePrice: Prisma.FieldRef<"Court", 'Decimal'> + readonly createdAt: Prisma.FieldRef<"Court", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"Court", 'DateTime'> +} + + +// Custom InputTypes +/** + * Court findUnique + */ +export type CourtFindUniqueArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelect | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtInclude | null + /** + * Filter, which Court to fetch. + */ + where: Prisma.CourtWhereUniqueInput +} + +/** + * Court findUniqueOrThrow + */ +export type CourtFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelect | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtInclude | null + /** + * Filter, which Court to fetch. + */ + where: Prisma.CourtWhereUniqueInput +} + +/** + * Court findFirst + */ +export type CourtFindFirstArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelect | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtInclude | null + /** + * Filter, which Court to fetch. + */ + where?: Prisma.CourtWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Courts to fetch. + */ + orderBy?: Prisma.CourtOrderByWithRelationInput | Prisma.CourtOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Courts. + */ + cursor?: Prisma.CourtWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Courts 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` Courts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Courts. + */ + distinct?: Prisma.CourtScalarFieldEnum | Prisma.CourtScalarFieldEnum[] +} + +/** + * Court findFirstOrThrow + */ +export type CourtFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelect | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtInclude | null + /** + * Filter, which Court to fetch. + */ + where?: Prisma.CourtWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Courts to fetch. + */ + orderBy?: Prisma.CourtOrderByWithRelationInput | Prisma.CourtOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Courts. + */ + cursor?: Prisma.CourtWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Courts 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` Courts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Courts. + */ + distinct?: Prisma.CourtScalarFieldEnum | Prisma.CourtScalarFieldEnum[] +} + +/** + * Court findMany + */ +export type CourtFindManyArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelect | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtInclude | null + /** + * Filter, which Courts to fetch. + */ + where?: Prisma.CourtWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Courts to fetch. + */ + orderBy?: Prisma.CourtOrderByWithRelationInput | Prisma.CourtOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Courts. + */ + cursor?: Prisma.CourtWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Courts 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` Courts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Courts. + */ + distinct?: Prisma.CourtScalarFieldEnum | Prisma.CourtScalarFieldEnum[] +} + +/** + * Court create + */ +export type CourtCreateArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelect | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtInclude | null + /** + * The data needed to create a Court. + */ + data: Prisma.XOR +} + +/** + * Court createMany + */ +export type CourtCreateManyArgs = { + /** + * The data used to create many Courts. + */ + data: Prisma.CourtCreateManyInput | Prisma.CourtCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Court createManyAndReturn + */ +export type CourtCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * The data used to create many Courts. + */ + data: Prisma.CourtCreateManyInput | Prisma.CourtCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtIncludeCreateManyAndReturn | null +} + +/** + * Court update + */ +export type CourtUpdateArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelect | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtInclude | null + /** + * The data needed to update a Court. + */ + data: Prisma.XOR + /** + * Choose, which Court to update. + */ + where: Prisma.CourtWhereUniqueInput +} + +/** + * Court updateMany + */ +export type CourtUpdateManyArgs = { + /** + * The data used to update Courts. + */ + data: Prisma.XOR + /** + * Filter which Courts to update + */ + where?: Prisma.CourtWhereInput + /** + * Limit how many Courts to update. + */ + limit?: number +} + +/** + * Court updateManyAndReturn + */ +export type CourtUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * The data used to update Courts. + */ + data: Prisma.XOR + /** + * Filter which Courts to update + */ + where?: Prisma.CourtWhereInput + /** + * Limit how many Courts to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtIncludeUpdateManyAndReturn | null +} + +/** + * Court upsert + */ +export type CourtUpsertArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelect | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtInclude | null + /** + * The filter to search for the Court to update in case it exists. + */ + where: Prisma.CourtWhereUniqueInput + /** + * In case the Court found by the `where` argument doesn't exist, create a new Court with this data. + */ + create: Prisma.XOR + /** + * In case the Court was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Court delete + */ +export type CourtDeleteArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelect | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtInclude | null + /** + * Filter which Court to delete. + */ + where: Prisma.CourtWhereUniqueInput +} + +/** + * Court deleteMany + */ +export type CourtDeleteManyArgs = { + /** + * Filter which Courts to delete + */ + where?: Prisma.CourtWhereInput + /** + * Limit how many Courts to delete. + */ + limit?: number +} + +/** + * Court.availabilities + */ +export type Court$availabilitiesArgs = { + /** + * Select specific fields to fetch from the CourtAvailability + */ + select?: Prisma.CourtAvailabilitySelect | null + /** + * Omit specific fields from the CourtAvailability + */ + omit?: Prisma.CourtAvailabilityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtAvailabilityInclude | null + where?: Prisma.CourtAvailabilityWhereInput + orderBy?: Prisma.CourtAvailabilityOrderByWithRelationInput | Prisma.CourtAvailabilityOrderByWithRelationInput[] + cursor?: Prisma.CourtAvailabilityWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.CourtAvailabilityScalarFieldEnum | Prisma.CourtAvailabilityScalarFieldEnum[] +} + +/** + * Court.priceRules + */ +export type Court$priceRulesArgs = { + /** + * Select specific fields to fetch from the CourtPriceRule + */ + select?: Prisma.CourtPriceRuleSelect | null + /** + * Omit specific fields from the CourtPriceRule + */ + omit?: Prisma.CourtPriceRuleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtPriceRuleInclude | null + where?: Prisma.CourtPriceRuleWhereInput + orderBy?: Prisma.CourtPriceRuleOrderByWithRelationInput | Prisma.CourtPriceRuleOrderByWithRelationInput[] + cursor?: Prisma.CourtPriceRuleWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.CourtPriceRuleScalarFieldEnum | Prisma.CourtPriceRuleScalarFieldEnum[] +} + +/** + * Court.bookings + */ +export type Court$bookingsArgs = { + /** + * Select specific fields to fetch from the CourtBooking + */ + select?: Prisma.CourtBookingSelect | null + /** + * Omit specific fields from the CourtBooking + */ + omit?: Prisma.CourtBookingOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtBookingInclude | null + where?: Prisma.CourtBookingWhereInput + orderBy?: Prisma.CourtBookingOrderByWithRelationInput | Prisma.CourtBookingOrderByWithRelationInput[] + cursor?: Prisma.CourtBookingWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.CourtBookingScalarFieldEnum | Prisma.CourtBookingScalarFieldEnum[] +} + +/** + * Court without action + */ +export type CourtDefaultArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelect | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtInclude | null +} diff --git a/apps/backend/src/generated/prisma/models/CourtAvailability.ts b/apps/backend/src/generated/prisma/models/CourtAvailability.ts new file mode 100644 index 0000000..6f0a65e --- /dev/null +++ b/apps/backend/src/generated/prisma/models/CourtAvailability.ts @@ -0,0 +1,1384 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `CourtAvailability` 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" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model CourtAvailability + * + */ +export type CourtAvailabilityModel = runtime.Types.Result.DefaultSelection + +export type AggregateCourtAvailability = { + _count: CourtAvailabilityCountAggregateOutputType | null + _min: CourtAvailabilityMinAggregateOutputType | null + _max: CourtAvailabilityMaxAggregateOutputType | null +} + +export type CourtAvailabilityMinAggregateOutputType = { + id: string | null + courtId: string | null + dayOfWeek: $Enums.DayOfWeek | null + startTime: string | null + endTime: string | null + createdAt: Date | null +} + +export type CourtAvailabilityMaxAggregateOutputType = { + id: string | null + courtId: string | null + dayOfWeek: $Enums.DayOfWeek | null + startTime: string | null + endTime: string | null + createdAt: Date | null +} + +export type CourtAvailabilityCountAggregateOutputType = { + id: number + courtId: number + dayOfWeek: number + startTime: number + endTime: number + createdAt: number + _all: number +} + + +export type CourtAvailabilityMinAggregateInputType = { + id?: true + courtId?: true + dayOfWeek?: true + startTime?: true + endTime?: true + createdAt?: true +} + +export type CourtAvailabilityMaxAggregateInputType = { + id?: true + courtId?: true + dayOfWeek?: true + startTime?: true + endTime?: true + createdAt?: true +} + +export type CourtAvailabilityCountAggregateInputType = { + id?: true + courtId?: true + dayOfWeek?: true + startTime?: true + endTime?: true + createdAt?: true + _all?: true +} + +export type CourtAvailabilityAggregateArgs = { + /** + * Filter which CourtAvailability to aggregate. + */ + where?: Prisma.CourtAvailabilityWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CourtAvailabilities to fetch. + */ + orderBy?: Prisma.CourtAvailabilityOrderByWithRelationInput | Prisma.CourtAvailabilityOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.CourtAvailabilityWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CourtAvailabilities 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` CourtAvailabilities. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned CourtAvailabilities + **/ + _count?: true | CourtAvailabilityCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: CourtAvailabilityMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: CourtAvailabilityMaxAggregateInputType +} + +export type GetCourtAvailabilityAggregateType = { + [P in keyof T & keyof AggregateCourtAvailability]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type CourtAvailabilityGroupByArgs = { + where?: Prisma.CourtAvailabilityWhereInput + orderBy?: Prisma.CourtAvailabilityOrderByWithAggregationInput | Prisma.CourtAvailabilityOrderByWithAggregationInput[] + by: Prisma.CourtAvailabilityScalarFieldEnum[] | Prisma.CourtAvailabilityScalarFieldEnum + having?: Prisma.CourtAvailabilityScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: CourtAvailabilityCountAggregateInputType | true + _min?: CourtAvailabilityMinAggregateInputType + _max?: CourtAvailabilityMaxAggregateInputType +} + +export type CourtAvailabilityGroupByOutputType = { + id: string + courtId: string + dayOfWeek: $Enums.DayOfWeek + startTime: string + endTime: string + createdAt: Date + _count: CourtAvailabilityCountAggregateOutputType | null + _min: CourtAvailabilityMinAggregateOutputType | null + _max: CourtAvailabilityMaxAggregateOutputType | null +} + +export type GetCourtAvailabilityGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof CourtAvailabilityGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type CourtAvailabilityWhereInput = { + AND?: Prisma.CourtAvailabilityWhereInput | Prisma.CourtAvailabilityWhereInput[] + OR?: Prisma.CourtAvailabilityWhereInput[] + NOT?: Prisma.CourtAvailabilityWhereInput | Prisma.CourtAvailabilityWhereInput[] + id?: Prisma.UuidFilter<"CourtAvailability"> | string + courtId?: Prisma.UuidFilter<"CourtAvailability"> | string + dayOfWeek?: Prisma.EnumDayOfWeekFilter<"CourtAvailability"> | $Enums.DayOfWeek + startTime?: Prisma.StringFilter<"CourtAvailability"> | string + endTime?: Prisma.StringFilter<"CourtAvailability"> | string + createdAt?: Prisma.DateTimeFilter<"CourtAvailability"> | Date | string + court?: Prisma.XOR +} + +export type CourtAvailabilityOrderByWithRelationInput = { + id?: Prisma.SortOrder + courtId?: Prisma.SortOrder + dayOfWeek?: Prisma.SortOrder + startTime?: Prisma.SortOrder + endTime?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + court?: Prisma.CourtOrderByWithRelationInput +} + +export type CourtAvailabilityWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.CourtAvailabilityWhereInput | Prisma.CourtAvailabilityWhereInput[] + OR?: Prisma.CourtAvailabilityWhereInput[] + NOT?: Prisma.CourtAvailabilityWhereInput | Prisma.CourtAvailabilityWhereInput[] + courtId?: Prisma.UuidFilter<"CourtAvailability"> | string + dayOfWeek?: Prisma.EnumDayOfWeekFilter<"CourtAvailability"> | $Enums.DayOfWeek + startTime?: Prisma.StringFilter<"CourtAvailability"> | string + endTime?: Prisma.StringFilter<"CourtAvailability"> | string + createdAt?: Prisma.DateTimeFilter<"CourtAvailability"> | Date | string + court?: Prisma.XOR +}, "id"> + +export type CourtAvailabilityOrderByWithAggregationInput = { + id?: Prisma.SortOrder + courtId?: Prisma.SortOrder + dayOfWeek?: Prisma.SortOrder + startTime?: Prisma.SortOrder + endTime?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + _count?: Prisma.CourtAvailabilityCountOrderByAggregateInput + _max?: Prisma.CourtAvailabilityMaxOrderByAggregateInput + _min?: Prisma.CourtAvailabilityMinOrderByAggregateInput +} + +export type CourtAvailabilityScalarWhereWithAggregatesInput = { + AND?: Prisma.CourtAvailabilityScalarWhereWithAggregatesInput | Prisma.CourtAvailabilityScalarWhereWithAggregatesInput[] + OR?: Prisma.CourtAvailabilityScalarWhereWithAggregatesInput[] + NOT?: Prisma.CourtAvailabilityScalarWhereWithAggregatesInput | Prisma.CourtAvailabilityScalarWhereWithAggregatesInput[] + id?: Prisma.UuidWithAggregatesFilter<"CourtAvailability"> | string + courtId?: Prisma.UuidWithAggregatesFilter<"CourtAvailability"> | string + dayOfWeek?: Prisma.EnumDayOfWeekWithAggregatesFilter<"CourtAvailability"> | $Enums.DayOfWeek + startTime?: Prisma.StringWithAggregatesFilter<"CourtAvailability"> | string + endTime?: Prisma.StringWithAggregatesFilter<"CourtAvailability"> | string + createdAt?: Prisma.DateTimeWithAggregatesFilter<"CourtAvailability"> | Date | string +} + +export type CourtAvailabilityCreateInput = { + id: string + dayOfWeek: $Enums.DayOfWeek + startTime: string + endTime: string + createdAt?: Date | string + court: Prisma.CourtCreateNestedOneWithoutAvailabilitiesInput +} + +export type CourtAvailabilityUncheckedCreateInput = { + id: string + courtId: string + dayOfWeek: $Enums.DayOfWeek + startTime: string + endTime: string + createdAt?: Date | string +} + +export type CourtAvailabilityUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.EnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + court?: Prisma.CourtUpdateOneRequiredWithoutAvailabilitiesNestedInput +} + +export type CourtAvailabilityUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + courtId?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.EnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtAvailabilityCreateManyInput = { + id: string + courtId: string + dayOfWeek: $Enums.DayOfWeek + startTime: string + endTime: string + createdAt?: Date | string +} + +export type CourtAvailabilityUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.EnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtAvailabilityUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + courtId?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.EnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtAvailabilityListRelationFilter = { + every?: Prisma.CourtAvailabilityWhereInput + some?: Prisma.CourtAvailabilityWhereInput + none?: Prisma.CourtAvailabilityWhereInput +} + +export type CourtAvailabilityOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type CourtAvailabilityCountOrderByAggregateInput = { + id?: Prisma.SortOrder + courtId?: Prisma.SortOrder + dayOfWeek?: Prisma.SortOrder + startTime?: Prisma.SortOrder + endTime?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type CourtAvailabilityMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + courtId?: Prisma.SortOrder + dayOfWeek?: Prisma.SortOrder + startTime?: Prisma.SortOrder + endTime?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type CourtAvailabilityMinOrderByAggregateInput = { + id?: Prisma.SortOrder + courtId?: Prisma.SortOrder + dayOfWeek?: Prisma.SortOrder + startTime?: Prisma.SortOrder + endTime?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type CourtAvailabilityCreateNestedManyWithoutCourtInput = { + create?: Prisma.XOR | Prisma.CourtAvailabilityCreateWithoutCourtInput[] | Prisma.CourtAvailabilityUncheckedCreateWithoutCourtInput[] + connectOrCreate?: Prisma.CourtAvailabilityCreateOrConnectWithoutCourtInput | Prisma.CourtAvailabilityCreateOrConnectWithoutCourtInput[] + createMany?: Prisma.CourtAvailabilityCreateManyCourtInputEnvelope + connect?: Prisma.CourtAvailabilityWhereUniqueInput | Prisma.CourtAvailabilityWhereUniqueInput[] +} + +export type CourtAvailabilityUncheckedCreateNestedManyWithoutCourtInput = { + create?: Prisma.XOR | Prisma.CourtAvailabilityCreateWithoutCourtInput[] | Prisma.CourtAvailabilityUncheckedCreateWithoutCourtInput[] + connectOrCreate?: Prisma.CourtAvailabilityCreateOrConnectWithoutCourtInput | Prisma.CourtAvailabilityCreateOrConnectWithoutCourtInput[] + createMany?: Prisma.CourtAvailabilityCreateManyCourtInputEnvelope + connect?: Prisma.CourtAvailabilityWhereUniqueInput | Prisma.CourtAvailabilityWhereUniqueInput[] +} + +export type CourtAvailabilityUpdateManyWithoutCourtNestedInput = { + create?: Prisma.XOR | Prisma.CourtAvailabilityCreateWithoutCourtInput[] | Prisma.CourtAvailabilityUncheckedCreateWithoutCourtInput[] + connectOrCreate?: Prisma.CourtAvailabilityCreateOrConnectWithoutCourtInput | Prisma.CourtAvailabilityCreateOrConnectWithoutCourtInput[] + upsert?: Prisma.CourtAvailabilityUpsertWithWhereUniqueWithoutCourtInput | Prisma.CourtAvailabilityUpsertWithWhereUniqueWithoutCourtInput[] + createMany?: Prisma.CourtAvailabilityCreateManyCourtInputEnvelope + set?: Prisma.CourtAvailabilityWhereUniqueInput | Prisma.CourtAvailabilityWhereUniqueInput[] + disconnect?: Prisma.CourtAvailabilityWhereUniqueInput | Prisma.CourtAvailabilityWhereUniqueInput[] + delete?: Prisma.CourtAvailabilityWhereUniqueInput | Prisma.CourtAvailabilityWhereUniqueInput[] + connect?: Prisma.CourtAvailabilityWhereUniqueInput | Prisma.CourtAvailabilityWhereUniqueInput[] + update?: Prisma.CourtAvailabilityUpdateWithWhereUniqueWithoutCourtInput | Prisma.CourtAvailabilityUpdateWithWhereUniqueWithoutCourtInput[] + updateMany?: Prisma.CourtAvailabilityUpdateManyWithWhereWithoutCourtInput | Prisma.CourtAvailabilityUpdateManyWithWhereWithoutCourtInput[] + deleteMany?: Prisma.CourtAvailabilityScalarWhereInput | Prisma.CourtAvailabilityScalarWhereInput[] +} + +export type CourtAvailabilityUncheckedUpdateManyWithoutCourtNestedInput = { + create?: Prisma.XOR | Prisma.CourtAvailabilityCreateWithoutCourtInput[] | Prisma.CourtAvailabilityUncheckedCreateWithoutCourtInput[] + connectOrCreate?: Prisma.CourtAvailabilityCreateOrConnectWithoutCourtInput | Prisma.CourtAvailabilityCreateOrConnectWithoutCourtInput[] + upsert?: Prisma.CourtAvailabilityUpsertWithWhereUniqueWithoutCourtInput | Prisma.CourtAvailabilityUpsertWithWhereUniqueWithoutCourtInput[] + createMany?: Prisma.CourtAvailabilityCreateManyCourtInputEnvelope + set?: Prisma.CourtAvailabilityWhereUniqueInput | Prisma.CourtAvailabilityWhereUniqueInput[] + disconnect?: Prisma.CourtAvailabilityWhereUniqueInput | Prisma.CourtAvailabilityWhereUniqueInput[] + delete?: Prisma.CourtAvailabilityWhereUniqueInput | Prisma.CourtAvailabilityWhereUniqueInput[] + connect?: Prisma.CourtAvailabilityWhereUniqueInput | Prisma.CourtAvailabilityWhereUniqueInput[] + update?: Prisma.CourtAvailabilityUpdateWithWhereUniqueWithoutCourtInput | Prisma.CourtAvailabilityUpdateWithWhereUniqueWithoutCourtInput[] + updateMany?: Prisma.CourtAvailabilityUpdateManyWithWhereWithoutCourtInput | Prisma.CourtAvailabilityUpdateManyWithWhereWithoutCourtInput[] + deleteMany?: Prisma.CourtAvailabilityScalarWhereInput | Prisma.CourtAvailabilityScalarWhereInput[] +} + +export type EnumDayOfWeekFieldUpdateOperationsInput = { + set?: $Enums.DayOfWeek +} + +export type CourtAvailabilityCreateWithoutCourtInput = { + id: string + dayOfWeek: $Enums.DayOfWeek + startTime: string + endTime: string + createdAt?: Date | string +} + +export type CourtAvailabilityUncheckedCreateWithoutCourtInput = { + id: string + dayOfWeek: $Enums.DayOfWeek + startTime: string + endTime: string + createdAt?: Date | string +} + +export type CourtAvailabilityCreateOrConnectWithoutCourtInput = { + where: Prisma.CourtAvailabilityWhereUniqueInput + create: Prisma.XOR +} + +export type CourtAvailabilityCreateManyCourtInputEnvelope = { + data: Prisma.CourtAvailabilityCreateManyCourtInput | Prisma.CourtAvailabilityCreateManyCourtInput[] + skipDuplicates?: boolean +} + +export type CourtAvailabilityUpsertWithWhereUniqueWithoutCourtInput = { + where: Prisma.CourtAvailabilityWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type CourtAvailabilityUpdateWithWhereUniqueWithoutCourtInput = { + where: Prisma.CourtAvailabilityWhereUniqueInput + data: Prisma.XOR +} + +export type CourtAvailabilityUpdateManyWithWhereWithoutCourtInput = { + where: Prisma.CourtAvailabilityScalarWhereInput + data: Prisma.XOR +} + +export type CourtAvailabilityScalarWhereInput = { + AND?: Prisma.CourtAvailabilityScalarWhereInput | Prisma.CourtAvailabilityScalarWhereInput[] + OR?: Prisma.CourtAvailabilityScalarWhereInput[] + NOT?: Prisma.CourtAvailabilityScalarWhereInput | Prisma.CourtAvailabilityScalarWhereInput[] + id?: Prisma.UuidFilter<"CourtAvailability"> | string + courtId?: Prisma.UuidFilter<"CourtAvailability"> | string + dayOfWeek?: Prisma.EnumDayOfWeekFilter<"CourtAvailability"> | $Enums.DayOfWeek + startTime?: Prisma.StringFilter<"CourtAvailability"> | string + endTime?: Prisma.StringFilter<"CourtAvailability"> | string + createdAt?: Prisma.DateTimeFilter<"CourtAvailability"> | Date | string +} + +export type CourtAvailabilityCreateManyCourtInput = { + id: string + dayOfWeek: $Enums.DayOfWeek + startTime: string + endTime: string + createdAt?: Date | string +} + +export type CourtAvailabilityUpdateWithoutCourtInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.EnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtAvailabilityUncheckedUpdateWithoutCourtInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.EnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtAvailabilityUncheckedUpdateManyWithoutCourtInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.EnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + + +export type CourtAvailabilitySelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + courtId?: boolean + dayOfWeek?: boolean + startTime?: boolean + endTime?: boolean + createdAt?: boolean + court?: boolean | Prisma.CourtDefaultArgs +}, ExtArgs["result"]["courtAvailability"]> + +export type CourtAvailabilitySelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + courtId?: boolean + dayOfWeek?: boolean + startTime?: boolean + endTime?: boolean + createdAt?: boolean + court?: boolean | Prisma.CourtDefaultArgs +}, ExtArgs["result"]["courtAvailability"]> + +export type CourtAvailabilitySelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + courtId?: boolean + dayOfWeek?: boolean + startTime?: boolean + endTime?: boolean + createdAt?: boolean + court?: boolean | Prisma.CourtDefaultArgs +}, ExtArgs["result"]["courtAvailability"]> + +export type CourtAvailabilitySelectScalar = { + id?: boolean + courtId?: boolean + dayOfWeek?: boolean + startTime?: boolean + endTime?: boolean + createdAt?: boolean +} + +export type CourtAvailabilityOmit = runtime.Types.Extensions.GetOmit<"id" | "courtId" | "dayOfWeek" | "startTime" | "endTime" | "createdAt", ExtArgs["result"]["courtAvailability"]> +export type CourtAvailabilityInclude = { + court?: boolean | Prisma.CourtDefaultArgs +} +export type CourtAvailabilityIncludeCreateManyAndReturn = { + court?: boolean | Prisma.CourtDefaultArgs +} +export type CourtAvailabilityIncludeUpdateManyAndReturn = { + court?: boolean | Prisma.CourtDefaultArgs +} + +export type $CourtAvailabilityPayload = { + name: "CourtAvailability" + objects: { + court: Prisma.$CourtPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + courtId: string + dayOfWeek: $Enums.DayOfWeek + startTime: string + endTime: string + createdAt: Date + }, ExtArgs["result"]["courtAvailability"]> + composites: {} +} + +export type CourtAvailabilityGetPayload = runtime.Types.Result.GetResult + +export type CourtAvailabilityCountArgs = + Omit & { + select?: CourtAvailabilityCountAggregateInputType | true + } + +export interface CourtAvailabilityDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['CourtAvailability'], meta: { name: 'CourtAvailability' } } + /** + * Find zero or one CourtAvailability that matches the filter. + * @param {CourtAvailabilityFindUniqueArgs} args - Arguments to find a CourtAvailability + * @example + * // Get one CourtAvailability + * const courtAvailability = await prisma.courtAvailability.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__CourtAvailabilityClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one CourtAvailability that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {CourtAvailabilityFindUniqueOrThrowArgs} args - Arguments to find a CourtAvailability + * @example + * // Get one CourtAvailability + * const courtAvailability = await prisma.courtAvailability.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__CourtAvailabilityClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first CourtAvailability 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 {CourtAvailabilityFindFirstArgs} args - Arguments to find a CourtAvailability + * @example + * // Get one CourtAvailability + * const courtAvailability = await prisma.courtAvailability.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__CourtAvailabilityClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first CourtAvailability 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 {CourtAvailabilityFindFirstOrThrowArgs} args - Arguments to find a CourtAvailability + * @example + * // Get one CourtAvailability + * const courtAvailability = await prisma.courtAvailability.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__CourtAvailabilityClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more CourtAvailabilities 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 {CourtAvailabilityFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all CourtAvailabilities + * const courtAvailabilities = await prisma.courtAvailability.findMany() + * + * // Get first 10 CourtAvailabilities + * const courtAvailabilities = await prisma.courtAvailability.findMany({ take: 10 }) + * + * // Only select the `id` + * const courtAvailabilityWithIdOnly = await prisma.courtAvailability.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a CourtAvailability. + * @param {CourtAvailabilityCreateArgs} args - Arguments to create a CourtAvailability. + * @example + * // Create one CourtAvailability + * const CourtAvailability = await prisma.courtAvailability.create({ + * data: { + * // ... data to create a CourtAvailability + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__CourtAvailabilityClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many CourtAvailabilities. + * @param {CourtAvailabilityCreateManyArgs} args - Arguments to create many CourtAvailabilities. + * @example + * // Create many CourtAvailabilities + * const courtAvailability = await prisma.courtAvailability.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many CourtAvailabilities and returns the data saved in the database. + * @param {CourtAvailabilityCreateManyAndReturnArgs} args - Arguments to create many CourtAvailabilities. + * @example + * // Create many CourtAvailabilities + * const courtAvailability = await prisma.courtAvailability.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many CourtAvailabilities and only return the `id` + * const courtAvailabilityWithIdOnly = await prisma.courtAvailability.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 CourtAvailability. + * @param {CourtAvailabilityDeleteArgs} args - Arguments to delete one CourtAvailability. + * @example + * // Delete one CourtAvailability + * const CourtAvailability = await prisma.courtAvailability.delete({ + * where: { + * // ... filter to delete one CourtAvailability + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__CourtAvailabilityClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one CourtAvailability. + * @param {CourtAvailabilityUpdateArgs} args - Arguments to update one CourtAvailability. + * @example + * // Update one CourtAvailability + * const courtAvailability = await prisma.courtAvailability.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__CourtAvailabilityClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more CourtAvailabilities. + * @param {CourtAvailabilityDeleteManyArgs} args - Arguments to filter CourtAvailabilities to delete. + * @example + * // Delete a few CourtAvailabilities + * const { count } = await prisma.courtAvailability.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more CourtAvailabilities. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtAvailabilityUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many CourtAvailabilities + * const courtAvailability = await prisma.courtAvailability.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more CourtAvailabilities and returns the data updated in the database. + * @param {CourtAvailabilityUpdateManyAndReturnArgs} args - Arguments to update many CourtAvailabilities. + * @example + * // Update many CourtAvailabilities + * const courtAvailability = await prisma.courtAvailability.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more CourtAvailabilities and only return the `id` + * const courtAvailabilityWithIdOnly = await prisma.courtAvailability.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 CourtAvailability. + * @param {CourtAvailabilityUpsertArgs} args - Arguments to update or create a CourtAvailability. + * @example + * // Update or create a CourtAvailability + * const courtAvailability = await prisma.courtAvailability.upsert({ + * create: { + * // ... data to create a CourtAvailability + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the CourtAvailability we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__CourtAvailabilityClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of CourtAvailabilities. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtAvailabilityCountArgs} args - Arguments to filter CourtAvailabilities to count. + * @example + * // Count the number of CourtAvailabilities + * const count = await prisma.courtAvailability.count({ + * where: { + * // ... the filter for the CourtAvailabilities 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 CourtAvailability. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtAvailabilityAggregateArgs} 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 CourtAvailability. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtAvailabilityGroupByArgs} 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 CourtAvailabilityGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: CourtAvailabilityGroupByArgs['orderBy'] } + : { orderBy?: CourtAvailabilityGroupByArgs['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 ? GetCourtAvailabilityGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the CourtAvailability model + */ +readonly fields: CourtAvailabilityFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for CourtAvailability. + * 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__CourtAvailabilityClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + court = {}>(args?: Prisma.Subset>): Prisma.Prisma__CourtClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @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 CourtAvailability model + */ +export interface CourtAvailabilityFieldRefs { + readonly id: Prisma.FieldRef<"CourtAvailability", 'String'> + readonly courtId: Prisma.FieldRef<"CourtAvailability", 'String'> + readonly dayOfWeek: Prisma.FieldRef<"CourtAvailability", 'DayOfWeek'> + readonly startTime: Prisma.FieldRef<"CourtAvailability", 'String'> + readonly endTime: Prisma.FieldRef<"CourtAvailability", 'String'> + readonly createdAt: Prisma.FieldRef<"CourtAvailability", 'DateTime'> +} + + +// Custom InputTypes +/** + * CourtAvailability findUnique + */ +export type CourtAvailabilityFindUniqueArgs = { + /** + * Select specific fields to fetch from the CourtAvailability + */ + select?: Prisma.CourtAvailabilitySelect | null + /** + * Omit specific fields from the CourtAvailability + */ + omit?: Prisma.CourtAvailabilityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtAvailabilityInclude | null + /** + * Filter, which CourtAvailability to fetch. + */ + where: Prisma.CourtAvailabilityWhereUniqueInput +} + +/** + * CourtAvailability findUniqueOrThrow + */ +export type CourtAvailabilityFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the CourtAvailability + */ + select?: Prisma.CourtAvailabilitySelect | null + /** + * Omit specific fields from the CourtAvailability + */ + omit?: Prisma.CourtAvailabilityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtAvailabilityInclude | null + /** + * Filter, which CourtAvailability to fetch. + */ + where: Prisma.CourtAvailabilityWhereUniqueInput +} + +/** + * CourtAvailability findFirst + */ +export type CourtAvailabilityFindFirstArgs = { + /** + * Select specific fields to fetch from the CourtAvailability + */ + select?: Prisma.CourtAvailabilitySelect | null + /** + * Omit specific fields from the CourtAvailability + */ + omit?: Prisma.CourtAvailabilityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtAvailabilityInclude | null + /** + * Filter, which CourtAvailability to fetch. + */ + where?: Prisma.CourtAvailabilityWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CourtAvailabilities to fetch. + */ + orderBy?: Prisma.CourtAvailabilityOrderByWithRelationInput | Prisma.CourtAvailabilityOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for CourtAvailabilities. + */ + cursor?: Prisma.CourtAvailabilityWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CourtAvailabilities 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` CourtAvailabilities. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of CourtAvailabilities. + */ + distinct?: Prisma.CourtAvailabilityScalarFieldEnum | Prisma.CourtAvailabilityScalarFieldEnum[] +} + +/** + * CourtAvailability findFirstOrThrow + */ +export type CourtAvailabilityFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the CourtAvailability + */ + select?: Prisma.CourtAvailabilitySelect | null + /** + * Omit specific fields from the CourtAvailability + */ + omit?: Prisma.CourtAvailabilityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtAvailabilityInclude | null + /** + * Filter, which CourtAvailability to fetch. + */ + where?: Prisma.CourtAvailabilityWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CourtAvailabilities to fetch. + */ + orderBy?: Prisma.CourtAvailabilityOrderByWithRelationInput | Prisma.CourtAvailabilityOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for CourtAvailabilities. + */ + cursor?: Prisma.CourtAvailabilityWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CourtAvailabilities 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` CourtAvailabilities. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of CourtAvailabilities. + */ + distinct?: Prisma.CourtAvailabilityScalarFieldEnum | Prisma.CourtAvailabilityScalarFieldEnum[] +} + +/** + * CourtAvailability findMany + */ +export type CourtAvailabilityFindManyArgs = { + /** + * Select specific fields to fetch from the CourtAvailability + */ + select?: Prisma.CourtAvailabilitySelect | null + /** + * Omit specific fields from the CourtAvailability + */ + omit?: Prisma.CourtAvailabilityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtAvailabilityInclude | null + /** + * Filter, which CourtAvailabilities to fetch. + */ + where?: Prisma.CourtAvailabilityWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CourtAvailabilities to fetch. + */ + orderBy?: Prisma.CourtAvailabilityOrderByWithRelationInput | Prisma.CourtAvailabilityOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing CourtAvailabilities. + */ + cursor?: Prisma.CourtAvailabilityWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CourtAvailabilities 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` CourtAvailabilities. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of CourtAvailabilities. + */ + distinct?: Prisma.CourtAvailabilityScalarFieldEnum | Prisma.CourtAvailabilityScalarFieldEnum[] +} + +/** + * CourtAvailability create + */ +export type CourtAvailabilityCreateArgs = { + /** + * Select specific fields to fetch from the CourtAvailability + */ + select?: Prisma.CourtAvailabilitySelect | null + /** + * Omit specific fields from the CourtAvailability + */ + omit?: Prisma.CourtAvailabilityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtAvailabilityInclude | null + /** + * The data needed to create a CourtAvailability. + */ + data: Prisma.XOR +} + +/** + * CourtAvailability createMany + */ +export type CourtAvailabilityCreateManyArgs = { + /** + * The data used to create many CourtAvailabilities. + */ + data: Prisma.CourtAvailabilityCreateManyInput | Prisma.CourtAvailabilityCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * CourtAvailability createManyAndReturn + */ +export type CourtAvailabilityCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the CourtAvailability + */ + select?: Prisma.CourtAvailabilitySelectCreateManyAndReturn | null + /** + * Omit specific fields from the CourtAvailability + */ + omit?: Prisma.CourtAvailabilityOmit | null + /** + * The data used to create many CourtAvailabilities. + */ + data: Prisma.CourtAvailabilityCreateManyInput | Prisma.CourtAvailabilityCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtAvailabilityIncludeCreateManyAndReturn | null +} + +/** + * CourtAvailability update + */ +export type CourtAvailabilityUpdateArgs = { + /** + * Select specific fields to fetch from the CourtAvailability + */ + select?: Prisma.CourtAvailabilitySelect | null + /** + * Omit specific fields from the CourtAvailability + */ + omit?: Prisma.CourtAvailabilityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtAvailabilityInclude | null + /** + * The data needed to update a CourtAvailability. + */ + data: Prisma.XOR + /** + * Choose, which CourtAvailability to update. + */ + where: Prisma.CourtAvailabilityWhereUniqueInput +} + +/** + * CourtAvailability updateMany + */ +export type CourtAvailabilityUpdateManyArgs = { + /** + * The data used to update CourtAvailabilities. + */ + data: Prisma.XOR + /** + * Filter which CourtAvailabilities to update + */ + where?: Prisma.CourtAvailabilityWhereInput + /** + * Limit how many CourtAvailabilities to update. + */ + limit?: number +} + +/** + * CourtAvailability updateManyAndReturn + */ +export type CourtAvailabilityUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the CourtAvailability + */ + select?: Prisma.CourtAvailabilitySelectUpdateManyAndReturn | null + /** + * Omit specific fields from the CourtAvailability + */ + omit?: Prisma.CourtAvailabilityOmit | null + /** + * The data used to update CourtAvailabilities. + */ + data: Prisma.XOR + /** + * Filter which CourtAvailabilities to update + */ + where?: Prisma.CourtAvailabilityWhereInput + /** + * Limit how many CourtAvailabilities to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtAvailabilityIncludeUpdateManyAndReturn | null +} + +/** + * CourtAvailability upsert + */ +export type CourtAvailabilityUpsertArgs = { + /** + * Select specific fields to fetch from the CourtAvailability + */ + select?: Prisma.CourtAvailabilitySelect | null + /** + * Omit specific fields from the CourtAvailability + */ + omit?: Prisma.CourtAvailabilityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtAvailabilityInclude | null + /** + * The filter to search for the CourtAvailability to update in case it exists. + */ + where: Prisma.CourtAvailabilityWhereUniqueInput + /** + * In case the CourtAvailability found by the `where` argument doesn't exist, create a new CourtAvailability with this data. + */ + create: Prisma.XOR + /** + * In case the CourtAvailability was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * CourtAvailability delete + */ +export type CourtAvailabilityDeleteArgs = { + /** + * Select specific fields to fetch from the CourtAvailability + */ + select?: Prisma.CourtAvailabilitySelect | null + /** + * Omit specific fields from the CourtAvailability + */ + omit?: Prisma.CourtAvailabilityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtAvailabilityInclude | null + /** + * Filter which CourtAvailability to delete. + */ + where: Prisma.CourtAvailabilityWhereUniqueInput +} + +/** + * CourtAvailability deleteMany + */ +export type CourtAvailabilityDeleteManyArgs = { + /** + * Filter which CourtAvailabilities to delete + */ + where?: Prisma.CourtAvailabilityWhereInput + /** + * Limit how many CourtAvailabilities to delete. + */ + limit?: number +} + +/** + * CourtAvailability without action + */ +export type CourtAvailabilityDefaultArgs = { + /** + * Select specific fields to fetch from the CourtAvailability + */ + select?: Prisma.CourtAvailabilitySelect | null + /** + * Omit specific fields from the CourtAvailability + */ + omit?: Prisma.CourtAvailabilityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtAvailabilityInclude | null +} diff --git a/apps/backend/src/generated/prisma/models/CourtBooking.ts b/apps/backend/src/generated/prisma/models/CourtBooking.ts new file mode 100644 index 0000000..13f0a2c --- /dev/null +++ b/apps/backend/src/generated/prisma/models/CourtBooking.ts @@ -0,0 +1,1566 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `CourtBooking` 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" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model CourtBooking + * + */ +export type CourtBookingModel = runtime.Types.Result.DefaultSelection + +export type AggregateCourtBooking = { + _count: CourtBookingCountAggregateOutputType | null + _min: CourtBookingMinAggregateOutputType | null + _max: CourtBookingMaxAggregateOutputType | null +} + +export type CourtBookingMinAggregateOutputType = { + id: string | null + bookingCode: string | null + courtId: string | null + bookingDate: Date | null + startTime: string | null + endTime: string | null + customerName: string | null + customerPhone: string | null + status: $Enums.CourtBookingStatus | null + createdAt: Date | null + updatedAt: Date | null +} + +export type CourtBookingMaxAggregateOutputType = { + id: string | null + bookingCode: string | null + courtId: string | null + bookingDate: Date | null + startTime: string | null + endTime: string | null + customerName: string | null + customerPhone: string | null + status: $Enums.CourtBookingStatus | null + createdAt: Date | null + updatedAt: Date | null +} + +export type CourtBookingCountAggregateOutputType = { + id: number + bookingCode: number + courtId: number + bookingDate: number + startTime: number + endTime: number + customerName: number + customerPhone: number + status: number + createdAt: number + updatedAt: number + _all: number +} + + +export type CourtBookingMinAggregateInputType = { + id?: true + bookingCode?: true + courtId?: true + bookingDate?: true + startTime?: true + endTime?: true + customerName?: true + customerPhone?: true + status?: true + createdAt?: true + updatedAt?: true +} + +export type CourtBookingMaxAggregateInputType = { + id?: true + bookingCode?: true + courtId?: true + bookingDate?: true + startTime?: true + endTime?: true + customerName?: true + customerPhone?: true + status?: true + createdAt?: true + updatedAt?: true +} + +export type CourtBookingCountAggregateInputType = { + id?: true + bookingCode?: true + courtId?: true + bookingDate?: true + startTime?: true + endTime?: true + customerName?: true + customerPhone?: true + status?: true + createdAt?: true + updatedAt?: true + _all?: true +} + +export type CourtBookingAggregateArgs = { + /** + * Filter which CourtBooking to aggregate. + */ + where?: Prisma.CourtBookingWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CourtBookings to fetch. + */ + orderBy?: Prisma.CourtBookingOrderByWithRelationInput | Prisma.CourtBookingOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.CourtBookingWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CourtBookings 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` CourtBookings. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned CourtBookings + **/ + _count?: true | CourtBookingCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: CourtBookingMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: CourtBookingMaxAggregateInputType +} + +export type GetCourtBookingAggregateType = { + [P in keyof T & keyof AggregateCourtBooking]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type CourtBookingGroupByArgs = { + where?: Prisma.CourtBookingWhereInput + orderBy?: Prisma.CourtBookingOrderByWithAggregationInput | Prisma.CourtBookingOrderByWithAggregationInput[] + by: Prisma.CourtBookingScalarFieldEnum[] | Prisma.CourtBookingScalarFieldEnum + having?: Prisma.CourtBookingScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: CourtBookingCountAggregateInputType | true + _min?: CourtBookingMinAggregateInputType + _max?: CourtBookingMaxAggregateInputType +} + +export type CourtBookingGroupByOutputType = { + id: string + bookingCode: string + courtId: string + bookingDate: Date + startTime: string + endTime: string + customerName: string + customerPhone: string + status: $Enums.CourtBookingStatus + createdAt: Date + updatedAt: Date + _count: CourtBookingCountAggregateOutputType | null + _min: CourtBookingMinAggregateOutputType | null + _max: CourtBookingMaxAggregateOutputType | null +} + +export type GetCourtBookingGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof CourtBookingGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type CourtBookingWhereInput = { + AND?: Prisma.CourtBookingWhereInput | Prisma.CourtBookingWhereInput[] + OR?: Prisma.CourtBookingWhereInput[] + NOT?: Prisma.CourtBookingWhereInput | Prisma.CourtBookingWhereInput[] + id?: Prisma.UuidFilter<"CourtBooking"> | string + bookingCode?: Prisma.StringFilter<"CourtBooking"> | string + courtId?: Prisma.UuidFilter<"CourtBooking"> | string + bookingDate?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string + startTime?: Prisma.StringFilter<"CourtBooking"> | string + endTime?: Prisma.StringFilter<"CourtBooking"> | string + customerName?: Prisma.StringFilter<"CourtBooking"> | string + customerPhone?: Prisma.StringFilter<"CourtBooking"> | string + status?: Prisma.EnumCourtBookingStatusFilter<"CourtBooking"> | $Enums.CourtBookingStatus + createdAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string + court?: Prisma.XOR +} + +export type CourtBookingOrderByWithRelationInput = { + id?: Prisma.SortOrder + bookingCode?: Prisma.SortOrder + courtId?: Prisma.SortOrder + bookingDate?: Prisma.SortOrder + startTime?: Prisma.SortOrder + endTime?: Prisma.SortOrder + customerName?: Prisma.SortOrder + customerPhone?: Prisma.SortOrder + status?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + court?: Prisma.CourtOrderByWithRelationInput +} + +export type CourtBookingWhereUniqueInput = Prisma.AtLeast<{ + id?: string + bookingCode?: string + courtId_bookingDate_startTime?: Prisma.CourtBookingCourtIdBookingDateStartTimeCompoundUniqueInput + AND?: Prisma.CourtBookingWhereInput | Prisma.CourtBookingWhereInput[] + OR?: Prisma.CourtBookingWhereInput[] + NOT?: Prisma.CourtBookingWhereInput | Prisma.CourtBookingWhereInput[] + courtId?: Prisma.UuidFilter<"CourtBooking"> | string + bookingDate?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string + startTime?: Prisma.StringFilter<"CourtBooking"> | string + endTime?: Prisma.StringFilter<"CourtBooking"> | string + customerName?: Prisma.StringFilter<"CourtBooking"> | string + customerPhone?: Prisma.StringFilter<"CourtBooking"> | string + status?: Prisma.EnumCourtBookingStatusFilter<"CourtBooking"> | $Enums.CourtBookingStatus + createdAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string + court?: Prisma.XOR +}, "id" | "bookingCode" | "courtId_bookingDate_startTime"> + +export type CourtBookingOrderByWithAggregationInput = { + id?: Prisma.SortOrder + bookingCode?: Prisma.SortOrder + courtId?: Prisma.SortOrder + bookingDate?: Prisma.SortOrder + startTime?: Prisma.SortOrder + endTime?: Prisma.SortOrder + customerName?: Prisma.SortOrder + customerPhone?: Prisma.SortOrder + status?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + _count?: Prisma.CourtBookingCountOrderByAggregateInput + _max?: Prisma.CourtBookingMaxOrderByAggregateInput + _min?: Prisma.CourtBookingMinOrderByAggregateInput +} + +export type CourtBookingScalarWhereWithAggregatesInput = { + AND?: Prisma.CourtBookingScalarWhereWithAggregatesInput | Prisma.CourtBookingScalarWhereWithAggregatesInput[] + OR?: Prisma.CourtBookingScalarWhereWithAggregatesInput[] + NOT?: Prisma.CourtBookingScalarWhereWithAggregatesInput | Prisma.CourtBookingScalarWhereWithAggregatesInput[] + id?: Prisma.UuidWithAggregatesFilter<"CourtBooking"> | string + bookingCode?: Prisma.StringWithAggregatesFilter<"CourtBooking"> | string + courtId?: Prisma.UuidWithAggregatesFilter<"CourtBooking"> | string + bookingDate?: Prisma.DateTimeWithAggregatesFilter<"CourtBooking"> | Date | string + startTime?: Prisma.StringWithAggregatesFilter<"CourtBooking"> | string + endTime?: Prisma.StringWithAggregatesFilter<"CourtBooking"> | string + customerName?: Prisma.StringWithAggregatesFilter<"CourtBooking"> | string + customerPhone?: Prisma.StringWithAggregatesFilter<"CourtBooking"> | string + status?: Prisma.EnumCourtBookingStatusWithAggregatesFilter<"CourtBooking"> | $Enums.CourtBookingStatus + createdAt?: Prisma.DateTimeWithAggregatesFilter<"CourtBooking"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"CourtBooking"> | Date | string +} + +export type CourtBookingCreateInput = { + id: string + bookingCode: string + bookingDate: Date | string + startTime: string + endTime: string + customerName: string + customerPhone: string + status?: $Enums.CourtBookingStatus + createdAt?: Date | string + updatedAt?: Date | string + court: Prisma.CourtCreateNestedOneWithoutBookingsInput +} + +export type CourtBookingUncheckedCreateInput = { + id: string + bookingCode: string + courtId: string + bookingDate: Date | string + startTime: string + endTime: string + customerName: string + customerPhone: string + status?: $Enums.CourtBookingStatus + createdAt?: Date | string + updatedAt?: Date | string +} + +export type CourtBookingUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + bookingCode?: Prisma.StringFieldUpdateOperationsInput | string + bookingDate?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + customerName?: Prisma.StringFieldUpdateOperationsInput | string + customerPhone?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + court?: Prisma.CourtUpdateOneRequiredWithoutBookingsNestedInput +} + +export type CourtBookingUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + bookingCode?: Prisma.StringFieldUpdateOperationsInput | string + courtId?: Prisma.StringFieldUpdateOperationsInput | string + bookingDate?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + customerName?: Prisma.StringFieldUpdateOperationsInput | string + customerPhone?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtBookingCreateManyInput = { + id: string + bookingCode: string + courtId: string + bookingDate: Date | string + startTime: string + endTime: string + customerName: string + customerPhone: string + status?: $Enums.CourtBookingStatus + createdAt?: Date | string + updatedAt?: Date | string +} + +export type CourtBookingUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + bookingCode?: Prisma.StringFieldUpdateOperationsInput | string + bookingDate?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + customerName?: Prisma.StringFieldUpdateOperationsInput | string + customerPhone?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtBookingUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + bookingCode?: Prisma.StringFieldUpdateOperationsInput | string + courtId?: Prisma.StringFieldUpdateOperationsInput | string + bookingDate?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + customerName?: Prisma.StringFieldUpdateOperationsInput | string + customerPhone?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtBookingListRelationFilter = { + every?: Prisma.CourtBookingWhereInput + some?: Prisma.CourtBookingWhereInput + none?: Prisma.CourtBookingWhereInput +} + +export type CourtBookingOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type CourtBookingCourtIdBookingDateStartTimeCompoundUniqueInput = { + courtId: string + bookingDate: Date | string + startTime: string +} + +export type CourtBookingCountOrderByAggregateInput = { + id?: Prisma.SortOrder + bookingCode?: Prisma.SortOrder + courtId?: Prisma.SortOrder + bookingDate?: Prisma.SortOrder + startTime?: Prisma.SortOrder + endTime?: Prisma.SortOrder + customerName?: Prisma.SortOrder + customerPhone?: Prisma.SortOrder + status?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type CourtBookingMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + bookingCode?: Prisma.SortOrder + courtId?: Prisma.SortOrder + bookingDate?: Prisma.SortOrder + startTime?: Prisma.SortOrder + endTime?: Prisma.SortOrder + customerName?: Prisma.SortOrder + customerPhone?: Prisma.SortOrder + status?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type CourtBookingMinOrderByAggregateInput = { + id?: Prisma.SortOrder + bookingCode?: Prisma.SortOrder + courtId?: Prisma.SortOrder + bookingDate?: Prisma.SortOrder + startTime?: Prisma.SortOrder + endTime?: Prisma.SortOrder + customerName?: Prisma.SortOrder + customerPhone?: Prisma.SortOrder + status?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type CourtBookingCreateNestedManyWithoutCourtInput = { + create?: Prisma.XOR | Prisma.CourtBookingCreateWithoutCourtInput[] | Prisma.CourtBookingUncheckedCreateWithoutCourtInput[] + connectOrCreate?: Prisma.CourtBookingCreateOrConnectWithoutCourtInput | Prisma.CourtBookingCreateOrConnectWithoutCourtInput[] + createMany?: Prisma.CourtBookingCreateManyCourtInputEnvelope + connect?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[] +} + +export type CourtBookingUncheckedCreateNestedManyWithoutCourtInput = { + create?: Prisma.XOR | Prisma.CourtBookingCreateWithoutCourtInput[] | Prisma.CourtBookingUncheckedCreateWithoutCourtInput[] + connectOrCreate?: Prisma.CourtBookingCreateOrConnectWithoutCourtInput | Prisma.CourtBookingCreateOrConnectWithoutCourtInput[] + createMany?: Prisma.CourtBookingCreateManyCourtInputEnvelope + connect?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[] +} + +export type CourtBookingUpdateManyWithoutCourtNestedInput = { + create?: Prisma.XOR | Prisma.CourtBookingCreateWithoutCourtInput[] | Prisma.CourtBookingUncheckedCreateWithoutCourtInput[] + connectOrCreate?: Prisma.CourtBookingCreateOrConnectWithoutCourtInput | Prisma.CourtBookingCreateOrConnectWithoutCourtInput[] + upsert?: Prisma.CourtBookingUpsertWithWhereUniqueWithoutCourtInput | Prisma.CourtBookingUpsertWithWhereUniqueWithoutCourtInput[] + createMany?: Prisma.CourtBookingCreateManyCourtInputEnvelope + set?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[] + disconnect?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[] + delete?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[] + connect?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[] + update?: Prisma.CourtBookingUpdateWithWhereUniqueWithoutCourtInput | Prisma.CourtBookingUpdateWithWhereUniqueWithoutCourtInput[] + updateMany?: Prisma.CourtBookingUpdateManyWithWhereWithoutCourtInput | Prisma.CourtBookingUpdateManyWithWhereWithoutCourtInput[] + deleteMany?: Prisma.CourtBookingScalarWhereInput | Prisma.CourtBookingScalarWhereInput[] +} + +export type CourtBookingUncheckedUpdateManyWithoutCourtNestedInput = { + create?: Prisma.XOR | Prisma.CourtBookingCreateWithoutCourtInput[] | Prisma.CourtBookingUncheckedCreateWithoutCourtInput[] + connectOrCreate?: Prisma.CourtBookingCreateOrConnectWithoutCourtInput | Prisma.CourtBookingCreateOrConnectWithoutCourtInput[] + upsert?: Prisma.CourtBookingUpsertWithWhereUniqueWithoutCourtInput | Prisma.CourtBookingUpsertWithWhereUniqueWithoutCourtInput[] + createMany?: Prisma.CourtBookingCreateManyCourtInputEnvelope + set?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[] + disconnect?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[] + delete?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[] + connect?: Prisma.CourtBookingWhereUniqueInput | Prisma.CourtBookingWhereUniqueInput[] + update?: Prisma.CourtBookingUpdateWithWhereUniqueWithoutCourtInput | Prisma.CourtBookingUpdateWithWhereUniqueWithoutCourtInput[] + updateMany?: Prisma.CourtBookingUpdateManyWithWhereWithoutCourtInput | Prisma.CourtBookingUpdateManyWithWhereWithoutCourtInput[] + deleteMany?: Prisma.CourtBookingScalarWhereInput | Prisma.CourtBookingScalarWhereInput[] +} + +export type EnumCourtBookingStatusFieldUpdateOperationsInput = { + set?: $Enums.CourtBookingStatus +} + +export type CourtBookingCreateWithoutCourtInput = { + id: string + bookingCode: string + bookingDate: Date | string + startTime: string + endTime: string + customerName: string + customerPhone: string + status?: $Enums.CourtBookingStatus + createdAt?: Date | string + updatedAt?: Date | string +} + +export type CourtBookingUncheckedCreateWithoutCourtInput = { + id: string + bookingCode: string + bookingDate: Date | string + startTime: string + endTime: string + customerName: string + customerPhone: string + status?: $Enums.CourtBookingStatus + createdAt?: Date | string + updatedAt?: Date | string +} + +export type CourtBookingCreateOrConnectWithoutCourtInput = { + where: Prisma.CourtBookingWhereUniqueInput + create: Prisma.XOR +} + +export type CourtBookingCreateManyCourtInputEnvelope = { + data: Prisma.CourtBookingCreateManyCourtInput | Prisma.CourtBookingCreateManyCourtInput[] + skipDuplicates?: boolean +} + +export type CourtBookingUpsertWithWhereUniqueWithoutCourtInput = { + where: Prisma.CourtBookingWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type CourtBookingUpdateWithWhereUniqueWithoutCourtInput = { + where: Prisma.CourtBookingWhereUniqueInput + data: Prisma.XOR +} + +export type CourtBookingUpdateManyWithWhereWithoutCourtInput = { + where: Prisma.CourtBookingScalarWhereInput + data: Prisma.XOR +} + +export type CourtBookingScalarWhereInput = { + AND?: Prisma.CourtBookingScalarWhereInput | Prisma.CourtBookingScalarWhereInput[] + OR?: Prisma.CourtBookingScalarWhereInput[] + NOT?: Prisma.CourtBookingScalarWhereInput | Prisma.CourtBookingScalarWhereInput[] + id?: Prisma.UuidFilter<"CourtBooking"> | string + bookingCode?: Prisma.StringFilter<"CourtBooking"> | string + courtId?: Prisma.UuidFilter<"CourtBooking"> | string + bookingDate?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string + startTime?: Prisma.StringFilter<"CourtBooking"> | string + endTime?: Prisma.StringFilter<"CourtBooking"> | string + customerName?: Prisma.StringFilter<"CourtBooking"> | string + customerPhone?: Prisma.StringFilter<"CourtBooking"> | string + status?: Prisma.EnumCourtBookingStatusFilter<"CourtBooking"> | $Enums.CourtBookingStatus + createdAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"CourtBooking"> | Date | string +} + +export type CourtBookingCreateManyCourtInput = { + id: string + bookingCode: string + bookingDate: Date | string + startTime: string + endTime: string + customerName: string + customerPhone: string + status?: $Enums.CourtBookingStatus + createdAt?: Date | string + updatedAt?: Date | string +} + +export type CourtBookingUpdateWithoutCourtInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + bookingCode?: Prisma.StringFieldUpdateOperationsInput | string + bookingDate?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + customerName?: Prisma.StringFieldUpdateOperationsInput | string + customerPhone?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtBookingUncheckedUpdateWithoutCourtInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + bookingCode?: Prisma.StringFieldUpdateOperationsInput | string + bookingDate?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + customerName?: Prisma.StringFieldUpdateOperationsInput | string + customerPhone?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtBookingUncheckedUpdateManyWithoutCourtInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + bookingCode?: Prisma.StringFieldUpdateOperationsInput | string + bookingDate?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + startTime?: Prisma.StringFieldUpdateOperationsInput | string + endTime?: Prisma.StringFieldUpdateOperationsInput | string + customerName?: Prisma.StringFieldUpdateOperationsInput | string + customerPhone?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumCourtBookingStatusFieldUpdateOperationsInput | $Enums.CourtBookingStatus + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + + +export type CourtBookingSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + bookingCode?: boolean + courtId?: boolean + bookingDate?: boolean + startTime?: boolean + endTime?: boolean + customerName?: boolean + customerPhone?: boolean + status?: boolean + createdAt?: boolean + updatedAt?: boolean + court?: boolean | Prisma.CourtDefaultArgs +}, ExtArgs["result"]["courtBooking"]> + +export type CourtBookingSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + bookingCode?: boolean + courtId?: boolean + bookingDate?: boolean + startTime?: boolean + endTime?: boolean + customerName?: boolean + customerPhone?: boolean + status?: boolean + createdAt?: boolean + updatedAt?: boolean + court?: boolean | Prisma.CourtDefaultArgs +}, ExtArgs["result"]["courtBooking"]> + +export type CourtBookingSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + bookingCode?: boolean + courtId?: boolean + bookingDate?: boolean + startTime?: boolean + endTime?: boolean + customerName?: boolean + customerPhone?: boolean + status?: boolean + createdAt?: boolean + updatedAt?: boolean + court?: boolean | Prisma.CourtDefaultArgs +}, ExtArgs["result"]["courtBooking"]> + +export type CourtBookingSelectScalar = { + id?: boolean + bookingCode?: boolean + courtId?: boolean + bookingDate?: boolean + startTime?: boolean + endTime?: boolean + customerName?: boolean + customerPhone?: boolean + status?: boolean + createdAt?: boolean + updatedAt?: boolean +} + +export type CourtBookingOmit = runtime.Types.Extensions.GetOmit<"id" | "bookingCode" | "courtId" | "bookingDate" | "startTime" | "endTime" | "customerName" | "customerPhone" | "status" | "createdAt" | "updatedAt", ExtArgs["result"]["courtBooking"]> +export type CourtBookingInclude = { + court?: boolean | Prisma.CourtDefaultArgs +} +export type CourtBookingIncludeCreateManyAndReturn = { + court?: boolean | Prisma.CourtDefaultArgs +} +export type CourtBookingIncludeUpdateManyAndReturn = { + court?: boolean | Prisma.CourtDefaultArgs +} + +export type $CourtBookingPayload = { + name: "CourtBooking" + objects: { + court: Prisma.$CourtPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + bookingCode: string + courtId: string + bookingDate: Date + startTime: string + endTime: string + customerName: string + customerPhone: string + status: $Enums.CourtBookingStatus + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["courtBooking"]> + composites: {} +} + +export type CourtBookingGetPayload = runtime.Types.Result.GetResult + +export type CourtBookingCountArgs = + Omit & { + select?: CourtBookingCountAggregateInputType | true + } + +export interface CourtBookingDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['CourtBooking'], meta: { name: 'CourtBooking' } } + /** + * Find zero or one CourtBooking that matches the filter. + * @param {CourtBookingFindUniqueArgs} args - Arguments to find a CourtBooking + * @example + * // Get one CourtBooking + * const courtBooking = await prisma.courtBooking.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__CourtBookingClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one CourtBooking that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {CourtBookingFindUniqueOrThrowArgs} args - Arguments to find a CourtBooking + * @example + * // Get one CourtBooking + * const courtBooking = await prisma.courtBooking.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__CourtBookingClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first CourtBooking 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 {CourtBookingFindFirstArgs} args - Arguments to find a CourtBooking + * @example + * // Get one CourtBooking + * const courtBooking = await prisma.courtBooking.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__CourtBookingClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first CourtBooking 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 {CourtBookingFindFirstOrThrowArgs} args - Arguments to find a CourtBooking + * @example + * // Get one CourtBooking + * const courtBooking = await prisma.courtBooking.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__CourtBookingClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more CourtBookings 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 {CourtBookingFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all CourtBookings + * const courtBookings = await prisma.courtBooking.findMany() + * + * // Get first 10 CourtBookings + * const courtBookings = await prisma.courtBooking.findMany({ take: 10 }) + * + * // Only select the `id` + * const courtBookingWithIdOnly = await prisma.courtBooking.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a CourtBooking. + * @param {CourtBookingCreateArgs} args - Arguments to create a CourtBooking. + * @example + * // Create one CourtBooking + * const CourtBooking = await prisma.courtBooking.create({ + * data: { + * // ... data to create a CourtBooking + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__CourtBookingClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many CourtBookings. + * @param {CourtBookingCreateManyArgs} args - Arguments to create many CourtBookings. + * @example + * // Create many CourtBookings + * const courtBooking = await prisma.courtBooking.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many CourtBookings and returns the data saved in the database. + * @param {CourtBookingCreateManyAndReturnArgs} args - Arguments to create many CourtBookings. + * @example + * // Create many CourtBookings + * const courtBooking = await prisma.courtBooking.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many CourtBookings and only return the `id` + * const courtBookingWithIdOnly = await prisma.courtBooking.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 CourtBooking. + * @param {CourtBookingDeleteArgs} args - Arguments to delete one CourtBooking. + * @example + * // Delete one CourtBooking + * const CourtBooking = await prisma.courtBooking.delete({ + * where: { + * // ... filter to delete one CourtBooking + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__CourtBookingClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one CourtBooking. + * @param {CourtBookingUpdateArgs} args - Arguments to update one CourtBooking. + * @example + * // Update one CourtBooking + * const courtBooking = await prisma.courtBooking.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__CourtBookingClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more CourtBookings. + * @param {CourtBookingDeleteManyArgs} args - Arguments to filter CourtBookings to delete. + * @example + * // Delete a few CourtBookings + * const { count } = await prisma.courtBooking.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more CourtBookings. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtBookingUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many CourtBookings + * const courtBooking = await prisma.courtBooking.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more CourtBookings and returns the data updated in the database. + * @param {CourtBookingUpdateManyAndReturnArgs} args - Arguments to update many CourtBookings. + * @example + * // Update many CourtBookings + * const courtBooking = await prisma.courtBooking.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more CourtBookings and only return the `id` + * const courtBookingWithIdOnly = await prisma.courtBooking.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 CourtBooking. + * @param {CourtBookingUpsertArgs} args - Arguments to update or create a CourtBooking. + * @example + * // Update or create a CourtBooking + * const courtBooking = await prisma.courtBooking.upsert({ + * create: { + * // ... data to create a CourtBooking + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the CourtBooking we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__CourtBookingClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of CourtBookings. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtBookingCountArgs} args - Arguments to filter CourtBookings to count. + * @example + * // Count the number of CourtBookings + * const count = await prisma.courtBooking.count({ + * where: { + * // ... the filter for the CourtBookings 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 CourtBooking. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtBookingAggregateArgs} 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 CourtBooking. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtBookingGroupByArgs} 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 CourtBookingGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: CourtBookingGroupByArgs['orderBy'] } + : { orderBy?: CourtBookingGroupByArgs['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 ? GetCourtBookingGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the CourtBooking model + */ +readonly fields: CourtBookingFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for CourtBooking. + * 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__CourtBookingClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + court = {}>(args?: Prisma.Subset>): Prisma.Prisma__CourtClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @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 CourtBooking model + */ +export interface CourtBookingFieldRefs { + readonly id: Prisma.FieldRef<"CourtBooking", 'String'> + readonly bookingCode: Prisma.FieldRef<"CourtBooking", 'String'> + readonly courtId: Prisma.FieldRef<"CourtBooking", 'String'> + readonly bookingDate: Prisma.FieldRef<"CourtBooking", 'DateTime'> + readonly startTime: Prisma.FieldRef<"CourtBooking", 'String'> + readonly endTime: Prisma.FieldRef<"CourtBooking", 'String'> + readonly customerName: Prisma.FieldRef<"CourtBooking", 'String'> + readonly customerPhone: Prisma.FieldRef<"CourtBooking", 'String'> + readonly status: Prisma.FieldRef<"CourtBooking", 'CourtBookingStatus'> + readonly createdAt: Prisma.FieldRef<"CourtBooking", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"CourtBooking", 'DateTime'> +} + + +// Custom InputTypes +/** + * CourtBooking findUnique + */ +export type CourtBookingFindUniqueArgs = { + /** + * Select specific fields to fetch from the CourtBooking + */ + select?: Prisma.CourtBookingSelect | null + /** + * Omit specific fields from the CourtBooking + */ + omit?: Prisma.CourtBookingOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtBookingInclude | null + /** + * Filter, which CourtBooking to fetch. + */ + where: Prisma.CourtBookingWhereUniqueInput +} + +/** + * CourtBooking findUniqueOrThrow + */ +export type CourtBookingFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the CourtBooking + */ + select?: Prisma.CourtBookingSelect | null + /** + * Omit specific fields from the CourtBooking + */ + omit?: Prisma.CourtBookingOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtBookingInclude | null + /** + * Filter, which CourtBooking to fetch. + */ + where: Prisma.CourtBookingWhereUniqueInput +} + +/** + * CourtBooking findFirst + */ +export type CourtBookingFindFirstArgs = { + /** + * Select specific fields to fetch from the CourtBooking + */ + select?: Prisma.CourtBookingSelect | null + /** + * Omit specific fields from the CourtBooking + */ + omit?: Prisma.CourtBookingOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtBookingInclude | null + /** + * Filter, which CourtBooking to fetch. + */ + where?: Prisma.CourtBookingWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CourtBookings to fetch. + */ + orderBy?: Prisma.CourtBookingOrderByWithRelationInput | Prisma.CourtBookingOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for CourtBookings. + */ + cursor?: Prisma.CourtBookingWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CourtBookings 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` CourtBookings. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of CourtBookings. + */ + distinct?: Prisma.CourtBookingScalarFieldEnum | Prisma.CourtBookingScalarFieldEnum[] +} + +/** + * CourtBooking findFirstOrThrow + */ +export type CourtBookingFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the CourtBooking + */ + select?: Prisma.CourtBookingSelect | null + /** + * Omit specific fields from the CourtBooking + */ + omit?: Prisma.CourtBookingOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtBookingInclude | null + /** + * Filter, which CourtBooking to fetch. + */ + where?: Prisma.CourtBookingWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CourtBookings to fetch. + */ + orderBy?: Prisma.CourtBookingOrderByWithRelationInput | Prisma.CourtBookingOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for CourtBookings. + */ + cursor?: Prisma.CourtBookingWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CourtBookings 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` CourtBookings. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of CourtBookings. + */ + distinct?: Prisma.CourtBookingScalarFieldEnum | Prisma.CourtBookingScalarFieldEnum[] +} + +/** + * CourtBooking findMany + */ +export type CourtBookingFindManyArgs = { + /** + * Select specific fields to fetch from the CourtBooking + */ + select?: Prisma.CourtBookingSelect | null + /** + * Omit specific fields from the CourtBooking + */ + omit?: Prisma.CourtBookingOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtBookingInclude | null + /** + * Filter, which CourtBookings to fetch. + */ + where?: Prisma.CourtBookingWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CourtBookings to fetch. + */ + orderBy?: Prisma.CourtBookingOrderByWithRelationInput | Prisma.CourtBookingOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing CourtBookings. + */ + cursor?: Prisma.CourtBookingWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CourtBookings 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` CourtBookings. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of CourtBookings. + */ + distinct?: Prisma.CourtBookingScalarFieldEnum | Prisma.CourtBookingScalarFieldEnum[] +} + +/** + * CourtBooking create + */ +export type CourtBookingCreateArgs = { + /** + * Select specific fields to fetch from the CourtBooking + */ + select?: Prisma.CourtBookingSelect | null + /** + * Omit specific fields from the CourtBooking + */ + omit?: Prisma.CourtBookingOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtBookingInclude | null + /** + * The data needed to create a CourtBooking. + */ + data: Prisma.XOR +} + +/** + * CourtBooking createMany + */ +export type CourtBookingCreateManyArgs = { + /** + * The data used to create many CourtBookings. + */ + data: Prisma.CourtBookingCreateManyInput | Prisma.CourtBookingCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * CourtBooking createManyAndReturn + */ +export type CourtBookingCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the CourtBooking + */ + select?: Prisma.CourtBookingSelectCreateManyAndReturn | null + /** + * Omit specific fields from the CourtBooking + */ + omit?: Prisma.CourtBookingOmit | null + /** + * The data used to create many CourtBookings. + */ + data: Prisma.CourtBookingCreateManyInput | Prisma.CourtBookingCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtBookingIncludeCreateManyAndReturn | null +} + +/** + * CourtBooking update + */ +export type CourtBookingUpdateArgs = { + /** + * Select specific fields to fetch from the CourtBooking + */ + select?: Prisma.CourtBookingSelect | null + /** + * Omit specific fields from the CourtBooking + */ + omit?: Prisma.CourtBookingOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtBookingInclude | null + /** + * The data needed to update a CourtBooking. + */ + data: Prisma.XOR + /** + * Choose, which CourtBooking to update. + */ + where: Prisma.CourtBookingWhereUniqueInput +} + +/** + * CourtBooking updateMany + */ +export type CourtBookingUpdateManyArgs = { + /** + * The data used to update CourtBookings. + */ + data: Prisma.XOR + /** + * Filter which CourtBookings to update + */ + where?: Prisma.CourtBookingWhereInput + /** + * Limit how many CourtBookings to update. + */ + limit?: number +} + +/** + * CourtBooking updateManyAndReturn + */ +export type CourtBookingUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the CourtBooking + */ + select?: Prisma.CourtBookingSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the CourtBooking + */ + omit?: Prisma.CourtBookingOmit | null + /** + * The data used to update CourtBookings. + */ + data: Prisma.XOR + /** + * Filter which CourtBookings to update + */ + where?: Prisma.CourtBookingWhereInput + /** + * Limit how many CourtBookings to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtBookingIncludeUpdateManyAndReturn | null +} + +/** + * CourtBooking upsert + */ +export type CourtBookingUpsertArgs = { + /** + * Select specific fields to fetch from the CourtBooking + */ + select?: Prisma.CourtBookingSelect | null + /** + * Omit specific fields from the CourtBooking + */ + omit?: Prisma.CourtBookingOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtBookingInclude | null + /** + * The filter to search for the CourtBooking to update in case it exists. + */ + where: Prisma.CourtBookingWhereUniqueInput + /** + * In case the CourtBooking found by the `where` argument doesn't exist, create a new CourtBooking with this data. + */ + create: Prisma.XOR + /** + * In case the CourtBooking was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * CourtBooking delete + */ +export type CourtBookingDeleteArgs = { + /** + * Select specific fields to fetch from the CourtBooking + */ + select?: Prisma.CourtBookingSelect | null + /** + * Omit specific fields from the CourtBooking + */ + omit?: Prisma.CourtBookingOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtBookingInclude | null + /** + * Filter which CourtBooking to delete. + */ + where: Prisma.CourtBookingWhereUniqueInput +} + +/** + * CourtBooking deleteMany + */ +export type CourtBookingDeleteManyArgs = { + /** + * Filter which CourtBookings to delete + */ + where?: Prisma.CourtBookingWhereInput + /** + * Limit how many CourtBookings to delete. + */ + limit?: number +} + +/** + * CourtBooking without action + */ +export type CourtBookingDefaultArgs = { + /** + * Select specific fields to fetch from the CourtBooking + */ + select?: Prisma.CourtBookingSelect | null + /** + * Omit specific fields from the CourtBooking + */ + omit?: Prisma.CourtBookingOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtBookingInclude | null +} diff --git a/apps/backend/src/generated/prisma/models/CourtPriceRule.ts b/apps/backend/src/generated/prisma/models/CourtPriceRule.ts new file mode 100644 index 0000000..49865b0 --- /dev/null +++ b/apps/backend/src/generated/prisma/models/CourtPriceRule.ts @@ -0,0 +1,1533 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `CourtPriceRule` 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" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model CourtPriceRule + * + */ +export type CourtPriceRuleModel = runtime.Types.Result.DefaultSelection + +export type AggregateCourtPriceRule = { + _count: CourtPriceRuleCountAggregateOutputType | null + _avg: CourtPriceRuleAvgAggregateOutputType | null + _sum: CourtPriceRuleSumAggregateOutputType | null + _min: CourtPriceRuleMinAggregateOutputType | null + _max: CourtPriceRuleMaxAggregateOutputType | null +} + +export type CourtPriceRuleAvgAggregateOutputType = { + price: runtime.Decimal | null +} + +export type CourtPriceRuleSumAggregateOutputType = { + price: runtime.Decimal | null +} + +export type CourtPriceRuleMinAggregateOutputType = { + id: string | null + courtId: string | null + dayOfWeek: $Enums.DayOfWeek | null + startTime: string | null + endTime: string | null + price: runtime.Decimal | null + isActive: boolean | null + createdAt: Date | null + updatedAt: Date | null +} + +export type CourtPriceRuleMaxAggregateOutputType = { + id: string | null + courtId: string | null + dayOfWeek: $Enums.DayOfWeek | null + startTime: string | null + endTime: string | null + price: runtime.Decimal | null + isActive: boolean | null + createdAt: Date | null + updatedAt: Date | null +} + +export type CourtPriceRuleCountAggregateOutputType = { + id: number + courtId: number + dayOfWeek: number + startTime: number + endTime: number + price: number + isActive: number + createdAt: number + updatedAt: number + _all: number +} + + +export type CourtPriceRuleAvgAggregateInputType = { + price?: true +} + +export type CourtPriceRuleSumAggregateInputType = { + price?: true +} + +export type CourtPriceRuleMinAggregateInputType = { + id?: true + courtId?: true + dayOfWeek?: true + startTime?: true + endTime?: true + price?: true + isActive?: true + createdAt?: true + updatedAt?: true +} + +export type CourtPriceRuleMaxAggregateInputType = { + id?: true + courtId?: true + dayOfWeek?: true + startTime?: true + endTime?: true + price?: true + isActive?: true + createdAt?: true + updatedAt?: true +} + +export type CourtPriceRuleCountAggregateInputType = { + id?: true + courtId?: true + dayOfWeek?: true + startTime?: true + endTime?: true + price?: true + isActive?: true + createdAt?: true + updatedAt?: true + _all?: true +} + +export type CourtPriceRuleAggregateArgs = { + /** + * Filter which CourtPriceRule to aggregate. + */ + where?: Prisma.CourtPriceRuleWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CourtPriceRules to fetch. + */ + orderBy?: Prisma.CourtPriceRuleOrderByWithRelationInput | Prisma.CourtPriceRuleOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.CourtPriceRuleWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CourtPriceRules 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` CourtPriceRules. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned CourtPriceRules + **/ + _count?: true | CourtPriceRuleCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: CourtPriceRuleAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: CourtPriceRuleSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: CourtPriceRuleMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: CourtPriceRuleMaxAggregateInputType +} + +export type GetCourtPriceRuleAggregateType = { + [P in keyof T & keyof AggregateCourtPriceRule]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type CourtPriceRuleGroupByArgs = { + where?: Prisma.CourtPriceRuleWhereInput + orderBy?: Prisma.CourtPriceRuleOrderByWithAggregationInput | Prisma.CourtPriceRuleOrderByWithAggregationInput[] + by: Prisma.CourtPriceRuleScalarFieldEnum[] | Prisma.CourtPriceRuleScalarFieldEnum + having?: Prisma.CourtPriceRuleScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: CourtPriceRuleCountAggregateInputType | true + _avg?: CourtPriceRuleAvgAggregateInputType + _sum?: CourtPriceRuleSumAggregateInputType + _min?: CourtPriceRuleMinAggregateInputType + _max?: CourtPriceRuleMaxAggregateInputType +} + +export type CourtPriceRuleGroupByOutputType = { + id: string + courtId: string + dayOfWeek: $Enums.DayOfWeek | null + startTime: string | null + endTime: string | null + price: runtime.Decimal + isActive: boolean + createdAt: Date + updatedAt: Date + _count: CourtPriceRuleCountAggregateOutputType | null + _avg: CourtPriceRuleAvgAggregateOutputType | null + _sum: CourtPriceRuleSumAggregateOutputType | null + _min: CourtPriceRuleMinAggregateOutputType | null + _max: CourtPriceRuleMaxAggregateOutputType | null +} + +export type GetCourtPriceRuleGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof CourtPriceRuleGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type CourtPriceRuleWhereInput = { + AND?: Prisma.CourtPriceRuleWhereInput | Prisma.CourtPriceRuleWhereInput[] + OR?: Prisma.CourtPriceRuleWhereInput[] + NOT?: Prisma.CourtPriceRuleWhereInput | Prisma.CourtPriceRuleWhereInput[] + id?: Prisma.UuidFilter<"CourtPriceRule"> | string + courtId?: Prisma.UuidFilter<"CourtPriceRule"> | string + dayOfWeek?: Prisma.EnumDayOfWeekNullableFilter<"CourtPriceRule"> | $Enums.DayOfWeek | null + startTime?: Prisma.StringNullableFilter<"CourtPriceRule"> | string | null + endTime?: Prisma.StringNullableFilter<"CourtPriceRule"> | string | null + price?: Prisma.DecimalFilter<"CourtPriceRule"> | runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: Prisma.BoolFilter<"CourtPriceRule"> | boolean + createdAt?: Prisma.DateTimeFilter<"CourtPriceRule"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"CourtPriceRule"> | Date | string + court?: Prisma.XOR +} + +export type CourtPriceRuleOrderByWithRelationInput = { + id?: Prisma.SortOrder + courtId?: Prisma.SortOrder + dayOfWeek?: Prisma.SortOrderInput | Prisma.SortOrder + startTime?: Prisma.SortOrderInput | Prisma.SortOrder + endTime?: Prisma.SortOrderInput | Prisma.SortOrder + price?: Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + court?: Prisma.CourtOrderByWithRelationInput +} + +export type CourtPriceRuleWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.CourtPriceRuleWhereInput | Prisma.CourtPriceRuleWhereInput[] + OR?: Prisma.CourtPriceRuleWhereInput[] + NOT?: Prisma.CourtPriceRuleWhereInput | Prisma.CourtPriceRuleWhereInput[] + courtId?: Prisma.UuidFilter<"CourtPriceRule"> | string + dayOfWeek?: Prisma.EnumDayOfWeekNullableFilter<"CourtPriceRule"> | $Enums.DayOfWeek | null + startTime?: Prisma.StringNullableFilter<"CourtPriceRule"> | string | null + endTime?: Prisma.StringNullableFilter<"CourtPriceRule"> | string | null + price?: Prisma.DecimalFilter<"CourtPriceRule"> | runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: Prisma.BoolFilter<"CourtPriceRule"> | boolean + createdAt?: Prisma.DateTimeFilter<"CourtPriceRule"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"CourtPriceRule"> | Date | string + court?: Prisma.XOR +}, "id"> + +export type CourtPriceRuleOrderByWithAggregationInput = { + id?: Prisma.SortOrder + courtId?: Prisma.SortOrder + dayOfWeek?: Prisma.SortOrderInput | Prisma.SortOrder + startTime?: Prisma.SortOrderInput | Prisma.SortOrder + endTime?: Prisma.SortOrderInput | Prisma.SortOrder + price?: Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + _count?: Prisma.CourtPriceRuleCountOrderByAggregateInput + _avg?: Prisma.CourtPriceRuleAvgOrderByAggregateInput + _max?: Prisma.CourtPriceRuleMaxOrderByAggregateInput + _min?: Prisma.CourtPriceRuleMinOrderByAggregateInput + _sum?: Prisma.CourtPriceRuleSumOrderByAggregateInput +} + +export type CourtPriceRuleScalarWhereWithAggregatesInput = { + AND?: Prisma.CourtPriceRuleScalarWhereWithAggregatesInput | Prisma.CourtPriceRuleScalarWhereWithAggregatesInput[] + OR?: Prisma.CourtPriceRuleScalarWhereWithAggregatesInput[] + NOT?: Prisma.CourtPriceRuleScalarWhereWithAggregatesInput | Prisma.CourtPriceRuleScalarWhereWithAggregatesInput[] + id?: Prisma.UuidWithAggregatesFilter<"CourtPriceRule"> | string + courtId?: Prisma.UuidWithAggregatesFilter<"CourtPriceRule"> | string + dayOfWeek?: Prisma.EnumDayOfWeekNullableWithAggregatesFilter<"CourtPriceRule"> | $Enums.DayOfWeek | null + startTime?: Prisma.StringNullableWithAggregatesFilter<"CourtPriceRule"> | string | null + endTime?: Prisma.StringNullableWithAggregatesFilter<"CourtPriceRule"> | string | null + price?: Prisma.DecimalWithAggregatesFilter<"CourtPriceRule"> | runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: Prisma.BoolWithAggregatesFilter<"CourtPriceRule"> | boolean + createdAt?: Prisma.DateTimeWithAggregatesFilter<"CourtPriceRule"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"CourtPriceRule"> | Date | string +} + +export type CourtPriceRuleCreateInput = { + id: string + dayOfWeek?: $Enums.DayOfWeek | null + startTime?: string | null + endTime?: string | null + price: runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + court: Prisma.CourtCreateNestedOneWithoutPriceRulesInput +} + +export type CourtPriceRuleUncheckedCreateInput = { + id: string + courtId: string + dayOfWeek?: $Enums.DayOfWeek | null + startTime?: string | null + endTime?: string | null + price: runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string +} + +export type CourtPriceRuleUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.NullableEnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek | null + startTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + endTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + court?: Prisma.CourtUpdateOneRequiredWithoutPriceRulesNestedInput +} + +export type CourtPriceRuleUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + courtId?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.NullableEnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek | null + startTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + endTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtPriceRuleCreateManyInput = { + id: string + courtId: string + dayOfWeek?: $Enums.DayOfWeek | null + startTime?: string | null + endTime?: string | null + price: runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string +} + +export type CourtPriceRuleUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.NullableEnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek | null + startTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + endTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtPriceRuleUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + courtId?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.NullableEnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek | null + startTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + endTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtPriceRuleListRelationFilter = { + every?: Prisma.CourtPriceRuleWhereInput + some?: Prisma.CourtPriceRuleWhereInput + none?: Prisma.CourtPriceRuleWhereInput +} + +export type CourtPriceRuleOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type CourtPriceRuleCountOrderByAggregateInput = { + id?: Prisma.SortOrder + courtId?: Prisma.SortOrder + dayOfWeek?: Prisma.SortOrder + startTime?: Prisma.SortOrder + endTime?: Prisma.SortOrder + price?: Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type CourtPriceRuleAvgOrderByAggregateInput = { + price?: Prisma.SortOrder +} + +export type CourtPriceRuleMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + courtId?: Prisma.SortOrder + dayOfWeek?: Prisma.SortOrder + startTime?: Prisma.SortOrder + endTime?: Prisma.SortOrder + price?: Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type CourtPriceRuleMinOrderByAggregateInput = { + id?: Prisma.SortOrder + courtId?: Prisma.SortOrder + dayOfWeek?: Prisma.SortOrder + startTime?: Prisma.SortOrder + endTime?: Prisma.SortOrder + price?: Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type CourtPriceRuleSumOrderByAggregateInput = { + price?: Prisma.SortOrder +} + +export type CourtPriceRuleCreateNestedManyWithoutCourtInput = { + create?: Prisma.XOR | Prisma.CourtPriceRuleCreateWithoutCourtInput[] | Prisma.CourtPriceRuleUncheckedCreateWithoutCourtInput[] + connectOrCreate?: Prisma.CourtPriceRuleCreateOrConnectWithoutCourtInput | Prisma.CourtPriceRuleCreateOrConnectWithoutCourtInput[] + createMany?: Prisma.CourtPriceRuleCreateManyCourtInputEnvelope + connect?: Prisma.CourtPriceRuleWhereUniqueInput | Prisma.CourtPriceRuleWhereUniqueInput[] +} + +export type CourtPriceRuleUncheckedCreateNestedManyWithoutCourtInput = { + create?: Prisma.XOR | Prisma.CourtPriceRuleCreateWithoutCourtInput[] | Prisma.CourtPriceRuleUncheckedCreateWithoutCourtInput[] + connectOrCreate?: Prisma.CourtPriceRuleCreateOrConnectWithoutCourtInput | Prisma.CourtPriceRuleCreateOrConnectWithoutCourtInput[] + createMany?: Prisma.CourtPriceRuleCreateManyCourtInputEnvelope + connect?: Prisma.CourtPriceRuleWhereUniqueInput | Prisma.CourtPriceRuleWhereUniqueInput[] +} + +export type CourtPriceRuleUpdateManyWithoutCourtNestedInput = { + create?: Prisma.XOR | Prisma.CourtPriceRuleCreateWithoutCourtInput[] | Prisma.CourtPriceRuleUncheckedCreateWithoutCourtInput[] + connectOrCreate?: Prisma.CourtPriceRuleCreateOrConnectWithoutCourtInput | Prisma.CourtPriceRuleCreateOrConnectWithoutCourtInput[] + upsert?: Prisma.CourtPriceRuleUpsertWithWhereUniqueWithoutCourtInput | Prisma.CourtPriceRuleUpsertWithWhereUniqueWithoutCourtInput[] + createMany?: Prisma.CourtPriceRuleCreateManyCourtInputEnvelope + set?: Prisma.CourtPriceRuleWhereUniqueInput | Prisma.CourtPriceRuleWhereUniqueInput[] + disconnect?: Prisma.CourtPriceRuleWhereUniqueInput | Prisma.CourtPriceRuleWhereUniqueInput[] + delete?: Prisma.CourtPriceRuleWhereUniqueInput | Prisma.CourtPriceRuleWhereUniqueInput[] + connect?: Prisma.CourtPriceRuleWhereUniqueInput | Prisma.CourtPriceRuleWhereUniqueInput[] + update?: Prisma.CourtPriceRuleUpdateWithWhereUniqueWithoutCourtInput | Prisma.CourtPriceRuleUpdateWithWhereUniqueWithoutCourtInput[] + updateMany?: Prisma.CourtPriceRuleUpdateManyWithWhereWithoutCourtInput | Prisma.CourtPriceRuleUpdateManyWithWhereWithoutCourtInput[] + deleteMany?: Prisma.CourtPriceRuleScalarWhereInput | Prisma.CourtPriceRuleScalarWhereInput[] +} + +export type CourtPriceRuleUncheckedUpdateManyWithoutCourtNestedInput = { + create?: Prisma.XOR | Prisma.CourtPriceRuleCreateWithoutCourtInput[] | Prisma.CourtPriceRuleUncheckedCreateWithoutCourtInput[] + connectOrCreate?: Prisma.CourtPriceRuleCreateOrConnectWithoutCourtInput | Prisma.CourtPriceRuleCreateOrConnectWithoutCourtInput[] + upsert?: Prisma.CourtPriceRuleUpsertWithWhereUniqueWithoutCourtInput | Prisma.CourtPriceRuleUpsertWithWhereUniqueWithoutCourtInput[] + createMany?: Prisma.CourtPriceRuleCreateManyCourtInputEnvelope + set?: Prisma.CourtPriceRuleWhereUniqueInput | Prisma.CourtPriceRuleWhereUniqueInput[] + disconnect?: Prisma.CourtPriceRuleWhereUniqueInput | Prisma.CourtPriceRuleWhereUniqueInput[] + delete?: Prisma.CourtPriceRuleWhereUniqueInput | Prisma.CourtPriceRuleWhereUniqueInput[] + connect?: Prisma.CourtPriceRuleWhereUniqueInput | Prisma.CourtPriceRuleWhereUniqueInput[] + update?: Prisma.CourtPriceRuleUpdateWithWhereUniqueWithoutCourtInput | Prisma.CourtPriceRuleUpdateWithWhereUniqueWithoutCourtInput[] + updateMany?: Prisma.CourtPriceRuleUpdateManyWithWhereWithoutCourtInput | Prisma.CourtPriceRuleUpdateManyWithWhereWithoutCourtInput[] + deleteMany?: Prisma.CourtPriceRuleScalarWhereInput | Prisma.CourtPriceRuleScalarWhereInput[] +} + +export type NullableEnumDayOfWeekFieldUpdateOperationsInput = { + set?: $Enums.DayOfWeek | null +} + +export type CourtPriceRuleCreateWithoutCourtInput = { + id: string + dayOfWeek?: $Enums.DayOfWeek | null + startTime?: string | null + endTime?: string | null + price: runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string +} + +export type CourtPriceRuleUncheckedCreateWithoutCourtInput = { + id: string + dayOfWeek?: $Enums.DayOfWeek | null + startTime?: string | null + endTime?: string | null + price: runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string +} + +export type CourtPriceRuleCreateOrConnectWithoutCourtInput = { + where: Prisma.CourtPriceRuleWhereUniqueInput + create: Prisma.XOR +} + +export type CourtPriceRuleCreateManyCourtInputEnvelope = { + data: Prisma.CourtPriceRuleCreateManyCourtInput | Prisma.CourtPriceRuleCreateManyCourtInput[] + skipDuplicates?: boolean +} + +export type CourtPriceRuleUpsertWithWhereUniqueWithoutCourtInput = { + where: Prisma.CourtPriceRuleWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type CourtPriceRuleUpdateWithWhereUniqueWithoutCourtInput = { + where: Prisma.CourtPriceRuleWhereUniqueInput + data: Prisma.XOR +} + +export type CourtPriceRuleUpdateManyWithWhereWithoutCourtInput = { + where: Prisma.CourtPriceRuleScalarWhereInput + data: Prisma.XOR +} + +export type CourtPriceRuleScalarWhereInput = { + AND?: Prisma.CourtPriceRuleScalarWhereInput | Prisma.CourtPriceRuleScalarWhereInput[] + OR?: Prisma.CourtPriceRuleScalarWhereInput[] + NOT?: Prisma.CourtPriceRuleScalarWhereInput | Prisma.CourtPriceRuleScalarWhereInput[] + id?: Prisma.UuidFilter<"CourtPriceRule"> | string + courtId?: Prisma.UuidFilter<"CourtPriceRule"> | string + dayOfWeek?: Prisma.EnumDayOfWeekNullableFilter<"CourtPriceRule"> | $Enums.DayOfWeek | null + startTime?: Prisma.StringNullableFilter<"CourtPriceRule"> | string | null + endTime?: Prisma.StringNullableFilter<"CourtPriceRule"> | string | null + price?: Prisma.DecimalFilter<"CourtPriceRule"> | runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: Prisma.BoolFilter<"CourtPriceRule"> | boolean + createdAt?: Prisma.DateTimeFilter<"CourtPriceRule"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"CourtPriceRule"> | Date | string +} + +export type CourtPriceRuleCreateManyCourtInput = { + id: string + dayOfWeek?: $Enums.DayOfWeek | null + startTime?: string | null + endTime?: string | null + price: runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string +} + +export type CourtPriceRuleUpdateWithoutCourtInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.NullableEnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek | null + startTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + endTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtPriceRuleUncheckedUpdateWithoutCourtInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.NullableEnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek | null + startTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + endTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type CourtPriceRuleUncheckedUpdateManyWithoutCourtInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + dayOfWeek?: Prisma.NullableEnumDayOfWeekFieldUpdateOperationsInput | $Enums.DayOfWeek | null + startTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + endTime?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + + +export type CourtPriceRuleSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + courtId?: boolean + dayOfWeek?: boolean + startTime?: boolean + endTime?: boolean + price?: boolean + isActive?: boolean + createdAt?: boolean + updatedAt?: boolean + court?: boolean | Prisma.CourtDefaultArgs +}, ExtArgs["result"]["courtPriceRule"]> + +export type CourtPriceRuleSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + courtId?: boolean + dayOfWeek?: boolean + startTime?: boolean + endTime?: boolean + price?: boolean + isActive?: boolean + createdAt?: boolean + updatedAt?: boolean + court?: boolean | Prisma.CourtDefaultArgs +}, ExtArgs["result"]["courtPriceRule"]> + +export type CourtPriceRuleSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + courtId?: boolean + dayOfWeek?: boolean + startTime?: boolean + endTime?: boolean + price?: boolean + isActive?: boolean + createdAt?: boolean + updatedAt?: boolean + court?: boolean | Prisma.CourtDefaultArgs +}, ExtArgs["result"]["courtPriceRule"]> + +export type CourtPriceRuleSelectScalar = { + id?: boolean + courtId?: boolean + dayOfWeek?: boolean + startTime?: boolean + endTime?: boolean + price?: boolean + isActive?: boolean + createdAt?: boolean + updatedAt?: boolean +} + +export type CourtPriceRuleOmit = runtime.Types.Extensions.GetOmit<"id" | "courtId" | "dayOfWeek" | "startTime" | "endTime" | "price" | "isActive" | "createdAt" | "updatedAt", ExtArgs["result"]["courtPriceRule"]> +export type CourtPriceRuleInclude = { + court?: boolean | Prisma.CourtDefaultArgs +} +export type CourtPriceRuleIncludeCreateManyAndReturn = { + court?: boolean | Prisma.CourtDefaultArgs +} +export type CourtPriceRuleIncludeUpdateManyAndReturn = { + court?: boolean | Prisma.CourtDefaultArgs +} + +export type $CourtPriceRulePayload = { + name: "CourtPriceRule" + objects: { + court: Prisma.$CourtPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + courtId: string + dayOfWeek: $Enums.DayOfWeek | null + startTime: string | null + endTime: string | null + price: runtime.Decimal + isActive: boolean + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["courtPriceRule"]> + composites: {} +} + +export type CourtPriceRuleGetPayload = runtime.Types.Result.GetResult + +export type CourtPriceRuleCountArgs = + Omit & { + select?: CourtPriceRuleCountAggregateInputType | true + } + +export interface CourtPriceRuleDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['CourtPriceRule'], meta: { name: 'CourtPriceRule' } } + /** + * Find zero or one CourtPriceRule that matches the filter. + * @param {CourtPriceRuleFindUniqueArgs} args - Arguments to find a CourtPriceRule + * @example + * // Get one CourtPriceRule + * const courtPriceRule = await prisma.courtPriceRule.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__CourtPriceRuleClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one CourtPriceRule that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {CourtPriceRuleFindUniqueOrThrowArgs} args - Arguments to find a CourtPriceRule + * @example + * // Get one CourtPriceRule + * const courtPriceRule = await prisma.courtPriceRule.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__CourtPriceRuleClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first CourtPriceRule 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 {CourtPriceRuleFindFirstArgs} args - Arguments to find a CourtPriceRule + * @example + * // Get one CourtPriceRule + * const courtPriceRule = await prisma.courtPriceRule.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__CourtPriceRuleClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first CourtPriceRule 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 {CourtPriceRuleFindFirstOrThrowArgs} args - Arguments to find a CourtPriceRule + * @example + * // Get one CourtPriceRule + * const courtPriceRule = await prisma.courtPriceRule.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__CourtPriceRuleClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more CourtPriceRules 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 {CourtPriceRuleFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all CourtPriceRules + * const courtPriceRules = await prisma.courtPriceRule.findMany() + * + * // Get first 10 CourtPriceRules + * const courtPriceRules = await prisma.courtPriceRule.findMany({ take: 10 }) + * + * // Only select the `id` + * const courtPriceRuleWithIdOnly = await prisma.courtPriceRule.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a CourtPriceRule. + * @param {CourtPriceRuleCreateArgs} args - Arguments to create a CourtPriceRule. + * @example + * // Create one CourtPriceRule + * const CourtPriceRule = await prisma.courtPriceRule.create({ + * data: { + * // ... data to create a CourtPriceRule + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__CourtPriceRuleClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many CourtPriceRules. + * @param {CourtPriceRuleCreateManyArgs} args - Arguments to create many CourtPriceRules. + * @example + * // Create many CourtPriceRules + * const courtPriceRule = await prisma.courtPriceRule.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many CourtPriceRules and returns the data saved in the database. + * @param {CourtPriceRuleCreateManyAndReturnArgs} args - Arguments to create many CourtPriceRules. + * @example + * // Create many CourtPriceRules + * const courtPriceRule = await prisma.courtPriceRule.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many CourtPriceRules and only return the `id` + * const courtPriceRuleWithIdOnly = await prisma.courtPriceRule.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 CourtPriceRule. + * @param {CourtPriceRuleDeleteArgs} args - Arguments to delete one CourtPriceRule. + * @example + * // Delete one CourtPriceRule + * const CourtPriceRule = await prisma.courtPriceRule.delete({ + * where: { + * // ... filter to delete one CourtPriceRule + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__CourtPriceRuleClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one CourtPriceRule. + * @param {CourtPriceRuleUpdateArgs} args - Arguments to update one CourtPriceRule. + * @example + * // Update one CourtPriceRule + * const courtPriceRule = await prisma.courtPriceRule.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__CourtPriceRuleClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more CourtPriceRules. + * @param {CourtPriceRuleDeleteManyArgs} args - Arguments to filter CourtPriceRules to delete. + * @example + * // Delete a few CourtPriceRules + * const { count } = await prisma.courtPriceRule.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more CourtPriceRules. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtPriceRuleUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many CourtPriceRules + * const courtPriceRule = await prisma.courtPriceRule.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more CourtPriceRules and returns the data updated in the database. + * @param {CourtPriceRuleUpdateManyAndReturnArgs} args - Arguments to update many CourtPriceRules. + * @example + * // Update many CourtPriceRules + * const courtPriceRule = await prisma.courtPriceRule.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more CourtPriceRules and only return the `id` + * const courtPriceRuleWithIdOnly = await prisma.courtPriceRule.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 CourtPriceRule. + * @param {CourtPriceRuleUpsertArgs} args - Arguments to update or create a CourtPriceRule. + * @example + * // Update or create a CourtPriceRule + * const courtPriceRule = await prisma.courtPriceRule.upsert({ + * create: { + * // ... data to create a CourtPriceRule + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the CourtPriceRule we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__CourtPriceRuleClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of CourtPriceRules. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtPriceRuleCountArgs} args - Arguments to filter CourtPriceRules to count. + * @example + * // Count the number of CourtPriceRules + * const count = await prisma.courtPriceRule.count({ + * where: { + * // ... the filter for the CourtPriceRules 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 CourtPriceRule. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtPriceRuleAggregateArgs} 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 CourtPriceRule. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CourtPriceRuleGroupByArgs} 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 CourtPriceRuleGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: CourtPriceRuleGroupByArgs['orderBy'] } + : { orderBy?: CourtPriceRuleGroupByArgs['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 ? GetCourtPriceRuleGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the CourtPriceRule model + */ +readonly fields: CourtPriceRuleFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for CourtPriceRule. + * 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__CourtPriceRuleClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + court = {}>(args?: Prisma.Subset>): Prisma.Prisma__CourtClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @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 CourtPriceRule model + */ +export interface CourtPriceRuleFieldRefs { + readonly id: Prisma.FieldRef<"CourtPriceRule", 'String'> + readonly courtId: Prisma.FieldRef<"CourtPriceRule", 'String'> + readonly dayOfWeek: Prisma.FieldRef<"CourtPriceRule", 'DayOfWeek'> + readonly startTime: Prisma.FieldRef<"CourtPriceRule", 'String'> + readonly endTime: Prisma.FieldRef<"CourtPriceRule", 'String'> + readonly price: Prisma.FieldRef<"CourtPriceRule", 'Decimal'> + readonly isActive: Prisma.FieldRef<"CourtPriceRule", 'Boolean'> + readonly createdAt: Prisma.FieldRef<"CourtPriceRule", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"CourtPriceRule", 'DateTime'> +} + + +// Custom InputTypes +/** + * CourtPriceRule findUnique + */ +export type CourtPriceRuleFindUniqueArgs = { + /** + * Select specific fields to fetch from the CourtPriceRule + */ + select?: Prisma.CourtPriceRuleSelect | null + /** + * Omit specific fields from the CourtPriceRule + */ + omit?: Prisma.CourtPriceRuleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtPriceRuleInclude | null + /** + * Filter, which CourtPriceRule to fetch. + */ + where: Prisma.CourtPriceRuleWhereUniqueInput +} + +/** + * CourtPriceRule findUniqueOrThrow + */ +export type CourtPriceRuleFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the CourtPriceRule + */ + select?: Prisma.CourtPriceRuleSelect | null + /** + * Omit specific fields from the CourtPriceRule + */ + omit?: Prisma.CourtPriceRuleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtPriceRuleInclude | null + /** + * Filter, which CourtPriceRule to fetch. + */ + where: Prisma.CourtPriceRuleWhereUniqueInput +} + +/** + * CourtPriceRule findFirst + */ +export type CourtPriceRuleFindFirstArgs = { + /** + * Select specific fields to fetch from the CourtPriceRule + */ + select?: Prisma.CourtPriceRuleSelect | null + /** + * Omit specific fields from the CourtPriceRule + */ + omit?: Prisma.CourtPriceRuleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtPriceRuleInclude | null + /** + * Filter, which CourtPriceRule to fetch. + */ + where?: Prisma.CourtPriceRuleWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CourtPriceRules to fetch. + */ + orderBy?: Prisma.CourtPriceRuleOrderByWithRelationInput | Prisma.CourtPriceRuleOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for CourtPriceRules. + */ + cursor?: Prisma.CourtPriceRuleWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CourtPriceRules 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` CourtPriceRules. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of CourtPriceRules. + */ + distinct?: Prisma.CourtPriceRuleScalarFieldEnum | Prisma.CourtPriceRuleScalarFieldEnum[] +} + +/** + * CourtPriceRule findFirstOrThrow + */ +export type CourtPriceRuleFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the CourtPriceRule + */ + select?: Prisma.CourtPriceRuleSelect | null + /** + * Omit specific fields from the CourtPriceRule + */ + omit?: Prisma.CourtPriceRuleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtPriceRuleInclude | null + /** + * Filter, which CourtPriceRule to fetch. + */ + where?: Prisma.CourtPriceRuleWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CourtPriceRules to fetch. + */ + orderBy?: Prisma.CourtPriceRuleOrderByWithRelationInput | Prisma.CourtPriceRuleOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for CourtPriceRules. + */ + cursor?: Prisma.CourtPriceRuleWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CourtPriceRules 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` CourtPriceRules. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of CourtPriceRules. + */ + distinct?: Prisma.CourtPriceRuleScalarFieldEnum | Prisma.CourtPriceRuleScalarFieldEnum[] +} + +/** + * CourtPriceRule findMany + */ +export type CourtPriceRuleFindManyArgs = { + /** + * Select specific fields to fetch from the CourtPriceRule + */ + select?: Prisma.CourtPriceRuleSelect | null + /** + * Omit specific fields from the CourtPriceRule + */ + omit?: Prisma.CourtPriceRuleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtPriceRuleInclude | null + /** + * Filter, which CourtPriceRules to fetch. + */ + where?: Prisma.CourtPriceRuleWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CourtPriceRules to fetch. + */ + orderBy?: Prisma.CourtPriceRuleOrderByWithRelationInput | Prisma.CourtPriceRuleOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing CourtPriceRules. + */ + cursor?: Prisma.CourtPriceRuleWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CourtPriceRules 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` CourtPriceRules. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of CourtPriceRules. + */ + distinct?: Prisma.CourtPriceRuleScalarFieldEnum | Prisma.CourtPriceRuleScalarFieldEnum[] +} + +/** + * CourtPriceRule create + */ +export type CourtPriceRuleCreateArgs = { + /** + * Select specific fields to fetch from the CourtPriceRule + */ + select?: Prisma.CourtPriceRuleSelect | null + /** + * Omit specific fields from the CourtPriceRule + */ + omit?: Prisma.CourtPriceRuleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtPriceRuleInclude | null + /** + * The data needed to create a CourtPriceRule. + */ + data: Prisma.XOR +} + +/** + * CourtPriceRule createMany + */ +export type CourtPriceRuleCreateManyArgs = { + /** + * The data used to create many CourtPriceRules. + */ + data: Prisma.CourtPriceRuleCreateManyInput | Prisma.CourtPriceRuleCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * CourtPriceRule createManyAndReturn + */ +export type CourtPriceRuleCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the CourtPriceRule + */ + select?: Prisma.CourtPriceRuleSelectCreateManyAndReturn | null + /** + * Omit specific fields from the CourtPriceRule + */ + omit?: Prisma.CourtPriceRuleOmit | null + /** + * The data used to create many CourtPriceRules. + */ + data: Prisma.CourtPriceRuleCreateManyInput | Prisma.CourtPriceRuleCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtPriceRuleIncludeCreateManyAndReturn | null +} + +/** + * CourtPriceRule update + */ +export type CourtPriceRuleUpdateArgs = { + /** + * Select specific fields to fetch from the CourtPriceRule + */ + select?: Prisma.CourtPriceRuleSelect | null + /** + * Omit specific fields from the CourtPriceRule + */ + omit?: Prisma.CourtPriceRuleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtPriceRuleInclude | null + /** + * The data needed to update a CourtPriceRule. + */ + data: Prisma.XOR + /** + * Choose, which CourtPriceRule to update. + */ + where: Prisma.CourtPriceRuleWhereUniqueInput +} + +/** + * CourtPriceRule updateMany + */ +export type CourtPriceRuleUpdateManyArgs = { + /** + * The data used to update CourtPriceRules. + */ + data: Prisma.XOR + /** + * Filter which CourtPriceRules to update + */ + where?: Prisma.CourtPriceRuleWhereInput + /** + * Limit how many CourtPriceRules to update. + */ + limit?: number +} + +/** + * CourtPriceRule updateManyAndReturn + */ +export type CourtPriceRuleUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the CourtPriceRule + */ + select?: Prisma.CourtPriceRuleSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the CourtPriceRule + */ + omit?: Prisma.CourtPriceRuleOmit | null + /** + * The data used to update CourtPriceRules. + */ + data: Prisma.XOR + /** + * Filter which CourtPriceRules to update + */ + where?: Prisma.CourtPriceRuleWhereInput + /** + * Limit how many CourtPriceRules to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtPriceRuleIncludeUpdateManyAndReturn | null +} + +/** + * CourtPriceRule upsert + */ +export type CourtPriceRuleUpsertArgs = { + /** + * Select specific fields to fetch from the CourtPriceRule + */ + select?: Prisma.CourtPriceRuleSelect | null + /** + * Omit specific fields from the CourtPriceRule + */ + omit?: Prisma.CourtPriceRuleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtPriceRuleInclude | null + /** + * The filter to search for the CourtPriceRule to update in case it exists. + */ + where: Prisma.CourtPriceRuleWhereUniqueInput + /** + * In case the CourtPriceRule found by the `where` argument doesn't exist, create a new CourtPriceRule with this data. + */ + create: Prisma.XOR + /** + * In case the CourtPriceRule was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * CourtPriceRule delete + */ +export type CourtPriceRuleDeleteArgs = { + /** + * Select specific fields to fetch from the CourtPriceRule + */ + select?: Prisma.CourtPriceRuleSelect | null + /** + * Omit specific fields from the CourtPriceRule + */ + omit?: Prisma.CourtPriceRuleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtPriceRuleInclude | null + /** + * Filter which CourtPriceRule to delete. + */ + where: Prisma.CourtPriceRuleWhereUniqueInput +} + +/** + * CourtPriceRule deleteMany + */ +export type CourtPriceRuleDeleteManyArgs = { + /** + * Filter which CourtPriceRules to delete + */ + where?: Prisma.CourtPriceRuleWhereInput + /** + * Limit how many CourtPriceRules to delete. + */ + limit?: number +} + +/** + * CourtPriceRule without action + */ +export type CourtPriceRuleDefaultArgs = { + /** + * Select specific fields to fetch from the CourtPriceRule + */ + select?: Prisma.CourtPriceRuleSelect | null + /** + * Omit specific fields from the CourtPriceRule + */ + omit?: Prisma.CourtPriceRuleOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtPriceRuleInclude | null +} diff --git a/apps/backend/src/generated/prisma/models/OnboardingRequest.ts b/apps/backend/src/generated/prisma/models/OnboardingRequest.ts new file mode 100644 index 0000000..3d51042 --- /dev/null +++ b/apps/backend/src/generated/prisma/models/OnboardingRequest.ts @@ -0,0 +1,1399 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `OnboardingRequest` 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" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model OnboardingRequest + * + */ +export type OnboardingRequestModel = runtime.Types.Result.DefaultSelection + +export type AggregateOnboardingRequest = { + _count: OnboardingRequestCountAggregateOutputType | null + _avg: OnboardingRequestAvgAggregateOutputType | null + _sum: OnboardingRequestSumAggregateOutputType | null + _min: OnboardingRequestMinAggregateOutputType | null + _max: OnboardingRequestMaxAggregateOutputType | null +} + +export type OnboardingRequestAvgAggregateOutputType = { + otpAttempts: number | null + otpResendCount: number | null +} + +export type OnboardingRequestSumAggregateOutputType = { + otpAttempts: number | null + otpResendCount: number | null +} + +export type OnboardingRequestMinAggregateOutputType = { + id: string | null + fullName: string | null + email: string | null + otpHash: string | null + otpExpiresAt: Date | null + otpAttempts: number | null + otpLastSentAt: Date | null + otpResendCount: number | null + emailVerifiedAt: Date | null + completedAt: Date | null + createdAt: Date | null + updatedAt: Date | null +} + +export type OnboardingRequestMaxAggregateOutputType = { + id: string | null + fullName: string | null + email: string | null + otpHash: string | null + otpExpiresAt: Date | null + otpAttempts: number | null + otpLastSentAt: Date | null + otpResendCount: number | null + emailVerifiedAt: Date | null + completedAt: Date | null + createdAt: Date | null + updatedAt: Date | null +} + +export type OnboardingRequestCountAggregateOutputType = { + id: number + fullName: number + email: number + otpHash: number + otpExpiresAt: number + otpAttempts: number + otpLastSentAt: number + otpResendCount: number + emailVerifiedAt: number + completedAt: number + createdAt: number + updatedAt: number + _all: number +} + + +export type OnboardingRequestAvgAggregateInputType = { + otpAttempts?: true + otpResendCount?: true +} + +export type OnboardingRequestSumAggregateInputType = { + otpAttempts?: true + otpResendCount?: true +} + +export type OnboardingRequestMinAggregateInputType = { + id?: true + fullName?: true + email?: true + otpHash?: true + otpExpiresAt?: true + otpAttempts?: true + otpLastSentAt?: true + otpResendCount?: true + emailVerifiedAt?: true + completedAt?: true + createdAt?: true + updatedAt?: true +} + +export type OnboardingRequestMaxAggregateInputType = { + id?: true + fullName?: true + email?: true + otpHash?: true + otpExpiresAt?: true + otpAttempts?: true + otpLastSentAt?: true + otpResendCount?: true + emailVerifiedAt?: true + completedAt?: true + createdAt?: true + updatedAt?: true +} + +export type OnboardingRequestCountAggregateInputType = { + id?: true + fullName?: true + email?: true + otpHash?: true + otpExpiresAt?: true + otpAttempts?: true + otpLastSentAt?: true + otpResendCount?: true + emailVerifiedAt?: true + completedAt?: true + createdAt?: true + updatedAt?: true + _all?: true +} + +export type OnboardingRequestAggregateArgs = { + /** + * Filter which OnboardingRequest to aggregate. + */ + where?: Prisma.OnboardingRequestWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OnboardingRequests to fetch. + */ + orderBy?: Prisma.OnboardingRequestOrderByWithRelationInput | Prisma.OnboardingRequestOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.OnboardingRequestWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OnboardingRequests 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` OnboardingRequests. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned OnboardingRequests + **/ + _count?: true | OnboardingRequestCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: OnboardingRequestAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: OnboardingRequestSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: OnboardingRequestMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: OnboardingRequestMaxAggregateInputType +} + +export type GetOnboardingRequestAggregateType = { + [P in keyof T & keyof AggregateOnboardingRequest]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type OnboardingRequestGroupByArgs = { + where?: Prisma.OnboardingRequestWhereInput + orderBy?: Prisma.OnboardingRequestOrderByWithAggregationInput | Prisma.OnboardingRequestOrderByWithAggregationInput[] + by: Prisma.OnboardingRequestScalarFieldEnum[] | Prisma.OnboardingRequestScalarFieldEnum + having?: Prisma.OnboardingRequestScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: OnboardingRequestCountAggregateInputType | true + _avg?: OnboardingRequestAvgAggregateInputType + _sum?: OnboardingRequestSumAggregateInputType + _min?: OnboardingRequestMinAggregateInputType + _max?: OnboardingRequestMaxAggregateInputType +} + +export type OnboardingRequestGroupByOutputType = { + id: string + fullName: string + email: string + otpHash: string + otpExpiresAt: Date + otpAttempts: number + otpLastSentAt: Date + otpResendCount: number + emailVerifiedAt: Date | null + completedAt: Date | null + createdAt: Date + updatedAt: Date + _count: OnboardingRequestCountAggregateOutputType | null + _avg: OnboardingRequestAvgAggregateOutputType | null + _sum: OnboardingRequestSumAggregateOutputType | null + _min: OnboardingRequestMinAggregateOutputType | null + _max: OnboardingRequestMaxAggregateOutputType | null +} + +export type GetOnboardingRequestGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof OnboardingRequestGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type OnboardingRequestWhereInput = { + AND?: Prisma.OnboardingRequestWhereInput | Prisma.OnboardingRequestWhereInput[] + OR?: Prisma.OnboardingRequestWhereInput[] + NOT?: Prisma.OnboardingRequestWhereInput | Prisma.OnboardingRequestWhereInput[] + id?: Prisma.UuidFilter<"OnboardingRequest"> | string + fullName?: Prisma.StringFilter<"OnboardingRequest"> | string + email?: Prisma.StringFilter<"OnboardingRequest"> | string + otpHash?: Prisma.StringFilter<"OnboardingRequest"> | string + otpExpiresAt?: Prisma.DateTimeFilter<"OnboardingRequest"> | Date | string + otpAttempts?: Prisma.IntFilter<"OnboardingRequest"> | number + otpLastSentAt?: Prisma.DateTimeFilter<"OnboardingRequest"> | Date | string + otpResendCount?: Prisma.IntFilter<"OnboardingRequest"> | number + emailVerifiedAt?: Prisma.DateTimeNullableFilter<"OnboardingRequest"> | Date | string | null + completedAt?: Prisma.DateTimeNullableFilter<"OnboardingRequest"> | Date | string | null + createdAt?: Prisma.DateTimeFilter<"OnboardingRequest"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"OnboardingRequest"> | Date | string +} + +export type OnboardingRequestOrderByWithRelationInput = { + id?: Prisma.SortOrder + fullName?: Prisma.SortOrder + email?: Prisma.SortOrder + otpHash?: Prisma.SortOrder + otpExpiresAt?: Prisma.SortOrder + otpAttempts?: Prisma.SortOrder + otpLastSentAt?: Prisma.SortOrder + otpResendCount?: Prisma.SortOrder + emailVerifiedAt?: Prisma.SortOrderInput | Prisma.SortOrder + completedAt?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type OnboardingRequestWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.OnboardingRequestWhereInput | Prisma.OnboardingRequestWhereInput[] + OR?: Prisma.OnboardingRequestWhereInput[] + NOT?: Prisma.OnboardingRequestWhereInput | Prisma.OnboardingRequestWhereInput[] + fullName?: Prisma.StringFilter<"OnboardingRequest"> | string + email?: Prisma.StringFilter<"OnboardingRequest"> | string + otpHash?: Prisma.StringFilter<"OnboardingRequest"> | string + otpExpiresAt?: Prisma.DateTimeFilter<"OnboardingRequest"> | Date | string + otpAttempts?: Prisma.IntFilter<"OnboardingRequest"> | number + otpLastSentAt?: Prisma.DateTimeFilter<"OnboardingRequest"> | Date | string + otpResendCount?: Prisma.IntFilter<"OnboardingRequest"> | number + emailVerifiedAt?: Prisma.DateTimeNullableFilter<"OnboardingRequest"> | Date | string | null + completedAt?: Prisma.DateTimeNullableFilter<"OnboardingRequest"> | Date | string | null + createdAt?: Prisma.DateTimeFilter<"OnboardingRequest"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"OnboardingRequest"> | Date | string +}, "id"> + +export type OnboardingRequestOrderByWithAggregationInput = { + id?: Prisma.SortOrder + fullName?: Prisma.SortOrder + email?: Prisma.SortOrder + otpHash?: Prisma.SortOrder + otpExpiresAt?: Prisma.SortOrder + otpAttempts?: Prisma.SortOrder + otpLastSentAt?: Prisma.SortOrder + otpResendCount?: Prisma.SortOrder + emailVerifiedAt?: Prisma.SortOrderInput | Prisma.SortOrder + completedAt?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + _count?: Prisma.OnboardingRequestCountOrderByAggregateInput + _avg?: Prisma.OnboardingRequestAvgOrderByAggregateInput + _max?: Prisma.OnboardingRequestMaxOrderByAggregateInput + _min?: Prisma.OnboardingRequestMinOrderByAggregateInput + _sum?: Prisma.OnboardingRequestSumOrderByAggregateInput +} + +export type OnboardingRequestScalarWhereWithAggregatesInput = { + AND?: Prisma.OnboardingRequestScalarWhereWithAggregatesInput | Prisma.OnboardingRequestScalarWhereWithAggregatesInput[] + OR?: Prisma.OnboardingRequestScalarWhereWithAggregatesInput[] + NOT?: Prisma.OnboardingRequestScalarWhereWithAggregatesInput | Prisma.OnboardingRequestScalarWhereWithAggregatesInput[] + id?: Prisma.UuidWithAggregatesFilter<"OnboardingRequest"> | string + fullName?: Prisma.StringWithAggregatesFilter<"OnboardingRequest"> | string + email?: Prisma.StringWithAggregatesFilter<"OnboardingRequest"> | string + otpHash?: Prisma.StringWithAggregatesFilter<"OnboardingRequest"> | string + otpExpiresAt?: Prisma.DateTimeWithAggregatesFilter<"OnboardingRequest"> | Date | string + otpAttempts?: Prisma.IntWithAggregatesFilter<"OnboardingRequest"> | number + otpLastSentAt?: Prisma.DateTimeWithAggregatesFilter<"OnboardingRequest"> | Date | string + otpResendCount?: Prisma.IntWithAggregatesFilter<"OnboardingRequest"> | number + emailVerifiedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"OnboardingRequest"> | Date | string | null + completedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"OnboardingRequest"> | Date | string | null + createdAt?: Prisma.DateTimeWithAggregatesFilter<"OnboardingRequest"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"OnboardingRequest"> | Date | string +} + +export type OnboardingRequestCreateInput = { + id: string + fullName: string + email: string + otpHash: string + otpExpiresAt: Date | string + otpAttempts?: number + otpLastSentAt: Date | string + otpResendCount?: number + emailVerifiedAt?: Date | string | null + completedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string +} + +export type OnboardingRequestUncheckedCreateInput = { + id: string + fullName: string + email: string + otpHash: string + otpExpiresAt: Date | string + otpAttempts?: number + otpLastSentAt: Date | string + otpResendCount?: number + emailVerifiedAt?: Date | string | null + completedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string +} + +export type OnboardingRequestUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + fullName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + otpHash?: Prisma.StringFieldUpdateOperationsInput | string + otpExpiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + otpAttempts?: Prisma.IntFieldUpdateOperationsInput | number + otpLastSentAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + otpResendCount?: Prisma.IntFieldUpdateOperationsInput | number + emailVerifiedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + completedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type OnboardingRequestUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + fullName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + otpHash?: Prisma.StringFieldUpdateOperationsInput | string + otpExpiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + otpAttempts?: Prisma.IntFieldUpdateOperationsInput | number + otpLastSentAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + otpResendCount?: Prisma.IntFieldUpdateOperationsInput | number + emailVerifiedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + completedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type OnboardingRequestCreateManyInput = { + id: string + fullName: string + email: string + otpHash: string + otpExpiresAt: Date | string + otpAttempts?: number + otpLastSentAt: Date | string + otpResendCount?: number + emailVerifiedAt?: Date | string | null + completedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string +} + +export type OnboardingRequestUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + fullName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + otpHash?: Prisma.StringFieldUpdateOperationsInput | string + otpExpiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + otpAttempts?: Prisma.IntFieldUpdateOperationsInput | number + otpLastSentAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + otpResendCount?: Prisma.IntFieldUpdateOperationsInput | number + emailVerifiedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + completedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type OnboardingRequestUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + fullName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + otpHash?: Prisma.StringFieldUpdateOperationsInput | string + otpExpiresAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + otpAttempts?: Prisma.IntFieldUpdateOperationsInput | number + otpLastSentAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + otpResendCount?: Prisma.IntFieldUpdateOperationsInput | number + emailVerifiedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + completedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type OnboardingRequestCountOrderByAggregateInput = { + id?: Prisma.SortOrder + fullName?: Prisma.SortOrder + email?: Prisma.SortOrder + otpHash?: Prisma.SortOrder + otpExpiresAt?: Prisma.SortOrder + otpAttempts?: Prisma.SortOrder + otpLastSentAt?: Prisma.SortOrder + otpResendCount?: Prisma.SortOrder + emailVerifiedAt?: Prisma.SortOrder + completedAt?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type OnboardingRequestAvgOrderByAggregateInput = { + otpAttempts?: Prisma.SortOrder + otpResendCount?: Prisma.SortOrder +} + +export type OnboardingRequestMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + fullName?: Prisma.SortOrder + email?: Prisma.SortOrder + otpHash?: Prisma.SortOrder + otpExpiresAt?: Prisma.SortOrder + otpAttempts?: Prisma.SortOrder + otpLastSentAt?: Prisma.SortOrder + otpResendCount?: Prisma.SortOrder + emailVerifiedAt?: Prisma.SortOrder + completedAt?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type OnboardingRequestMinOrderByAggregateInput = { + id?: Prisma.SortOrder + fullName?: Prisma.SortOrder + email?: Prisma.SortOrder + otpHash?: Prisma.SortOrder + otpExpiresAt?: Prisma.SortOrder + otpAttempts?: Prisma.SortOrder + otpLastSentAt?: Prisma.SortOrder + otpResendCount?: Prisma.SortOrder + emailVerifiedAt?: Prisma.SortOrder + completedAt?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type OnboardingRequestSumOrderByAggregateInput = { + otpAttempts?: Prisma.SortOrder + otpResendCount?: Prisma.SortOrder +} + +export type NullableDateTimeFieldUpdateOperationsInput = { + set?: Date | string | null +} + + + +export type OnboardingRequestSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + fullName?: boolean + email?: boolean + otpHash?: boolean + otpExpiresAt?: boolean + otpAttempts?: boolean + otpLastSentAt?: boolean + otpResendCount?: boolean + emailVerifiedAt?: boolean + completedAt?: boolean + createdAt?: boolean + updatedAt?: boolean +}, ExtArgs["result"]["onboardingRequest"]> + +export type OnboardingRequestSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + fullName?: boolean + email?: boolean + otpHash?: boolean + otpExpiresAt?: boolean + otpAttempts?: boolean + otpLastSentAt?: boolean + otpResendCount?: boolean + emailVerifiedAt?: boolean + completedAt?: boolean + createdAt?: boolean + updatedAt?: boolean +}, ExtArgs["result"]["onboardingRequest"]> + +export type OnboardingRequestSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + fullName?: boolean + email?: boolean + otpHash?: boolean + otpExpiresAt?: boolean + otpAttempts?: boolean + otpLastSentAt?: boolean + otpResendCount?: boolean + emailVerifiedAt?: boolean + completedAt?: boolean + createdAt?: boolean + updatedAt?: boolean +}, ExtArgs["result"]["onboardingRequest"]> + +export type OnboardingRequestSelectScalar = { + id?: boolean + fullName?: boolean + email?: boolean + otpHash?: boolean + otpExpiresAt?: boolean + otpAttempts?: boolean + otpLastSentAt?: boolean + otpResendCount?: boolean + emailVerifiedAt?: boolean + completedAt?: boolean + createdAt?: boolean + updatedAt?: boolean +} + +export type OnboardingRequestOmit = runtime.Types.Extensions.GetOmit<"id" | "fullName" | "email" | "otpHash" | "otpExpiresAt" | "otpAttempts" | "otpLastSentAt" | "otpResendCount" | "emailVerifiedAt" | "completedAt" | "createdAt" | "updatedAt", ExtArgs["result"]["onboardingRequest"]> + +export type $OnboardingRequestPayload = { + name: "OnboardingRequest" + objects: {} + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + fullName: string + email: string + otpHash: string + otpExpiresAt: Date + otpAttempts: number + otpLastSentAt: Date + otpResendCount: number + emailVerifiedAt: Date | null + completedAt: Date | null + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["onboardingRequest"]> + composites: {} +} + +export type OnboardingRequestGetPayload = runtime.Types.Result.GetResult + +export type OnboardingRequestCountArgs = + Omit & { + select?: OnboardingRequestCountAggregateInputType | true + } + +export interface OnboardingRequestDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['OnboardingRequest'], meta: { name: 'OnboardingRequest' } } + /** + * Find zero or one OnboardingRequest that matches the filter. + * @param {OnboardingRequestFindUniqueArgs} args - Arguments to find a OnboardingRequest + * @example + * // Get one OnboardingRequest + * const onboardingRequest = await prisma.onboardingRequest.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__OnboardingRequestClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one OnboardingRequest that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {OnboardingRequestFindUniqueOrThrowArgs} args - Arguments to find a OnboardingRequest + * @example + * // Get one OnboardingRequest + * const onboardingRequest = await prisma.onboardingRequest.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__OnboardingRequestClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first OnboardingRequest 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 {OnboardingRequestFindFirstArgs} args - Arguments to find a OnboardingRequest + * @example + * // Get one OnboardingRequest + * const onboardingRequest = await prisma.onboardingRequest.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__OnboardingRequestClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first OnboardingRequest 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 {OnboardingRequestFindFirstOrThrowArgs} args - Arguments to find a OnboardingRequest + * @example + * // Get one OnboardingRequest + * const onboardingRequest = await prisma.onboardingRequest.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__OnboardingRequestClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more OnboardingRequests 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 {OnboardingRequestFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all OnboardingRequests + * const onboardingRequests = await prisma.onboardingRequest.findMany() + * + * // Get first 10 OnboardingRequests + * const onboardingRequests = await prisma.onboardingRequest.findMany({ take: 10 }) + * + * // Only select the `id` + * const onboardingRequestWithIdOnly = await prisma.onboardingRequest.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a OnboardingRequest. + * @param {OnboardingRequestCreateArgs} args - Arguments to create a OnboardingRequest. + * @example + * // Create one OnboardingRequest + * const OnboardingRequest = await prisma.onboardingRequest.create({ + * data: { + * // ... data to create a OnboardingRequest + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__OnboardingRequestClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many OnboardingRequests. + * @param {OnboardingRequestCreateManyArgs} args - Arguments to create many OnboardingRequests. + * @example + * // Create many OnboardingRequests + * const onboardingRequest = await prisma.onboardingRequest.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many OnboardingRequests and returns the data saved in the database. + * @param {OnboardingRequestCreateManyAndReturnArgs} args - Arguments to create many OnboardingRequests. + * @example + * // Create many OnboardingRequests + * const onboardingRequest = await prisma.onboardingRequest.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many OnboardingRequests and only return the `id` + * const onboardingRequestWithIdOnly = await prisma.onboardingRequest.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 OnboardingRequest. + * @param {OnboardingRequestDeleteArgs} args - Arguments to delete one OnboardingRequest. + * @example + * // Delete one OnboardingRequest + * const OnboardingRequest = await prisma.onboardingRequest.delete({ + * where: { + * // ... filter to delete one OnboardingRequest + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__OnboardingRequestClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one OnboardingRequest. + * @param {OnboardingRequestUpdateArgs} args - Arguments to update one OnboardingRequest. + * @example + * // Update one OnboardingRequest + * const onboardingRequest = await prisma.onboardingRequest.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__OnboardingRequestClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more OnboardingRequests. + * @param {OnboardingRequestDeleteManyArgs} args - Arguments to filter OnboardingRequests to delete. + * @example + * // Delete a few OnboardingRequests + * const { count } = await prisma.onboardingRequest.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more OnboardingRequests. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OnboardingRequestUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many OnboardingRequests + * const onboardingRequest = await prisma.onboardingRequest.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more OnboardingRequests and returns the data updated in the database. + * @param {OnboardingRequestUpdateManyAndReturnArgs} args - Arguments to update many OnboardingRequests. + * @example + * // Update many OnboardingRequests + * const onboardingRequest = await prisma.onboardingRequest.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more OnboardingRequests and only return the `id` + * const onboardingRequestWithIdOnly = await prisma.onboardingRequest.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 OnboardingRequest. + * @param {OnboardingRequestUpsertArgs} args - Arguments to update or create a OnboardingRequest. + * @example + * // Update or create a OnboardingRequest + * const onboardingRequest = await prisma.onboardingRequest.upsert({ + * create: { + * // ... data to create a OnboardingRequest + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the OnboardingRequest we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__OnboardingRequestClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of OnboardingRequests. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OnboardingRequestCountArgs} args - Arguments to filter OnboardingRequests to count. + * @example + * // Count the number of OnboardingRequests + * const count = await prisma.onboardingRequest.count({ + * where: { + * // ... the filter for the OnboardingRequests 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 OnboardingRequest. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OnboardingRequestAggregateArgs} 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 OnboardingRequest. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OnboardingRequestGroupByArgs} 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 OnboardingRequestGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: OnboardingRequestGroupByArgs['orderBy'] } + : { orderBy?: OnboardingRequestGroupByArgs['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 ? GetOnboardingRequestGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the OnboardingRequest model + */ +readonly fields: OnboardingRequestFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for OnboardingRequest. + * 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__OnboardingRequestClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * 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 OnboardingRequest model + */ +export interface OnboardingRequestFieldRefs { + readonly id: Prisma.FieldRef<"OnboardingRequest", 'String'> + readonly fullName: Prisma.FieldRef<"OnboardingRequest", 'String'> + readonly email: Prisma.FieldRef<"OnboardingRequest", 'String'> + readonly otpHash: Prisma.FieldRef<"OnboardingRequest", 'String'> + readonly otpExpiresAt: Prisma.FieldRef<"OnboardingRequest", 'DateTime'> + readonly otpAttempts: Prisma.FieldRef<"OnboardingRequest", 'Int'> + readonly otpLastSentAt: Prisma.FieldRef<"OnboardingRequest", 'DateTime'> + readonly otpResendCount: Prisma.FieldRef<"OnboardingRequest", 'Int'> + readonly emailVerifiedAt: Prisma.FieldRef<"OnboardingRequest", 'DateTime'> + readonly completedAt: Prisma.FieldRef<"OnboardingRequest", 'DateTime'> + readonly createdAt: Prisma.FieldRef<"OnboardingRequest", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"OnboardingRequest", 'DateTime'> +} + + +// Custom InputTypes +/** + * OnboardingRequest findUnique + */ +export type OnboardingRequestFindUniqueArgs = { + /** + * Select specific fields to fetch from the OnboardingRequest + */ + select?: Prisma.OnboardingRequestSelect | null + /** + * Omit specific fields from the OnboardingRequest + */ + omit?: Prisma.OnboardingRequestOmit | null + /** + * Filter, which OnboardingRequest to fetch. + */ + where: Prisma.OnboardingRequestWhereUniqueInput +} + +/** + * OnboardingRequest findUniqueOrThrow + */ +export type OnboardingRequestFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the OnboardingRequest + */ + select?: Prisma.OnboardingRequestSelect | null + /** + * Omit specific fields from the OnboardingRequest + */ + omit?: Prisma.OnboardingRequestOmit | null + /** + * Filter, which OnboardingRequest to fetch. + */ + where: Prisma.OnboardingRequestWhereUniqueInput +} + +/** + * OnboardingRequest findFirst + */ +export type OnboardingRequestFindFirstArgs = { + /** + * Select specific fields to fetch from the OnboardingRequest + */ + select?: Prisma.OnboardingRequestSelect | null + /** + * Omit specific fields from the OnboardingRequest + */ + omit?: Prisma.OnboardingRequestOmit | null + /** + * Filter, which OnboardingRequest to fetch. + */ + where?: Prisma.OnboardingRequestWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OnboardingRequests to fetch. + */ + orderBy?: Prisma.OnboardingRequestOrderByWithRelationInput | Prisma.OnboardingRequestOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for OnboardingRequests. + */ + cursor?: Prisma.OnboardingRequestWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OnboardingRequests 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` OnboardingRequests. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of OnboardingRequests. + */ + distinct?: Prisma.OnboardingRequestScalarFieldEnum | Prisma.OnboardingRequestScalarFieldEnum[] +} + +/** + * OnboardingRequest findFirstOrThrow + */ +export type OnboardingRequestFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the OnboardingRequest + */ + select?: Prisma.OnboardingRequestSelect | null + /** + * Omit specific fields from the OnboardingRequest + */ + omit?: Prisma.OnboardingRequestOmit | null + /** + * Filter, which OnboardingRequest to fetch. + */ + where?: Prisma.OnboardingRequestWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OnboardingRequests to fetch. + */ + orderBy?: Prisma.OnboardingRequestOrderByWithRelationInput | Prisma.OnboardingRequestOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for OnboardingRequests. + */ + cursor?: Prisma.OnboardingRequestWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OnboardingRequests 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` OnboardingRequests. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of OnboardingRequests. + */ + distinct?: Prisma.OnboardingRequestScalarFieldEnum | Prisma.OnboardingRequestScalarFieldEnum[] +} + +/** + * OnboardingRequest findMany + */ +export type OnboardingRequestFindManyArgs = { + /** + * Select specific fields to fetch from the OnboardingRequest + */ + select?: Prisma.OnboardingRequestSelect | null + /** + * Omit specific fields from the OnboardingRequest + */ + omit?: Prisma.OnboardingRequestOmit | null + /** + * Filter, which OnboardingRequests to fetch. + */ + where?: Prisma.OnboardingRequestWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OnboardingRequests to fetch. + */ + orderBy?: Prisma.OnboardingRequestOrderByWithRelationInput | Prisma.OnboardingRequestOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing OnboardingRequests. + */ + cursor?: Prisma.OnboardingRequestWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OnboardingRequests 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` OnboardingRequests. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of OnboardingRequests. + */ + distinct?: Prisma.OnboardingRequestScalarFieldEnum | Prisma.OnboardingRequestScalarFieldEnum[] +} + +/** + * OnboardingRequest create + */ +export type OnboardingRequestCreateArgs = { + /** + * Select specific fields to fetch from the OnboardingRequest + */ + select?: Prisma.OnboardingRequestSelect | null + /** + * Omit specific fields from the OnboardingRequest + */ + omit?: Prisma.OnboardingRequestOmit | null + /** + * The data needed to create a OnboardingRequest. + */ + data: Prisma.XOR +} + +/** + * OnboardingRequest createMany + */ +export type OnboardingRequestCreateManyArgs = { + /** + * The data used to create many OnboardingRequests. + */ + data: Prisma.OnboardingRequestCreateManyInput | Prisma.OnboardingRequestCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * OnboardingRequest createManyAndReturn + */ +export type OnboardingRequestCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the OnboardingRequest + */ + select?: Prisma.OnboardingRequestSelectCreateManyAndReturn | null + /** + * Omit specific fields from the OnboardingRequest + */ + omit?: Prisma.OnboardingRequestOmit | null + /** + * The data used to create many OnboardingRequests. + */ + data: Prisma.OnboardingRequestCreateManyInput | Prisma.OnboardingRequestCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * OnboardingRequest update + */ +export type OnboardingRequestUpdateArgs = { + /** + * Select specific fields to fetch from the OnboardingRequest + */ + select?: Prisma.OnboardingRequestSelect | null + /** + * Omit specific fields from the OnboardingRequest + */ + omit?: Prisma.OnboardingRequestOmit | null + /** + * The data needed to update a OnboardingRequest. + */ + data: Prisma.XOR + /** + * Choose, which OnboardingRequest to update. + */ + where: Prisma.OnboardingRequestWhereUniqueInput +} + +/** + * OnboardingRequest updateMany + */ +export type OnboardingRequestUpdateManyArgs = { + /** + * The data used to update OnboardingRequests. + */ + data: Prisma.XOR + /** + * Filter which OnboardingRequests to update + */ + where?: Prisma.OnboardingRequestWhereInput + /** + * Limit how many OnboardingRequests to update. + */ + limit?: number +} + +/** + * OnboardingRequest updateManyAndReturn + */ +export type OnboardingRequestUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the OnboardingRequest + */ + select?: Prisma.OnboardingRequestSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the OnboardingRequest + */ + omit?: Prisma.OnboardingRequestOmit | null + /** + * The data used to update OnboardingRequests. + */ + data: Prisma.XOR + /** + * Filter which OnboardingRequests to update + */ + where?: Prisma.OnboardingRequestWhereInput + /** + * Limit how many OnboardingRequests to update. + */ + limit?: number +} + +/** + * OnboardingRequest upsert + */ +export type OnboardingRequestUpsertArgs = { + /** + * Select specific fields to fetch from the OnboardingRequest + */ + select?: Prisma.OnboardingRequestSelect | null + /** + * Omit specific fields from the OnboardingRequest + */ + omit?: Prisma.OnboardingRequestOmit | null + /** + * The filter to search for the OnboardingRequest to update in case it exists. + */ + where: Prisma.OnboardingRequestWhereUniqueInput + /** + * In case the OnboardingRequest found by the `where` argument doesn't exist, create a new OnboardingRequest with this data. + */ + create: Prisma.XOR + /** + * In case the OnboardingRequest was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * OnboardingRequest delete + */ +export type OnboardingRequestDeleteArgs = { + /** + * Select specific fields to fetch from the OnboardingRequest + */ + select?: Prisma.OnboardingRequestSelect | null + /** + * Omit specific fields from the OnboardingRequest + */ + omit?: Prisma.OnboardingRequestOmit | null + /** + * Filter which OnboardingRequest to delete. + */ + where: Prisma.OnboardingRequestWhereUniqueInput +} + +/** + * OnboardingRequest deleteMany + */ +export type OnboardingRequestDeleteManyArgs = { + /** + * Filter which OnboardingRequests to delete + */ + where?: Prisma.OnboardingRequestWhereInput + /** + * Limit how many OnboardingRequests to delete. + */ + limit?: number +} + +/** + * OnboardingRequest without action + */ +export type OnboardingRequestDefaultArgs = { + /** + * Select specific fields to fetch from the OnboardingRequest + */ + select?: Prisma.OnboardingRequestSelect | null + /** + * Omit specific fields from the OnboardingRequest + */ + omit?: Prisma.OnboardingRequestOmit | null +} diff --git a/apps/backend/src/generated/prisma/models/Plan.ts b/apps/backend/src/generated/prisma/models/Plan.ts new file mode 100644 index 0000000..5320a8c --- /dev/null +++ b/apps/backend/src/generated/prisma/models/Plan.ts @@ -0,0 +1,1367 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Plan` 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" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model Plan + * + */ +export type PlanModel = runtime.Types.Result.DefaultSelection + +export type AggregatePlan = { + _count: PlanCountAggregateOutputType | null + _avg: PlanAvgAggregateOutputType | null + _sum: PlanSumAggregateOutputType | null + _min: PlanMinAggregateOutputType | null + _max: PlanMaxAggregateOutputType | null +} + +export type PlanAvgAggregateOutputType = { + price: runtime.Decimal | null +} + +export type PlanSumAggregateOutputType = { + price: runtime.Decimal | null +} + +export type PlanMinAggregateOutputType = { + code: string | null + name: string | null + price: runtime.Decimal | null + lastUpdatedAt: Date | null +} + +export type PlanMaxAggregateOutputType = { + code: string | null + name: string | null + price: runtime.Decimal | null + lastUpdatedAt: Date | null +} + +export type PlanCountAggregateOutputType = { + code: number + name: number + price: number + rules: number + lastUpdatedAt: number + _all: number +} + + +export type PlanAvgAggregateInputType = { + price?: true +} + +export type PlanSumAggregateInputType = { + price?: true +} + +export type PlanMinAggregateInputType = { + code?: true + name?: true + price?: true + lastUpdatedAt?: true +} + +export type PlanMaxAggregateInputType = { + code?: true + name?: true + price?: true + lastUpdatedAt?: true +} + +export type PlanCountAggregateInputType = { + code?: true + name?: true + price?: true + rules?: true + lastUpdatedAt?: true + _all?: true +} + +export type PlanAggregateArgs = { + /** + * Filter which Plan to aggregate. + */ + where?: Prisma.PlanWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Plans to fetch. + */ + orderBy?: Prisma.PlanOrderByWithRelationInput | Prisma.PlanOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.PlanWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Plans 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` Plans. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Plans + **/ + _count?: true | PlanCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: PlanAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: PlanSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: PlanMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: PlanMaxAggregateInputType +} + +export type GetPlanAggregateType = { + [P in keyof T & keyof AggregatePlan]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type PlanGroupByArgs = { + where?: Prisma.PlanWhereInput + orderBy?: Prisma.PlanOrderByWithAggregationInput | Prisma.PlanOrderByWithAggregationInput[] + by: Prisma.PlanScalarFieldEnum[] | Prisma.PlanScalarFieldEnum + having?: Prisma.PlanScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: PlanCountAggregateInputType | true + _avg?: PlanAvgAggregateInputType + _sum?: PlanSumAggregateInputType + _min?: PlanMinAggregateInputType + _max?: PlanMaxAggregateInputType +} + +export type PlanGroupByOutputType = { + code: string + name: string + price: runtime.Decimal + rules: runtime.JsonValue + lastUpdatedAt: Date + _count: PlanCountAggregateOutputType | null + _avg: PlanAvgAggregateOutputType | null + _sum: PlanSumAggregateOutputType | null + _min: PlanMinAggregateOutputType | null + _max: PlanMaxAggregateOutputType | null +} + +export type GetPlanGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof PlanGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type PlanWhereInput = { + AND?: Prisma.PlanWhereInput | Prisma.PlanWhereInput[] + OR?: Prisma.PlanWhereInput[] + NOT?: Prisma.PlanWhereInput | Prisma.PlanWhereInput[] + code?: Prisma.StringFilter<"Plan"> | string + name?: Prisma.StringFilter<"Plan"> | string + price?: Prisma.DecimalFilter<"Plan"> | runtime.Decimal | runtime.DecimalJsLike | number | string + rules?: Prisma.JsonFilter<"Plan"> + lastUpdatedAt?: Prisma.DateTimeFilter<"Plan"> | Date | string + complexes?: Prisma.ComplexListRelationFilter +} + +export type PlanOrderByWithRelationInput = { + code?: Prisma.SortOrder + name?: Prisma.SortOrder + price?: Prisma.SortOrder + rules?: Prisma.SortOrder + lastUpdatedAt?: Prisma.SortOrder + complexes?: Prisma.ComplexOrderByRelationAggregateInput +} + +export type PlanWhereUniqueInput = Prisma.AtLeast<{ + code?: string + AND?: Prisma.PlanWhereInput | Prisma.PlanWhereInput[] + OR?: Prisma.PlanWhereInput[] + NOT?: Prisma.PlanWhereInput | Prisma.PlanWhereInput[] + name?: Prisma.StringFilter<"Plan"> | string + price?: Prisma.DecimalFilter<"Plan"> | runtime.Decimal | runtime.DecimalJsLike | number | string + rules?: Prisma.JsonFilter<"Plan"> + lastUpdatedAt?: Prisma.DateTimeFilter<"Plan"> | Date | string + complexes?: Prisma.ComplexListRelationFilter +}, "code"> + +export type PlanOrderByWithAggregationInput = { + code?: Prisma.SortOrder + name?: Prisma.SortOrder + price?: Prisma.SortOrder + rules?: Prisma.SortOrder + lastUpdatedAt?: Prisma.SortOrder + _count?: Prisma.PlanCountOrderByAggregateInput + _avg?: Prisma.PlanAvgOrderByAggregateInput + _max?: Prisma.PlanMaxOrderByAggregateInput + _min?: Prisma.PlanMinOrderByAggregateInput + _sum?: Prisma.PlanSumOrderByAggregateInput +} + +export type PlanScalarWhereWithAggregatesInput = { + AND?: Prisma.PlanScalarWhereWithAggregatesInput | Prisma.PlanScalarWhereWithAggregatesInput[] + OR?: Prisma.PlanScalarWhereWithAggregatesInput[] + NOT?: Prisma.PlanScalarWhereWithAggregatesInput | Prisma.PlanScalarWhereWithAggregatesInput[] + code?: Prisma.StringWithAggregatesFilter<"Plan"> | string + name?: Prisma.StringWithAggregatesFilter<"Plan"> | string + price?: Prisma.DecimalWithAggregatesFilter<"Plan"> | runtime.Decimal | runtime.DecimalJsLike | number | string + rules?: Prisma.JsonWithAggregatesFilter<"Plan"> + lastUpdatedAt?: Prisma.DateTimeWithAggregatesFilter<"Plan"> | Date | string +} + +export type PlanCreateInput = { + code: string + name: string + price: runtime.Decimal | runtime.DecimalJsLike | number | string + rules: Prisma.JsonNullValueInput | runtime.InputJsonValue + lastUpdatedAt?: Date | string + complexes?: Prisma.ComplexCreateNestedManyWithoutPlanInput +} + +export type PlanUncheckedCreateInput = { + code: string + name: string + price: runtime.Decimal | runtime.DecimalJsLike | number | string + rules: Prisma.JsonNullValueInput | runtime.InputJsonValue + lastUpdatedAt?: Date | string + complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutPlanInput +} + +export type PlanUpdateInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + rules?: Prisma.JsonNullValueInput | runtime.InputJsonValue + lastUpdatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complexes?: Prisma.ComplexUpdateManyWithoutPlanNestedInput +} + +export type PlanUncheckedUpdateInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + rules?: Prisma.JsonNullValueInput | runtime.InputJsonValue + lastUpdatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complexes?: Prisma.ComplexUncheckedUpdateManyWithoutPlanNestedInput +} + +export type PlanCreateManyInput = { + code: string + name: string + price: runtime.Decimal | runtime.DecimalJsLike | number | string + rules: Prisma.JsonNullValueInput | runtime.InputJsonValue + lastUpdatedAt?: Date | string +} + +export type PlanUpdateManyMutationInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + rules?: Prisma.JsonNullValueInput | runtime.InputJsonValue + lastUpdatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type PlanUncheckedUpdateManyInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + rules?: Prisma.JsonNullValueInput | runtime.InputJsonValue + lastUpdatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type PlanNullableScalarRelationFilter = { + is?: Prisma.PlanWhereInput | null + isNot?: Prisma.PlanWhereInput | null +} + +export type PlanCountOrderByAggregateInput = { + code?: Prisma.SortOrder + name?: Prisma.SortOrder + price?: Prisma.SortOrder + rules?: Prisma.SortOrder + lastUpdatedAt?: Prisma.SortOrder +} + +export type PlanAvgOrderByAggregateInput = { + price?: Prisma.SortOrder +} + +export type PlanMaxOrderByAggregateInput = { + code?: Prisma.SortOrder + name?: Prisma.SortOrder + price?: Prisma.SortOrder + lastUpdatedAt?: Prisma.SortOrder +} + +export type PlanMinOrderByAggregateInput = { + code?: Prisma.SortOrder + name?: Prisma.SortOrder + price?: Prisma.SortOrder + lastUpdatedAt?: Prisma.SortOrder +} + +export type PlanSumOrderByAggregateInput = { + price?: Prisma.SortOrder +} + +export type PlanCreateNestedOneWithoutComplexesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PlanCreateOrConnectWithoutComplexesInput + connect?: Prisma.PlanWhereUniqueInput +} + +export type PlanUpdateOneWithoutComplexesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PlanCreateOrConnectWithoutComplexesInput + upsert?: Prisma.PlanUpsertWithoutComplexesInput + disconnect?: Prisma.PlanWhereInput | boolean + delete?: Prisma.PlanWhereInput | boolean + connect?: Prisma.PlanWhereUniqueInput + update?: Prisma.XOR, Prisma.PlanUncheckedUpdateWithoutComplexesInput> +} + +export type PlanCreateWithoutComplexesInput = { + code: string + name: string + price: runtime.Decimal | runtime.DecimalJsLike | number | string + rules: Prisma.JsonNullValueInput | runtime.InputJsonValue + lastUpdatedAt?: Date | string +} + +export type PlanUncheckedCreateWithoutComplexesInput = { + code: string + name: string + price: runtime.Decimal | runtime.DecimalJsLike | number | string + rules: Prisma.JsonNullValueInput | runtime.InputJsonValue + lastUpdatedAt?: Date | string +} + +export type PlanCreateOrConnectWithoutComplexesInput = { + where: Prisma.PlanWhereUniqueInput + create: Prisma.XOR +} + +export type PlanUpsertWithoutComplexesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.PlanWhereInput +} + +export type PlanUpdateToOneWithWhereWithoutComplexesInput = { + where?: Prisma.PlanWhereInput + data: Prisma.XOR +} + +export type PlanUpdateWithoutComplexesInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + rules?: Prisma.JsonNullValueInput | runtime.InputJsonValue + lastUpdatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type PlanUncheckedUpdateWithoutComplexesInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + rules?: Prisma.JsonNullValueInput | runtime.InputJsonValue + lastUpdatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + +/** + * Count Type PlanCountOutputType + */ + +export type PlanCountOutputType = { + complexes: number +} + +export type PlanCountOutputTypeSelect = { + complexes?: boolean | PlanCountOutputTypeCountComplexesArgs +} + +/** + * PlanCountOutputType without action + */ +export type PlanCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the PlanCountOutputType + */ + select?: Prisma.PlanCountOutputTypeSelect | null +} + +/** + * PlanCountOutputType without action + */ +export type PlanCountOutputTypeCountComplexesArgs = { + where?: Prisma.ComplexWhereInput +} + + +export type PlanSelect = runtime.Types.Extensions.GetSelect<{ + code?: boolean + name?: boolean + price?: boolean + rules?: boolean + lastUpdatedAt?: boolean + complexes?: boolean | Prisma.Plan$complexesArgs + _count?: boolean | Prisma.PlanCountOutputTypeDefaultArgs +}, ExtArgs["result"]["plan"]> + +export type PlanSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + code?: boolean + name?: boolean + price?: boolean + rules?: boolean + lastUpdatedAt?: boolean +}, ExtArgs["result"]["plan"]> + +export type PlanSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + code?: boolean + name?: boolean + price?: boolean + rules?: boolean + lastUpdatedAt?: boolean +}, ExtArgs["result"]["plan"]> + +export type PlanSelectScalar = { + code?: boolean + name?: boolean + price?: boolean + rules?: boolean + lastUpdatedAt?: boolean +} + +export type PlanOmit = runtime.Types.Extensions.GetOmit<"code" | "name" | "price" | "rules" | "lastUpdatedAt", ExtArgs["result"]["plan"]> +export type PlanInclude = { + complexes?: boolean | Prisma.Plan$complexesArgs + _count?: boolean | Prisma.PlanCountOutputTypeDefaultArgs +} +export type PlanIncludeCreateManyAndReturn = {} +export type PlanIncludeUpdateManyAndReturn = {} + +export type $PlanPayload = { + name: "Plan" + objects: { + complexes: Prisma.$ComplexPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + code: string + name: string + price: runtime.Decimal + rules: runtime.JsonValue + lastUpdatedAt: Date + }, ExtArgs["result"]["plan"]> + composites: {} +} + +export type PlanGetPayload = runtime.Types.Result.GetResult + +export type PlanCountArgs = + Omit & { + select?: PlanCountAggregateInputType | true + } + +export interface PlanDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Plan'], meta: { name: 'Plan' } } + /** + * Find zero or one Plan that matches the filter. + * @param {PlanFindUniqueArgs} args - Arguments to find a Plan + * @example + * // Get one Plan + * const plan = await prisma.plan.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__PlanClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Plan that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {PlanFindUniqueOrThrowArgs} args - Arguments to find a Plan + * @example + * // Get one Plan + * const plan = await prisma.plan.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__PlanClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Plan 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 {PlanFindFirstArgs} args - Arguments to find a Plan + * @example + * // Get one Plan + * const plan = await prisma.plan.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__PlanClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Plan 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 {PlanFindFirstOrThrowArgs} args - Arguments to find a Plan + * @example + * // Get one Plan + * const plan = await prisma.plan.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__PlanClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Plans 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 {PlanFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Plans + * const plans = await prisma.plan.findMany() + * + * // Get first 10 Plans + * const plans = await prisma.plan.findMany({ take: 10 }) + * + * // Only select the `code` + * const planWithCodeOnly = await prisma.plan.findMany({ select: { code: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Plan. + * @param {PlanCreateArgs} args - Arguments to create a Plan. + * @example + * // Create one Plan + * const Plan = await prisma.plan.create({ + * data: { + * // ... data to create a Plan + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__PlanClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Plans. + * @param {PlanCreateManyArgs} args - Arguments to create many Plans. + * @example + * // Create many Plans + * const plan = await prisma.plan.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Plans and returns the data saved in the database. + * @param {PlanCreateManyAndReturnArgs} args - Arguments to create many Plans. + * @example + * // Create many Plans + * const plan = await prisma.plan.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Plans and only return the `code` + * const planWithCodeOnly = await prisma.plan.createManyAndReturn({ + * select: { code: 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 Plan. + * @param {PlanDeleteArgs} args - Arguments to delete one Plan. + * @example + * // Delete one Plan + * const Plan = await prisma.plan.delete({ + * where: { + * // ... filter to delete one Plan + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__PlanClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Plan. + * @param {PlanUpdateArgs} args - Arguments to update one Plan. + * @example + * // Update one Plan + * const plan = await prisma.plan.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__PlanClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Plans. + * @param {PlanDeleteManyArgs} args - Arguments to filter Plans to delete. + * @example + * // Delete a few Plans + * const { count } = await prisma.plan.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Plans. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PlanUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Plans + * const plan = await prisma.plan.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Plans and returns the data updated in the database. + * @param {PlanUpdateManyAndReturnArgs} args - Arguments to update many Plans. + * @example + * // Update many Plans + * const plan = await prisma.plan.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Plans and only return the `code` + * const planWithCodeOnly = await prisma.plan.updateManyAndReturn({ + * select: { code: 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 Plan. + * @param {PlanUpsertArgs} args - Arguments to update or create a Plan. + * @example + * // Update or create a Plan + * const plan = await prisma.plan.upsert({ + * create: { + * // ... data to create a Plan + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Plan we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__PlanClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Plans. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PlanCountArgs} args - Arguments to filter Plans to count. + * @example + * // Count the number of Plans + * const count = await prisma.plan.count({ + * where: { + * // ... the filter for the Plans 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 Plan. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PlanAggregateArgs} 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 Plan. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PlanGroupByArgs} 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 PlanGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: PlanGroupByArgs['orderBy'] } + : { orderBy?: PlanGroupByArgs['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 ? GetPlanGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Plan model + */ +readonly fields: PlanFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Plan. + * 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__PlanClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + complexes = {}>(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 Plan model + */ +export interface PlanFieldRefs { + readonly code: Prisma.FieldRef<"Plan", 'String'> + readonly name: Prisma.FieldRef<"Plan", 'String'> + readonly price: Prisma.FieldRef<"Plan", 'Decimal'> + readonly rules: Prisma.FieldRef<"Plan", 'Json'> + readonly lastUpdatedAt: Prisma.FieldRef<"Plan", 'DateTime'> +} + + +// Custom InputTypes +/** + * Plan findUnique + */ +export type PlanFindUniqueArgs = { + /** + * Select specific fields to fetch from the Plan + */ + select?: Prisma.PlanSelect | null + /** + * Omit specific fields from the Plan + */ + omit?: Prisma.PlanOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PlanInclude | null + /** + * Filter, which Plan to fetch. + */ + where: Prisma.PlanWhereUniqueInput +} + +/** + * Plan findUniqueOrThrow + */ +export type PlanFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Plan + */ + select?: Prisma.PlanSelect | null + /** + * Omit specific fields from the Plan + */ + omit?: Prisma.PlanOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PlanInclude | null + /** + * Filter, which Plan to fetch. + */ + where: Prisma.PlanWhereUniqueInput +} + +/** + * Plan findFirst + */ +export type PlanFindFirstArgs = { + /** + * Select specific fields to fetch from the Plan + */ + select?: Prisma.PlanSelect | null + /** + * Omit specific fields from the Plan + */ + omit?: Prisma.PlanOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PlanInclude | null + /** + * Filter, which Plan to fetch. + */ + where?: Prisma.PlanWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Plans to fetch. + */ + orderBy?: Prisma.PlanOrderByWithRelationInput | Prisma.PlanOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Plans. + */ + cursor?: Prisma.PlanWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Plans 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` Plans. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Plans. + */ + distinct?: Prisma.PlanScalarFieldEnum | Prisma.PlanScalarFieldEnum[] +} + +/** + * Plan findFirstOrThrow + */ +export type PlanFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Plan + */ + select?: Prisma.PlanSelect | null + /** + * Omit specific fields from the Plan + */ + omit?: Prisma.PlanOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PlanInclude | null + /** + * Filter, which Plan to fetch. + */ + where?: Prisma.PlanWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Plans to fetch. + */ + orderBy?: Prisma.PlanOrderByWithRelationInput | Prisma.PlanOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Plans. + */ + cursor?: Prisma.PlanWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Plans 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` Plans. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Plans. + */ + distinct?: Prisma.PlanScalarFieldEnum | Prisma.PlanScalarFieldEnum[] +} + +/** + * Plan findMany + */ +export type PlanFindManyArgs = { + /** + * Select specific fields to fetch from the Plan + */ + select?: Prisma.PlanSelect | null + /** + * Omit specific fields from the Plan + */ + omit?: Prisma.PlanOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PlanInclude | null + /** + * Filter, which Plans to fetch. + */ + where?: Prisma.PlanWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Plans to fetch. + */ + orderBy?: Prisma.PlanOrderByWithRelationInput | Prisma.PlanOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Plans. + */ + cursor?: Prisma.PlanWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Plans 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` Plans. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Plans. + */ + distinct?: Prisma.PlanScalarFieldEnum | Prisma.PlanScalarFieldEnum[] +} + +/** + * Plan create + */ +export type PlanCreateArgs = { + /** + * Select specific fields to fetch from the Plan + */ + select?: Prisma.PlanSelect | null + /** + * Omit specific fields from the Plan + */ + omit?: Prisma.PlanOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PlanInclude | null + /** + * The data needed to create a Plan. + */ + data: Prisma.XOR +} + +/** + * Plan createMany + */ +export type PlanCreateManyArgs = { + /** + * The data used to create many Plans. + */ + data: Prisma.PlanCreateManyInput | Prisma.PlanCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Plan createManyAndReturn + */ +export type PlanCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Plan + */ + select?: Prisma.PlanSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Plan + */ + omit?: Prisma.PlanOmit | null + /** + * The data used to create many Plans. + */ + data: Prisma.PlanCreateManyInput | Prisma.PlanCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Plan update + */ +export type PlanUpdateArgs = { + /** + * Select specific fields to fetch from the Plan + */ + select?: Prisma.PlanSelect | null + /** + * Omit specific fields from the Plan + */ + omit?: Prisma.PlanOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PlanInclude | null + /** + * The data needed to update a Plan. + */ + data: Prisma.XOR + /** + * Choose, which Plan to update. + */ + where: Prisma.PlanWhereUniqueInput +} + +/** + * Plan updateMany + */ +export type PlanUpdateManyArgs = { + /** + * The data used to update Plans. + */ + data: Prisma.XOR + /** + * Filter which Plans to update + */ + where?: Prisma.PlanWhereInput + /** + * Limit how many Plans to update. + */ + limit?: number +} + +/** + * Plan updateManyAndReturn + */ +export type PlanUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Plan + */ + select?: Prisma.PlanSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Plan + */ + omit?: Prisma.PlanOmit | null + /** + * The data used to update Plans. + */ + data: Prisma.XOR + /** + * Filter which Plans to update + */ + where?: Prisma.PlanWhereInput + /** + * Limit how many Plans to update. + */ + limit?: number +} + +/** + * Plan upsert + */ +export type PlanUpsertArgs = { + /** + * Select specific fields to fetch from the Plan + */ + select?: Prisma.PlanSelect | null + /** + * Omit specific fields from the Plan + */ + omit?: Prisma.PlanOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PlanInclude | null + /** + * The filter to search for the Plan to update in case it exists. + */ + where: Prisma.PlanWhereUniqueInput + /** + * In case the Plan found by the `where` argument doesn't exist, create a new Plan with this data. + */ + create: Prisma.XOR + /** + * In case the Plan was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Plan delete + */ +export type PlanDeleteArgs = { + /** + * Select specific fields to fetch from the Plan + */ + select?: Prisma.PlanSelect | null + /** + * Omit specific fields from the Plan + */ + omit?: Prisma.PlanOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PlanInclude | null + /** + * Filter which Plan to delete. + */ + where: Prisma.PlanWhereUniqueInput +} + +/** + * Plan deleteMany + */ +export type PlanDeleteManyArgs = { + /** + * Filter which Plans to delete + */ + where?: Prisma.PlanWhereInput + /** + * Limit how many Plans to delete. + */ + limit?: number +} + +/** + * Plan.complexes + */ +export type Plan$complexesArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + where?: Prisma.ComplexWhereInput + orderBy?: Prisma.ComplexOrderByWithRelationInput | Prisma.ComplexOrderByWithRelationInput[] + cursor?: Prisma.ComplexWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.ComplexScalarFieldEnum | Prisma.ComplexScalarFieldEnum[] +} + +/** + * Plan without action + */ +export type PlanDefaultArgs = { + /** + * Select specific fields to fetch from the Plan + */ + select?: Prisma.PlanSelect | null + /** + * Omit specific fields from the Plan + */ + omit?: Prisma.PlanOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PlanInclude | null +} diff --git a/apps/backend/src/generated/prisma/models/Sport.ts b/apps/backend/src/generated/prisma/models/Sport.ts new file mode 100644 index 0000000..7cf506b --- /dev/null +++ b/apps/backend/src/generated/prisma/models/Sport.ts @@ -0,0 +1,1363 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Sport` 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" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model Sport + * + */ +export type SportModel = runtime.Types.Result.DefaultSelection + +export type AggregateSport = { + _count: SportCountAggregateOutputType | null + _min: SportMinAggregateOutputType | null + _max: SportMaxAggregateOutputType | null +} + +export type SportMinAggregateOutputType = { + id: string | null + name: string | null + slug: string | null + isActive: boolean | null + createdAt: Date | null + updatedAt: Date | null +} + +export type SportMaxAggregateOutputType = { + id: string | null + name: string | null + slug: string | null + isActive: boolean | null + createdAt: Date | null + updatedAt: Date | null +} + +export type SportCountAggregateOutputType = { + id: number + name: number + slug: number + isActive: number + createdAt: number + updatedAt: number + _all: number +} + + +export type SportMinAggregateInputType = { + id?: true + name?: true + slug?: true + isActive?: true + createdAt?: true + updatedAt?: true +} + +export type SportMaxAggregateInputType = { + id?: true + name?: true + slug?: true + isActive?: true + createdAt?: true + updatedAt?: true +} + +export type SportCountAggregateInputType = { + id?: true + name?: true + slug?: true + isActive?: true + createdAt?: true + updatedAt?: true + _all?: true +} + +export type SportAggregateArgs = { + /** + * Filter which Sport to aggregate. + */ + where?: Prisma.SportWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Sports to fetch. + */ + orderBy?: Prisma.SportOrderByWithRelationInput | Prisma.SportOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.SportWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Sports 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` Sports. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Sports + **/ + _count?: true | SportCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: SportMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: SportMaxAggregateInputType +} + +export type GetSportAggregateType = { + [P in keyof T & keyof AggregateSport]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type SportGroupByArgs = { + where?: Prisma.SportWhereInput + orderBy?: Prisma.SportOrderByWithAggregationInput | Prisma.SportOrderByWithAggregationInput[] + by: Prisma.SportScalarFieldEnum[] | Prisma.SportScalarFieldEnum + having?: Prisma.SportScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: SportCountAggregateInputType | true + _min?: SportMinAggregateInputType + _max?: SportMaxAggregateInputType +} + +export type SportGroupByOutputType = { + id: string + name: string + slug: string + isActive: boolean + createdAt: Date + updatedAt: Date + _count: SportCountAggregateOutputType | null + _min: SportMinAggregateOutputType | null + _max: SportMaxAggregateOutputType | null +} + +export type GetSportGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof SportGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type SportWhereInput = { + AND?: Prisma.SportWhereInput | Prisma.SportWhereInput[] + OR?: Prisma.SportWhereInput[] + NOT?: Prisma.SportWhereInput | Prisma.SportWhereInput[] + id?: Prisma.UuidFilter<"Sport"> | string + name?: Prisma.StringFilter<"Sport"> | string + slug?: Prisma.StringFilter<"Sport"> | string + isActive?: Prisma.BoolFilter<"Sport"> | boolean + createdAt?: Prisma.DateTimeFilter<"Sport"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Sport"> | Date | string + courts?: Prisma.CourtListRelationFilter +} + +export type SportOrderByWithRelationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + slug?: Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + courts?: Prisma.CourtOrderByRelationAggregateInput +} + +export type SportWhereUniqueInput = Prisma.AtLeast<{ + id?: string + name?: string + slug?: string + AND?: Prisma.SportWhereInput | Prisma.SportWhereInput[] + OR?: Prisma.SportWhereInput[] + NOT?: Prisma.SportWhereInput | Prisma.SportWhereInput[] + isActive?: Prisma.BoolFilter<"Sport"> | boolean + createdAt?: Prisma.DateTimeFilter<"Sport"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Sport"> | Date | string + courts?: Prisma.CourtListRelationFilter +}, "id" | "name" | "slug"> + +export type SportOrderByWithAggregationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + slug?: Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + _count?: Prisma.SportCountOrderByAggregateInput + _max?: Prisma.SportMaxOrderByAggregateInput + _min?: Prisma.SportMinOrderByAggregateInput +} + +export type SportScalarWhereWithAggregatesInput = { + AND?: Prisma.SportScalarWhereWithAggregatesInput | Prisma.SportScalarWhereWithAggregatesInput[] + OR?: Prisma.SportScalarWhereWithAggregatesInput[] + NOT?: Prisma.SportScalarWhereWithAggregatesInput | Prisma.SportScalarWhereWithAggregatesInput[] + id?: Prisma.UuidWithAggregatesFilter<"Sport"> | string + name?: Prisma.StringWithAggregatesFilter<"Sport"> | string + slug?: Prisma.StringWithAggregatesFilter<"Sport"> | string + isActive?: Prisma.BoolWithAggregatesFilter<"Sport"> | boolean + createdAt?: Prisma.DateTimeWithAggregatesFilter<"Sport"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Sport"> | Date | string +} + +export type SportCreateInput = { + id: string + name: string + slug: string + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + courts?: Prisma.CourtCreateNestedManyWithoutSportInput +} + +export type SportUncheckedCreateInput = { + id: string + name: string + slug: string + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + courts?: Prisma.CourtUncheckedCreateNestedManyWithoutSportInput +} + +export type SportUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + courts?: Prisma.CourtUpdateManyWithoutSportNestedInput +} + +export type SportUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + courts?: Prisma.CourtUncheckedUpdateManyWithoutSportNestedInput +} + +export type SportCreateManyInput = { + id: string + name: string + slug: string + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string +} + +export type SportUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type SportUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type SportCountOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + slug?: Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type SportMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + slug?: Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type SportMinOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + slug?: Prisma.SortOrder + isActive?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type SportScalarRelationFilter = { + is?: Prisma.SportWhereInput + isNot?: Prisma.SportWhereInput +} + +export type BoolFieldUpdateOperationsInput = { + set?: boolean +} + +export type SportCreateNestedOneWithoutCourtsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SportCreateOrConnectWithoutCourtsInput + connect?: Prisma.SportWhereUniqueInput +} + +export type SportUpdateOneRequiredWithoutCourtsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SportCreateOrConnectWithoutCourtsInput + upsert?: Prisma.SportUpsertWithoutCourtsInput + connect?: Prisma.SportWhereUniqueInput + update?: Prisma.XOR, Prisma.SportUncheckedUpdateWithoutCourtsInput> +} + +export type SportCreateWithoutCourtsInput = { + id: string + name: string + slug: string + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string +} + +export type SportUncheckedCreateWithoutCourtsInput = { + id: string + name: string + slug: string + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string +} + +export type SportCreateOrConnectWithoutCourtsInput = { + where: Prisma.SportWhereUniqueInput + create: Prisma.XOR +} + +export type SportUpsertWithoutCourtsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.SportWhereInput +} + +export type SportUpdateToOneWithWhereWithoutCourtsInput = { + where?: Prisma.SportWhereInput + data: Prisma.XOR +} + +export type SportUpdateWithoutCourtsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type SportUncheckedUpdateWithoutCourtsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + slug?: Prisma.StringFieldUpdateOperationsInput | string + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + +/** + * Count Type SportCountOutputType + */ + +export type SportCountOutputType = { + courts: number +} + +export type SportCountOutputTypeSelect = { + courts?: boolean | SportCountOutputTypeCountCourtsArgs +} + +/** + * SportCountOutputType without action + */ +export type SportCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the SportCountOutputType + */ + select?: Prisma.SportCountOutputTypeSelect | null +} + +/** + * SportCountOutputType without action + */ +export type SportCountOutputTypeCountCourtsArgs = { + where?: Prisma.CourtWhereInput +} + + +export type SportSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + slug?: boolean + isActive?: boolean + createdAt?: boolean + updatedAt?: boolean + courts?: boolean | Prisma.Sport$courtsArgs + _count?: boolean | Prisma.SportCountOutputTypeDefaultArgs +}, ExtArgs["result"]["sport"]> + +export type SportSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + slug?: boolean + isActive?: boolean + createdAt?: boolean + updatedAt?: boolean +}, ExtArgs["result"]["sport"]> + +export type SportSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + slug?: boolean + isActive?: boolean + createdAt?: boolean + updatedAt?: boolean +}, ExtArgs["result"]["sport"]> + +export type SportSelectScalar = { + id?: boolean + name?: boolean + slug?: boolean + isActive?: boolean + createdAt?: boolean + updatedAt?: boolean +} + +export type SportOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "slug" | "isActive" | "createdAt" | "updatedAt", ExtArgs["result"]["sport"]> +export type SportInclude = { + courts?: boolean | Prisma.Sport$courtsArgs + _count?: boolean | Prisma.SportCountOutputTypeDefaultArgs +} +export type SportIncludeCreateManyAndReturn = {} +export type SportIncludeUpdateManyAndReturn = {} + +export type $SportPayload = { + name: "Sport" + objects: { + courts: Prisma.$CourtPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + name: string + slug: string + isActive: boolean + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["sport"]> + composites: {} +} + +export type SportGetPayload = runtime.Types.Result.GetResult + +export type SportCountArgs = + Omit & { + select?: SportCountAggregateInputType | true + } + +export interface SportDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Sport'], meta: { name: 'Sport' } } + /** + * Find zero or one Sport that matches the filter. + * @param {SportFindUniqueArgs} args - Arguments to find a Sport + * @example + * // Get one Sport + * const sport = await prisma.sport.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__SportClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Sport that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {SportFindUniqueOrThrowArgs} args - Arguments to find a Sport + * @example + * // Get one Sport + * const sport = await prisma.sport.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__SportClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Sport 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 {SportFindFirstArgs} args - Arguments to find a Sport + * @example + * // Get one Sport + * const sport = await prisma.sport.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__SportClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Sport 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 {SportFindFirstOrThrowArgs} args - Arguments to find a Sport + * @example + * // Get one Sport + * const sport = await prisma.sport.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__SportClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Sports 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 {SportFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Sports + * const sports = await prisma.sport.findMany() + * + * // Get first 10 Sports + * const sports = await prisma.sport.findMany({ take: 10 }) + * + * // Only select the `id` + * const sportWithIdOnly = await prisma.sport.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Sport. + * @param {SportCreateArgs} args - Arguments to create a Sport. + * @example + * // Create one Sport + * const Sport = await prisma.sport.create({ + * data: { + * // ... data to create a Sport + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__SportClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Sports. + * @param {SportCreateManyArgs} args - Arguments to create many Sports. + * @example + * // Create many Sports + * const sport = await prisma.sport.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Sports and returns the data saved in the database. + * @param {SportCreateManyAndReturnArgs} args - Arguments to create many Sports. + * @example + * // Create many Sports + * const sport = await prisma.sport.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Sports and only return the `id` + * const sportWithIdOnly = await prisma.sport.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 Sport. + * @param {SportDeleteArgs} args - Arguments to delete one Sport. + * @example + * // Delete one Sport + * const Sport = await prisma.sport.delete({ + * where: { + * // ... filter to delete one Sport + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__SportClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Sport. + * @param {SportUpdateArgs} args - Arguments to update one Sport. + * @example + * // Update one Sport + * const sport = await prisma.sport.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__SportClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Sports. + * @param {SportDeleteManyArgs} args - Arguments to filter Sports to delete. + * @example + * // Delete a few Sports + * const { count } = await prisma.sport.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Sports. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SportUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Sports + * const sport = await prisma.sport.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Sports and returns the data updated in the database. + * @param {SportUpdateManyAndReturnArgs} args - Arguments to update many Sports. + * @example + * // Update many Sports + * const sport = await prisma.sport.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Sports and only return the `id` + * const sportWithIdOnly = await prisma.sport.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 Sport. + * @param {SportUpsertArgs} args - Arguments to update or create a Sport. + * @example + * // Update or create a Sport + * const sport = await prisma.sport.upsert({ + * create: { + * // ... data to create a Sport + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Sport we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__SportClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Sports. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SportCountArgs} args - Arguments to filter Sports to count. + * @example + * // Count the number of Sports + * const count = await prisma.sport.count({ + * where: { + * // ... the filter for the Sports 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 Sport. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SportAggregateArgs} 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 Sport. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SportGroupByArgs} 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 SportGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: SportGroupByArgs['orderBy'] } + : { orderBy?: SportGroupByArgs['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 ? GetSportGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Sport model + */ +readonly fields: SportFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Sport. + * 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__SportClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + courts = {}>(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 Sport model + */ +export interface SportFieldRefs { + readonly id: Prisma.FieldRef<"Sport", 'String'> + readonly name: Prisma.FieldRef<"Sport", 'String'> + readonly slug: Prisma.FieldRef<"Sport", 'String'> + readonly isActive: Prisma.FieldRef<"Sport", 'Boolean'> + readonly createdAt: Prisma.FieldRef<"Sport", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"Sport", 'DateTime'> +} + + +// Custom InputTypes +/** + * Sport findUnique + */ +export type SportFindUniqueArgs = { + /** + * Select specific fields to fetch from the Sport + */ + select?: Prisma.SportSelect | null + /** + * Omit specific fields from the Sport + */ + omit?: Prisma.SportOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SportInclude | null + /** + * Filter, which Sport to fetch. + */ + where: Prisma.SportWhereUniqueInput +} + +/** + * Sport findUniqueOrThrow + */ +export type SportFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Sport + */ + select?: Prisma.SportSelect | null + /** + * Omit specific fields from the Sport + */ + omit?: Prisma.SportOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SportInclude | null + /** + * Filter, which Sport to fetch. + */ + where: Prisma.SportWhereUniqueInput +} + +/** + * Sport findFirst + */ +export type SportFindFirstArgs = { + /** + * Select specific fields to fetch from the Sport + */ + select?: Prisma.SportSelect | null + /** + * Omit specific fields from the Sport + */ + omit?: Prisma.SportOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SportInclude | null + /** + * Filter, which Sport to fetch. + */ + where?: Prisma.SportWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Sports to fetch. + */ + orderBy?: Prisma.SportOrderByWithRelationInput | Prisma.SportOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Sports. + */ + cursor?: Prisma.SportWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Sports 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` Sports. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Sports. + */ + distinct?: Prisma.SportScalarFieldEnum | Prisma.SportScalarFieldEnum[] +} + +/** + * Sport findFirstOrThrow + */ +export type SportFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Sport + */ + select?: Prisma.SportSelect | null + /** + * Omit specific fields from the Sport + */ + omit?: Prisma.SportOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SportInclude | null + /** + * Filter, which Sport to fetch. + */ + where?: Prisma.SportWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Sports to fetch. + */ + orderBy?: Prisma.SportOrderByWithRelationInput | Prisma.SportOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Sports. + */ + cursor?: Prisma.SportWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Sports 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` Sports. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Sports. + */ + distinct?: Prisma.SportScalarFieldEnum | Prisma.SportScalarFieldEnum[] +} + +/** + * Sport findMany + */ +export type SportFindManyArgs = { + /** + * Select specific fields to fetch from the Sport + */ + select?: Prisma.SportSelect | null + /** + * Omit specific fields from the Sport + */ + omit?: Prisma.SportOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SportInclude | null + /** + * Filter, which Sports to fetch. + */ + where?: Prisma.SportWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Sports to fetch. + */ + orderBy?: Prisma.SportOrderByWithRelationInput | Prisma.SportOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Sports. + */ + cursor?: Prisma.SportWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Sports 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` Sports. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Sports. + */ + distinct?: Prisma.SportScalarFieldEnum | Prisma.SportScalarFieldEnum[] +} + +/** + * Sport create + */ +export type SportCreateArgs = { + /** + * Select specific fields to fetch from the Sport + */ + select?: Prisma.SportSelect | null + /** + * Omit specific fields from the Sport + */ + omit?: Prisma.SportOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SportInclude | null + /** + * The data needed to create a Sport. + */ + data: Prisma.XOR +} + +/** + * Sport createMany + */ +export type SportCreateManyArgs = { + /** + * The data used to create many Sports. + */ + data: Prisma.SportCreateManyInput | Prisma.SportCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Sport createManyAndReturn + */ +export type SportCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Sport + */ + select?: Prisma.SportSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Sport + */ + omit?: Prisma.SportOmit | null + /** + * The data used to create many Sports. + */ + data: Prisma.SportCreateManyInput | Prisma.SportCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Sport update + */ +export type SportUpdateArgs = { + /** + * Select specific fields to fetch from the Sport + */ + select?: Prisma.SportSelect | null + /** + * Omit specific fields from the Sport + */ + omit?: Prisma.SportOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SportInclude | null + /** + * The data needed to update a Sport. + */ + data: Prisma.XOR + /** + * Choose, which Sport to update. + */ + where: Prisma.SportWhereUniqueInput +} + +/** + * Sport updateMany + */ +export type SportUpdateManyArgs = { + /** + * The data used to update Sports. + */ + data: Prisma.XOR + /** + * Filter which Sports to update + */ + where?: Prisma.SportWhereInput + /** + * Limit how many Sports to update. + */ + limit?: number +} + +/** + * Sport updateManyAndReturn + */ +export type SportUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Sport + */ + select?: Prisma.SportSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Sport + */ + omit?: Prisma.SportOmit | null + /** + * The data used to update Sports. + */ + data: Prisma.XOR + /** + * Filter which Sports to update + */ + where?: Prisma.SportWhereInput + /** + * Limit how many Sports to update. + */ + limit?: number +} + +/** + * Sport upsert + */ +export type SportUpsertArgs = { + /** + * Select specific fields to fetch from the Sport + */ + select?: Prisma.SportSelect | null + /** + * Omit specific fields from the Sport + */ + omit?: Prisma.SportOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SportInclude | null + /** + * The filter to search for the Sport to update in case it exists. + */ + where: Prisma.SportWhereUniqueInput + /** + * In case the Sport found by the `where` argument doesn't exist, create a new Sport with this data. + */ + create: Prisma.XOR + /** + * In case the Sport was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Sport delete + */ +export type SportDeleteArgs = { + /** + * Select specific fields to fetch from the Sport + */ + select?: Prisma.SportSelect | null + /** + * Omit specific fields from the Sport + */ + omit?: Prisma.SportOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SportInclude | null + /** + * Filter which Sport to delete. + */ + where: Prisma.SportWhereUniqueInput +} + +/** + * Sport deleteMany + */ +export type SportDeleteManyArgs = { + /** + * Filter which Sports to delete + */ + where?: Prisma.SportWhereInput + /** + * Limit how many Sports to delete. + */ + limit?: number +} + +/** + * Sport.courts + */ +export type Sport$courtsArgs = { + /** + * Select specific fields to fetch from the Court + */ + select?: Prisma.CourtSelect | null + /** + * Omit specific fields from the Court + */ + omit?: Prisma.CourtOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CourtInclude | null + where?: Prisma.CourtWhereInput + orderBy?: Prisma.CourtOrderByWithRelationInput | Prisma.CourtOrderByWithRelationInput[] + cursor?: Prisma.CourtWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.CourtScalarFieldEnum | Prisma.CourtScalarFieldEnum[] +} + +/** + * Sport without action + */ +export type SportDefaultArgs = { + /** + * Select specific fields to fetch from the Sport + */ + select?: Prisma.SportSelect | null + /** + * Omit specific fields from the Sport + */ + omit?: Prisma.SportOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SportInclude | null +} diff --git a/apps/backend/src/generated/prisma/models/User.ts b/apps/backend/src/generated/prisma/models/User.ts new file mode 100644 index 0000000..d1dc3b2 --- /dev/null +++ b/apps/backend/src/generated/prisma/models/User.ts @@ -0,0 +1,1359 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `User` 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" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model User + * + */ +export type UserModel = runtime.Types.Result.DefaultSelection + +export type AggregateUser = { + _count: UserCountAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +export type UserMinAggregateOutputType = { + id: string | null + supabaseUserId: string | null + email: string | null + fullName: string | null + createdAt: Date | null + updatedAt: Date | null +} + +export type UserMaxAggregateOutputType = { + id: string | null + supabaseUserId: string | null + email: string | null + fullName: string | null + createdAt: Date | null + updatedAt: Date | null +} + +export type UserCountAggregateOutputType = { + id: number + supabaseUserId: number + email: number + fullName: number + createdAt: number + updatedAt: number + _all: number +} + + +export type UserMinAggregateInputType = { + id?: true + supabaseUserId?: true + email?: true + fullName?: true + createdAt?: true + updatedAt?: true +} + +export type UserMaxAggregateInputType = { + id?: true + supabaseUserId?: true + email?: true + fullName?: true + createdAt?: true + updatedAt?: true +} + +export type UserCountAggregateInputType = { + id?: true + supabaseUserId?: true + email?: true + fullName?: true + createdAt?: true + updatedAt?: true + _all?: true +} + +export type UserAggregateArgs = { + /** + * Filter which User to aggregate. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Users + **/ + _count?: true | UserCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: UserMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: UserMaxAggregateInputType +} + +export type GetUserAggregateType = { + [P in keyof T & keyof AggregateUser]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type UserGroupByArgs = { + where?: Prisma.UserWhereInput + orderBy?: Prisma.UserOrderByWithAggregationInput | Prisma.UserOrderByWithAggregationInput[] + by: Prisma.UserScalarFieldEnum[] | Prisma.UserScalarFieldEnum + having?: Prisma.UserScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UserCountAggregateInputType | true + _min?: UserMinAggregateInputType + _max?: UserMaxAggregateInputType +} + +export type UserGroupByOutputType = { + id: string + supabaseUserId: string + email: string + fullName: string + createdAt: Date + updatedAt: Date + _count: UserCountAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +export type GetUserGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type UserWhereInput = { + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + id?: Prisma.UuidFilter<"User"> | string + supabaseUserId?: Prisma.UuidFilter<"User"> | string + email?: Prisma.StringFilter<"User"> | string + fullName?: Prisma.StringFilter<"User"> | string + createdAt?: Prisma.DateTimeFilter<"User"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string + complexes?: Prisma.ComplexUserListRelationFilter +} + +export type UserOrderByWithRelationInput = { + id?: Prisma.SortOrder + supabaseUserId?: Prisma.SortOrder + email?: Prisma.SortOrder + fullName?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + complexes?: Prisma.ComplexUserOrderByRelationAggregateInput +} + +export type UserWhereUniqueInput = Prisma.AtLeast<{ + id?: string + supabaseUserId?: string + email?: string + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + fullName?: Prisma.StringFilter<"User"> | string + createdAt?: Prisma.DateTimeFilter<"User"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string + complexes?: Prisma.ComplexUserListRelationFilter +}, "id" | "supabaseUserId" | "email"> + +export type UserOrderByWithAggregationInput = { + id?: Prisma.SortOrder + supabaseUserId?: Prisma.SortOrder + email?: Prisma.SortOrder + fullName?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + _count?: Prisma.UserCountOrderByAggregateInput + _max?: Prisma.UserMaxOrderByAggregateInput + _min?: Prisma.UserMinOrderByAggregateInput +} + +export type UserScalarWhereWithAggregatesInput = { + AND?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] + OR?: Prisma.UserScalarWhereWithAggregatesInput[] + NOT?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] + id?: Prisma.UuidWithAggregatesFilter<"User"> | string + supabaseUserId?: Prisma.UuidWithAggregatesFilter<"User"> | string + email?: Prisma.StringWithAggregatesFilter<"User"> | string + fullName?: Prisma.StringWithAggregatesFilter<"User"> | string + createdAt?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string +} + +export type UserCreateInput = { + id: string + supabaseUserId: string + email: string + fullName: string + createdAt?: Date | string + updatedAt?: Date | string + complexes?: Prisma.ComplexUserCreateNestedManyWithoutUserInput +} + +export type UserUncheckedCreateInput = { + id: string + supabaseUserId: string + email: string + fullName: string + createdAt?: Date | string + updatedAt?: Date | string + complexes?: Prisma.ComplexUserUncheckedCreateNestedManyWithoutUserInput +} + +export type UserUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + supabaseUserId?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + fullName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complexes?: Prisma.ComplexUserUpdateManyWithoutUserNestedInput +} + +export type UserUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + supabaseUserId?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + fullName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complexes?: Prisma.ComplexUserUncheckedUpdateManyWithoutUserNestedInput +} + +export type UserCreateManyInput = { + id: string + supabaseUserId: string + email: string + fullName: string + createdAt?: Date | string + updatedAt?: Date | string +} + +export type UserUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + supabaseUserId?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + fullName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type UserUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + supabaseUserId?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + fullName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type UserScalarRelationFilter = { + is?: Prisma.UserWhereInput + isNot?: Prisma.UserWhereInput +} + +export type UserCountOrderByAggregateInput = { + id?: Prisma.SortOrder + supabaseUserId?: Prisma.SortOrder + email?: Prisma.SortOrder + fullName?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type UserMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + supabaseUserId?: Prisma.SortOrder + email?: Prisma.SortOrder + fullName?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type UserMinOrderByAggregateInput = { + id?: Prisma.SortOrder + supabaseUserId?: Prisma.SortOrder + email?: Prisma.SortOrder + fullName?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type UserCreateNestedOneWithoutComplexesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutComplexesInput + connect?: Prisma.UserWhereUniqueInput +} + +export type UserUpdateOneRequiredWithoutComplexesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutComplexesInput + upsert?: Prisma.UserUpsertWithoutComplexesInput + connect?: Prisma.UserWhereUniqueInput + update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutComplexesInput> +} + +export type UserCreateWithoutComplexesInput = { + id: string + supabaseUserId: string + email: string + fullName: string + createdAt?: Date | string + updatedAt?: Date | string +} + +export type UserUncheckedCreateWithoutComplexesInput = { + id: string + supabaseUserId: string + email: string + fullName: string + createdAt?: Date | string + updatedAt?: Date | string +} + +export type UserCreateOrConnectWithoutComplexesInput = { + where: Prisma.UserWhereUniqueInput + create: Prisma.XOR +} + +export type UserUpsertWithoutComplexesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UserWhereInput +} + +export type UserUpdateToOneWithWhereWithoutComplexesInput = { + where?: Prisma.UserWhereInput + data: Prisma.XOR +} + +export type UserUpdateWithoutComplexesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + supabaseUserId?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + fullName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type UserUncheckedUpdateWithoutComplexesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + supabaseUserId?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + fullName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + +/** + * Count Type UserCountOutputType + */ + +export type UserCountOutputType = { + complexes: number +} + +export type UserCountOutputTypeSelect = { + complexes?: boolean | UserCountOutputTypeCountComplexesArgs +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the UserCountOutputType + */ + select?: Prisma.UserCountOutputTypeSelect | null +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeCountComplexesArgs = { + where?: Prisma.ComplexUserWhereInput +} + + +export type UserSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + supabaseUserId?: boolean + email?: boolean + fullName?: boolean + createdAt?: boolean + updatedAt?: boolean + complexes?: boolean | Prisma.User$complexesArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +}, ExtArgs["result"]["user"]> + +export type UserSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + supabaseUserId?: boolean + email?: boolean + fullName?: boolean + createdAt?: boolean + updatedAt?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + supabaseUserId?: boolean + email?: boolean + fullName?: boolean + createdAt?: boolean + updatedAt?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectScalar = { + id?: boolean + supabaseUserId?: boolean + email?: boolean + fullName?: boolean + createdAt?: boolean + updatedAt?: boolean +} + +export type UserOmit = runtime.Types.Extensions.GetOmit<"id" | "supabaseUserId" | "email" | "fullName" | "createdAt" | "updatedAt", ExtArgs["result"]["user"]> +export type UserInclude = { + complexes?: boolean | Prisma.User$complexesArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +} +export type UserIncludeCreateManyAndReturn = {} +export type UserIncludeUpdateManyAndReturn = {} + +export type $UserPayload = { + name: "User" + objects: { + complexes: Prisma.$ComplexUserPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + supabaseUserId: string + email: string + fullName: string + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["user"]> + composites: {} +} + +export type UserGetPayload = runtime.Types.Result.GetResult + +export type UserCountArgs = + Omit & { + select?: UserCountAggregateInputType | true + } + +export interface UserDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['User'], meta: { name: 'User' } } + /** + * Find zero or one User that matches the filter. + * @param {UserFindUniqueArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one User that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User 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 {UserFindFirstArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User 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 {UserFindFirstOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Users 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 {UserFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Users + * const users = await prisma.user.findMany() + * + * // Get first 10 Users + * const users = await prisma.user.findMany({ take: 10 }) + * + * // Only select the `id` + * const userWithIdOnly = await prisma.user.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a User. + * @param {UserCreateArgs} args - Arguments to create a User. + * @example + * // Create one User + * const User = await prisma.user.create({ + * data: { + * // ... data to create a User + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Users. + * @param {UserCreateManyArgs} args - Arguments to create many Users. + * @example + * // Create many Users + * const user = await prisma.user.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Users and returns the data saved in the database. + * @param {UserCreateManyAndReturnArgs} args - Arguments to create many Users. + * @example + * // Create many Users + * const user = await prisma.user.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Users and only return the `id` + * const userWithIdOnly = await prisma.user.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 User. + * @param {UserDeleteArgs} args - Arguments to delete one User. + * @example + * // Delete one User + * const User = await prisma.user.delete({ + * where: { + * // ... filter to delete one User + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one User. + * @param {UserUpdateArgs} args - Arguments to update one User. + * @example + * // Update one User + * const user = await prisma.user.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Users. + * @param {UserDeleteManyArgs} args - Arguments to filter Users to delete. + * @example + * // Delete a few Users + * const { count } = await prisma.user.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Users + * const user = await prisma.user.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Users and returns the data updated in the database. + * @param {UserUpdateManyAndReturnArgs} args - Arguments to update many Users. + * @example + * // Update many Users + * const user = await prisma.user.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Users and only return the `id` + * const userWithIdOnly = await prisma.user.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 User. + * @param {UserUpsertArgs} args - Arguments to update or create a User. + * @example + * // Update or create a User + * const user = await prisma.user.upsert({ + * create: { + * // ... data to create a User + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the User we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserCountArgs} args - Arguments to filter Users to count. + * @example + * // Count the number of Users + * const count = await prisma.user.count({ + * where: { + * // ... the filter for the Users 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 User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserAggregateArgs} 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 User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserGroupByArgs} 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 UserGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: UserGroupByArgs['orderBy'] } + : { orderBy?: UserGroupByArgs['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 ? GetUserGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the User model + */ +readonly fields: UserFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for User. + * 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__UserClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + complexes = {}>(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 User model + */ +export interface UserFieldRefs { + readonly id: Prisma.FieldRef<"User", 'String'> + readonly supabaseUserId: Prisma.FieldRef<"User", 'String'> + readonly email: Prisma.FieldRef<"User", 'String'> + readonly fullName: Prisma.FieldRef<"User", 'String'> + readonly createdAt: Prisma.FieldRef<"User", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"User", 'DateTime'> +} + + +// Custom InputTypes +/** + * User findUnique + */ +export type UserFindUniqueArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User findUniqueOrThrow + */ +export type UserFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User findFirst + */ +export type UserFindFirstArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User findFirstOrThrow + */ +export type UserFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User findMany + */ +export type UserFindManyArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which Users to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User create + */ +export type UserCreateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The data needed to create a User. + */ + data: Prisma.XOR +} + +/** + * User createMany + */ +export type UserCreateManyArgs = { + /** + * The data used to create many Users. + */ + data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * User createManyAndReturn + */ +export type UserCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelectCreateManyAndReturn | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * The data used to create many Users. + */ + data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * User update + */ +export type UserUpdateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The data needed to update a User. + */ + data: Prisma.XOR + /** + * Choose, which User to update. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User updateMany + */ +export type UserUpdateManyArgs = { + /** + * The data used to update Users. + */ + data: Prisma.XOR + /** + * Filter which Users to update + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to update. + */ + limit?: number +} + +/** + * User updateManyAndReturn + */ +export type UserUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * The data used to update Users. + */ + data: Prisma.XOR + /** + * Filter which Users to update + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to update. + */ + limit?: number +} + +/** + * User upsert + */ +export type UserUpsertArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The filter to search for the User to update in case it exists. + */ + where: Prisma.UserWhereUniqueInput + /** + * In case the User found by the `where` argument doesn't exist, create a new User with this data. + */ + create: Prisma.XOR + /** + * In case the User was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * User delete + */ +export type UserDeleteArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter which User to delete. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User deleteMany + */ +export type UserDeleteManyArgs = { + /** + * Filter which Users to delete + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to delete. + */ + limit?: number +} + +/** + * User.complexes + */ +export type User$complexesArgs = { + /** + * Select specific fields to fetch from the ComplexUser + */ + select?: Prisma.ComplexUserSelect | null + /** + * Omit specific fields from the ComplexUser + */ + omit?: Prisma.ComplexUserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexUserInclude | null + where?: Prisma.ComplexUserWhereInput + orderBy?: Prisma.ComplexUserOrderByWithRelationInput | Prisma.ComplexUserOrderByWithRelationInput[] + cursor?: Prisma.ComplexUserWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.ComplexUserScalarFieldEnum | Prisma.ComplexUserScalarFieldEnum[] +} + +/** + * User without action + */ +export type UserDefaultArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null +} diff --git a/apps/backend/src/index.ts b/apps/backend/src/index.ts new file mode 100644 index 0000000..1f3f7f4 --- /dev/null +++ b/apps/backend/src/index.ts @@ -0,0 +1,8 @@ +import { createApp } from '@/app' +import { registerRoutes } from '@/register-routes' + +const app = createApp() +registerRoutes(app) + +export type AppType = typeof app +export default app diff --git a/apps/backend/src/lib/logger.ts b/apps/backend/src/lib/logger.ts new file mode 100644 index 0000000..6df31f9 --- /dev/null +++ b/apps/backend/src/lib/logger.ts @@ -0,0 +1,18 @@ +import pino from 'pino' + +const isProd = Bun.env.NODE_ENV === 'production' + +export const logger = pino({ + level: Bun.env.LOG_LEVEL ?? (isProd ? 'info' : 'debug'), + transport: isProd + ? undefined + : { + target: 'pino-pretty', + options: { + colorize: true, + singleLine: true, + translateTime: 'SYS:standard', + ignore: 'pid,hostname', + }, + }, +}) diff --git a/apps/backend/src/lib/mailer.ts b/apps/backend/src/lib/mailer.ts new file mode 100644 index 0000000..57cc9f3 --- /dev/null +++ b/apps/backend/src/lib/mailer.ts @@ -0,0 +1,51 @@ +import nodemailer from 'nodemailer' + +let cachedTransporter: ReturnType | null = null + +function getTransporter() { + if (cachedTransporter) return cachedTransporter + + const smtpHost = Bun.env.SMTP_HOST + const smtpPort = Number(Bun.env.SMTP_PORT ?? 587) + const smtpUser = Bun.env.SMTP_USER + const smtpPass = Bun.env.SMTP_PASS + + if (!smtpHost || !smtpUser || !smtpPass) { + throw new Error( + 'Missing SMTP env vars. Set SMTP_HOST, SMTP_PORT, SMTP_USER and SMTP_PASS.', + ) + } + + cachedTransporter = nodemailer.createTransport({ + host: smtpHost, + port: smtpPort, + secure: smtpPort === 465, + auth: { + user: smtpUser, + pass: smtpPass, + }, + }) + + return cachedTransporter +} + +export async function sendMail(input: { + to: string + subject: string + html: string + text: string +}) { + const smtpFrom = Bun.env.SMTP_FROM + + if (!smtpFrom) { + throw new Error('Missing SMTP_FROM env var.') + } + + await getTransporter().sendMail({ + from: smtpFrom, + to: input.to, + subject: input.subject, + html: input.html, + text: input.text, + }) +} diff --git a/apps/backend/src/lib/prisma.ts b/apps/backend/src/lib/prisma.ts new file mode 100644 index 0000000..25d96a5 --- /dev/null +++ b/apps/backend/src/lib/prisma.ts @@ -0,0 +1,50 @@ +import { PrismaPg } from '@prisma/adapter-pg' +import { PrismaClient } from '@/generated/prisma/client' + +const globalForPrisma = globalThis as unknown as { prisma?: PrismaClient } + +function hasExpectedDelegates(client: PrismaClient) { + const prismaClient = client as unknown as { + court?: { findMany?: unknown } + sport?: { findMany?: unknown } + } + + return ( + typeof prismaClient.court?.findMany === 'function' && + typeof prismaClient.sport?.findMany === 'function' + ) +} + +function buildPrismaClient() { + const databaseUrl = Bun.env.DATABASE_URL + + if (!databaseUrl) { + throw new Error('Missing DATABASE_URL in backend environment.') + } + + const adapter = new PrismaPg({ + connectionString: databaseUrl, + }) + + return new PrismaClient({ adapter }) +} + +export function getPrismaClient() { + if (globalForPrisma.prisma && hasExpectedDelegates(globalForPrisma.prisma)) { + return globalForPrisma.prisma + } + + if (globalForPrisma.prisma && !hasExpectedDelegates(globalForPrisma.prisma)) { + void globalForPrisma.prisma.$disconnect() + } + + const prisma = buildPrismaClient() + + if (Bun.env.NODE_ENV !== 'production') { + globalForPrisma.prisma = prisma + } + + return prisma +} + +export const db = getPrismaClient() diff --git a/apps/backend/src/lib/supabase-admin.ts b/apps/backend/src/lib/supabase-admin.ts new file mode 100644 index 0000000..f6cb5ba --- /dev/null +++ b/apps/backend/src/lib/supabase-admin.ts @@ -0,0 +1,26 @@ +import { createClient } from '@supabase/supabase-js' + +let cachedClient: ReturnType | null = null + +export function getSupabaseAdminClient() { + if (cachedClient) return cachedClient + + const supabaseUrl = Bun.env.SUPABASE_URL ?? Bun.env.VITE_SUPABASE_URL + const supabaseServiceRoleKey = Bun.env.SUPABASE_SERVICE_ROLE_KEY + + if (!supabaseUrl || !supabaseServiceRoleKey) { + throw new Error( + 'Missing Supabase admin env vars. Set SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY in backend environment.', + ) + } + + cachedClient = createClient(supabaseUrl, supabaseServiceRoleKey, { + auth: { + autoRefreshToken: false, + persistSession: false, + detectSessionInUrl: false, + }, + }) + + return cachedClient +} diff --git a/apps/backend/src/lib/supabase.ts b/apps/backend/src/lib/supabase.ts new file mode 100644 index 0000000..82b5992 --- /dev/null +++ b/apps/backend/src/lib/supabase.ts @@ -0,0 +1,19 @@ +import { createClient } from '@supabase/supabase-js' + +const supabaseUrl = Bun.env.SUPABASE_URL ?? Bun.env.VITE_SUPABASE_URL +const supabaseAnonKey = + Bun.env.SUPABASE_ANON_KEY ?? Bun.env.VITE_SUPABASE_ANON_KEY + +if (!supabaseUrl || !supabaseAnonKey) { + throw new Error( + 'Missing Supabase env vars. Set SUPABASE_URL/SUPABASE_ANON_KEY (or VITE_SUPABASE_URL/VITE_SUPABASE_ANON_KEY) in backend environment.', + ) +} + +export const supabase = createClient(supabaseUrl, supabaseAnonKey, { + auth: { + autoRefreshToken: false, + persistSession: false, + detectSessionInUrl: false, + }, +}) diff --git a/apps/backend/src/middlewares/require-auth.middleware.ts b/apps/backend/src/middlewares/require-auth.middleware.ts new file mode 100644 index 0000000..c4a0132 --- /dev/null +++ b/apps/backend/src/middlewares/require-auth.middleware.ts @@ -0,0 +1,50 @@ +import type { MiddlewareHandler } from 'hono' +import { db } from '@/lib/prisma' +import { supabase } from '@/lib/supabase' +import type { AppEnv } from '@/types/hono' + +function getBearerToken(value: string | undefined): string | null { + if (!value) return null + const [scheme, token] = value.split(' ') + if (scheme?.toLowerCase() !== 'bearer' || !token) return null + return token +} + +export const requireAuth: MiddlewareHandler = async ( + c, + next, +) => { + const token = getBearerToken(c.req.header('authorization')) + + if (!token) { + return c.json({ message: 'Missing bearer token.' }, 403) + } + + const { data, error } = await supabase.auth.getUser(token) + + if (error || !data.user) { + return c.json({ message: 'Invalid or expired token.' }, 403) + } + + const email = data.user.email?.toLowerCase() + + if (!email) { + return c.json({ message: 'Auth user does not contain email.' }, 403) + } + + const appUser = await db.user.findFirst({ + where: { + supabaseUserId: data.user.id, + email, + }, + select: { id: true }, + }) + + if (!appUser) { + return c.json({ message: 'User not provisioned in backend.' }, 403) + } + + c.set('authUser', data.user) + c.set('appUserId', appUser.id) + await next() +} diff --git a/apps/backend/src/middlewares/require-super-admin.middleware.ts b/apps/backend/src/middlewares/require-super-admin.middleware.ts new file mode 100644 index 0000000..a7b6569 --- /dev/null +++ b/apps/backend/src/middlewares/require-super-admin.middleware.ts @@ -0,0 +1,35 @@ +import type { MiddlewareHandler } from 'hono' +import type { AppEnv } from '@/types/hono' + +function getSuperAdminEmails(): Set { + const raw = Bun.env.SUPER_ADMIN_EMAILS ?? '' + const emails = raw + .split(',') + .map((value) => value.trim().toLowerCase()) + .filter(Boolean) + return new Set(emails) +} + +export const requireSuperAdmin: MiddlewareHandler = async ( + c, + next, +) => { + const authUser = c.get('authUser') + const role = + typeof authUser.app_metadata?.role === 'string' + ? authUser.app_metadata.role + : null + const email = authUser.email?.toLowerCase() + + if (role === 'super_admin') { + await next() + return + } + + if (email && getSuperAdminEmails().has(email)) { + await next() + return + } + + return c.json({ message: 'Este recurso requiere permisos de super admin.' }, 403) +} diff --git a/apps/backend/src/modules/complex/complex.routes.ts b/apps/backend/src/modules/complex/complex.routes.ts new file mode 100644 index 0000000..ac3946d --- /dev/null +++ b/apps/backend/src/modules/complex/complex.routes.ts @@ -0,0 +1,37 @@ +import { zValidator } from '@hono/zod-validator' +import { createComplexSchema, updateComplexSchema } from '@repo/api-contract' +import { Hono } from 'hono' +import { z } from 'zod' +import { requireAuth } from '@/middlewares/require-auth.middleware' +import { createComplexHandler } from '@/modules/complex/handlers/create-complex.handler' +import { getComplexByIdHandler } from '@/modules/complex/handlers/get-complex-by-id.handler' +import { getComplexBySlugHandler } from '@/modules/complex/handlers/get-complex-by-slug.handler' +import { listMyComplexesHandler } from '@/modules/complex/handlers/list-my-complexes.handler' +import { updateComplexHandler } from '@/modules/complex/handlers/update-complex.handler' +import type { AppEnv } from '@/types/hono' + +export const complexRoutes = new Hono() +const complexIdParamsSchema = z.object({ id: z.uuid() }) +const complexSlugParamsSchema = z.object({ slug: z.string().trim().min(1) }) + +complexRoutes.use('*', requireAuth) + +complexRoutes.post('/', zValidator('json', createComplexSchema), createComplexHandler) +complexRoutes.get('/mine', listMyComplexesHandler) +complexRoutes.get( + '/slug/:slug', + zValidator('param', complexSlugParamsSchema), + getComplexBySlugHandler, +) + +complexRoutes.get( + '/:id', + zValidator('param', complexIdParamsSchema), + getComplexByIdHandler, +) +complexRoutes.patch( + '/:id', + zValidator('param', complexIdParamsSchema), + zValidator('json', updateComplexSchema), + updateComplexHandler, +) diff --git a/apps/backend/src/modules/complex/handlers/create-complex.handler.ts b/apps/backend/src/modules/complex/handlers/create-complex.handler.ts new file mode 100644 index 0000000..3ae3978 --- /dev/null +++ b/apps/backend/src/modules/complex/handlers/create-complex.handler.ts @@ -0,0 +1,23 @@ +import type { CreateComplexInput } from '@repo/api-contract' +import type { AppContext } from '@/types/hono' +import { createComplex } from '@/modules/complex/services/complex.service' + +export async function createComplexHandler(c: AppContext) { + const payload = c.req.valid('json' as never) as CreateComplexInput + + const authUser = c.get('authUser') + const adminEmail = authUser.email + + if (!adminEmail) { + return c.json({ message: 'El usuario autenticado no tiene email.' }, 400) + } + + const complex = await createComplex({ + complexName: payload.complexName, + physicalAddress: payload.physicalAddress, + adminEmail, + planCode: payload.planCode, + }) + + return c.json(complex, 201) +} diff --git a/apps/backend/src/modules/complex/handlers/get-complex-by-id.handler.ts b/apps/backend/src/modules/complex/handlers/get-complex-by-id.handler.ts new file mode 100644 index 0000000..43b07fe --- /dev/null +++ b/apps/backend/src/modules/complex/handlers/get-complex-by-id.handler.ts @@ -0,0 +1,16 @@ +import type { AppContext } from '@/types/hono' +import { getComplexById } from '@/modules/complex/services/complex.service' + +type ComplexIdParams = { id: string } + +export async function getComplexByIdHandler(c: AppContext) { + const { id } = c.req.valid('param' as never) as ComplexIdParams + + const complex = await getComplexById(id) + + if (!complex) { + return c.json({ message: 'Complejo no encontrado.' }, 404) + } + + return c.json(complex) +} diff --git a/apps/backend/src/modules/complex/handlers/get-complex-by-slug.handler.ts b/apps/backend/src/modules/complex/handlers/get-complex-by-slug.handler.ts new file mode 100644 index 0000000..22514d8 --- /dev/null +++ b/apps/backend/src/modules/complex/handlers/get-complex-by-slug.handler.ts @@ -0,0 +1,16 @@ +import type { AppContext } from '@/types/hono' +import { getComplexBySlug } from '@/modules/complex/services/complex.service' + +type ComplexSlugParams = { slug: string } + +export async function getComplexBySlugHandler(c: AppContext) { + const { slug } = c.req.valid('param' as never) as ComplexSlugParams + + const complex = await getComplexBySlug(slug) + + if (!complex) { + return c.json({ message: 'Complejo no encontrado.' }, 404) + } + + return c.json(complex) +} diff --git a/apps/backend/src/modules/complex/handlers/list-my-complexes.handler.ts b/apps/backend/src/modules/complex/handlers/list-my-complexes.handler.ts new file mode 100644 index 0000000..744f192 --- /dev/null +++ b/apps/backend/src/modules/complex/handlers/list-my-complexes.handler.ts @@ -0,0 +1,8 @@ +import type { AppContext } from '@/types/hono' +import { listMyComplexes } from '@/modules/complex/services/complex.service' + +export async function listMyComplexesHandler(c: AppContext) { + const appUserId = c.get('appUserId') + const complexes = await listMyComplexes(appUserId) + return c.json(complexes) +} diff --git a/apps/backend/src/modules/complex/handlers/update-complex.handler.ts b/apps/backend/src/modules/complex/handlers/update-complex.handler.ts new file mode 100644 index 0000000..c699f6e --- /dev/null +++ b/apps/backend/src/modules/complex/handlers/update-complex.handler.ts @@ -0,0 +1,27 @@ +import type { UpdateComplexInput } from '@repo/api-contract' +import { Prisma } from '@/generated/prisma/client' +import type { AppContext } from '@/types/hono' +import { getComplexById, updateComplex } from '@/modules/complex/services/complex.service' + +type ComplexIdParams = { id: string } + +export async function updateComplexHandler(c: AppContext) { + const { id } = c.req.valid('param' as never) as ComplexIdParams + const payload = c.req.valid('json' as never) as UpdateComplexInput + + const existing = await getComplexById(id) + + if (!existing) { + return c.json({ message: 'Complejo no encontrado.' }, 404) + } + + try { + const complex = await updateComplex(id, payload) + return c.json(complex) + } catch (error) { + if (error instanceof Prisma.PrismaClientKnownRequestError) { + return c.json({ message: 'No se pudo actualizar el complejo.' }, 409) + } + throw error + } +} diff --git a/apps/backend/src/modules/complex/services/complex.service.ts b/apps/backend/src/modules/complex/services/complex.service.ts new file mode 100644 index 0000000..30f189c --- /dev/null +++ b/apps/backend/src/modules/complex/services/complex.service.ts @@ -0,0 +1,132 @@ +import { v7 as uuidv7 } from 'uuid' +import { Prisma } from '@/generated/prisma/client' +import { db } from '@/lib/prisma' + +export type CreateComplexInput = { + complexName: string + physicalAddress: string + adminEmail: string + planCode?: string +} + +export type UpdateComplexInput = { + complexName?: string + physicalAddress?: string | null + complexSlug?: string + adminEmail?: string + planCode?: string | null +} + +function slugify(value: string): string { + return value + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, '') + .toLowerCase() + .trim() + .replace(/[^a-z0-9\s-]/g, '') + .replace(/\s+/g, '-') + .replace(/-+/g, '-') +} + +async function buildUniqueSlug( + source: string, + excludeComplexId?: string, +): Promise { + const base = slugify(source) + const fallback = base.length > 0 ? base : `complex-${uuidv7().slice(0, 8)}` + + let candidate = fallback + let index = 1 + + while (true) { + const existing = await db.complex.findFirst({ + where: { + complexSlug: candidate, + ...(excludeComplexId + ? { + id: { + not: excludeComplexId, + }, + } + : {}), + }, + select: { id: true }, + }) + + if (!existing) return candidate + + index += 1 + candidate = `${fallback}-${index}` + } +} + +export async function createComplex(input: CreateComplexInput) { + const complexSlug = await buildUniqueSlug(input.complexName) + + return db.complex.create({ + data: { + id: uuidv7(), + complexName: input.complexName, + physicalAddress: input.physicalAddress.trim(), + complexSlug, + adminEmail: input.adminEmail, + planCode: input.planCode, + }, + }) +} + +export async function getComplexById(id: string) { + return db.complex.findUnique({ + where: { id }, + }) +} + +export async function getComplexBySlug(slug: string) { + return db.complex.findUnique({ + where: { complexSlug: slug }, + }) +} + +export async function listMyComplexes(appUserId: string) { + const complexUsers = await db.complexUser.findMany({ + where: { userId: appUserId }, + include: { + complex: true, + }, + orderBy: { + createdAt: 'asc', + }, + }) + + return complexUsers.map((complexUser) => complexUser.complex) +} + +export async function updateComplex(id: string, input: UpdateComplexInput) { + const data: Record = {} + + if (input.complexName) { + data.complexName = input.complexName + data.complexSlug = await buildUniqueSlug(input.complexName, id) + } + + if (input.complexSlug) { + data.complexSlug = await buildUniqueSlug(input.complexSlug, id) + } + + if (input.adminEmail) { + data.adminEmail = input.adminEmail + } + + if (input.planCode !== undefined) { + data.planCode = input.planCode + } + + if (input.physicalAddress !== undefined) { + data.physicalAddress = input.physicalAddress?.trim() ?? null + } + + return db.complex.update({ + where: { id }, + data: data as Prisma.ComplexUncheckedUpdateInput, + }) +} diff --git a/apps/backend/src/modules/court/court.routes.ts b/apps/backend/src/modules/court/court.routes.ts new file mode 100644 index 0000000..afff7ff --- /dev/null +++ b/apps/backend/src/modules/court/court.routes.ts @@ -0,0 +1,33 @@ +import { zValidator } from '@hono/zod-validator' +import { createCourtSchema, updateCourtSchema } from '@repo/api-contract' +import { Hono } from 'hono' +import { z } from 'zod' +import { requireAuth } from '@/middlewares/require-auth.middleware' +import { createCourtHandler } from '@/modules/court/handlers/create-court.handler' +import { listCourtsByComplexHandler } from '@/modules/court/handlers/list-courts-by-complex.handler' +import { updateCourtHandler } from '@/modules/court/handlers/update-court.handler' +import type { AppEnv } from '@/types/hono' + +export const courtRoutes = new Hono() +const complexIdParamsSchema = z.object({ complexId: z.uuid() }) +const courtIdParamsSchema = z.object({ id: z.uuid() }) + +courtRoutes.use('*', requireAuth) + +courtRoutes.get( + '/complex/:complexId', + zValidator('param', complexIdParamsSchema), + listCourtsByComplexHandler, +) +courtRoutes.post( + '/complex/:complexId', + zValidator('param', complexIdParamsSchema), + zValidator('json', createCourtSchema), + createCourtHandler, +) +courtRoutes.patch( + '/:id', + zValidator('param', courtIdParamsSchema), + zValidator('json', updateCourtSchema), + updateCourtHandler, +) diff --git a/apps/backend/src/modules/court/handlers/create-court.handler.ts b/apps/backend/src/modules/court/handlers/create-court.handler.ts new file mode 100644 index 0000000..850fa7d --- /dev/null +++ b/apps/backend/src/modules/court/handlers/create-court.handler.ts @@ -0,0 +1,21 @@ +import type { CreateCourtInput } from '@repo/api-contract' +import { CourtServiceError, createCourt } from '@/modules/court/services/court.service' +import type { AppContext } from '@/types/hono' + +type ComplexIdParams = { complexId: string } + +export async function createCourtHandler(c: AppContext) { + const { complexId } = c.req.valid('param' as never) as ComplexIdParams + const payload = c.req.valid('json' as never) as CreateCourtInput + const appUserId = c.get('appUserId') + + try { + const court = await createCourt(appUserId, complexId, payload) + return c.json(court, 201) + } catch (error) { + if (error instanceof CourtServiceError) { + return c.json({ message: error.message }, error.status) + } + throw error + } +} diff --git a/apps/backend/src/modules/court/handlers/list-courts-by-complex.handler.ts b/apps/backend/src/modules/court/handlers/list-courts-by-complex.handler.ts new file mode 100644 index 0000000..19d5fe8 --- /dev/null +++ b/apps/backend/src/modules/court/handlers/list-courts-by-complex.handler.ts @@ -0,0 +1,19 @@ +import { CourtServiceError, listCourtsByComplex } from '@/modules/court/services/court.service' +import type { AppContext } from '@/types/hono' + +type ComplexIdParams = { complexId: string } + +export async function listCourtsByComplexHandler(c: AppContext) { + const { complexId } = c.req.valid('param' as never) as ComplexIdParams + const appUserId = c.get('appUserId') + + try { + const courts = await listCourtsByComplex(complexId, appUserId) + return c.json(courts) + } catch (error) { + if (error instanceof CourtServiceError) { + return c.json({ message: error.message }, error.status) + } + throw error + } +} diff --git a/apps/backend/src/modules/court/handlers/update-court.handler.ts b/apps/backend/src/modules/court/handlers/update-court.handler.ts new file mode 100644 index 0000000..466065a --- /dev/null +++ b/apps/backend/src/modules/court/handlers/update-court.handler.ts @@ -0,0 +1,21 @@ +import type { UpdateCourtInput } from '@repo/api-contract' +import { CourtServiceError, updateCourt } from '@/modules/court/services/court.service' +import type { AppContext } from '@/types/hono' + +type CourtIdParams = { id: string } + +export async function updateCourtHandler(c: AppContext) { + const { id } = c.req.valid('param' as never) as CourtIdParams + const payload = c.req.valid('json' as never) as UpdateCourtInput + const appUserId = c.get('appUserId') + + try { + const court = await updateCourt(appUserId, id, payload) + return c.json(court) + } catch (error) { + if (error instanceof CourtServiceError) { + return c.json({ message: error.message }, error.status) + } + throw error + } +} diff --git a/apps/backend/src/modules/court/services/court.service.ts b/apps/backend/src/modules/court/services/court.service.ts new file mode 100644 index 0000000..290f993 --- /dev/null +++ b/apps/backend/src/modules/court/services/court.service.ts @@ -0,0 +1,339 @@ +import type { CreateCourtInput, DayOfWeek, UpdateCourtInput } from '@repo/api-contract' +import { v7 as uuidv7 } from 'uuid' +import type { + Court, + CourtAvailability, + CourtPriceRule, + Sport, +} from '@/generated/prisma/client' +import { db } from '@/lib/prisma' +import { evaluatePlanUsage, parsePlanRules } from '@/modules/plan/services/plan-rules.service' + +type CourtWithRelations = Court & { + sport: Sport + availabilities: CourtAvailability[] + priceRules: CourtPriceRule[] +} + +export class CourtServiceError extends Error { + status: 400 | 403 | 404 | 409 + + constructor(message: string, status: 400 | 403 | 404 | 409) { + super(message) + this.name = 'CourtServiceError' + this.status = status + } +} + +function toMinutes(value: string): number { + const [hours, minutes] = value.split(':').map((part) => Number(part)) + return hours * 60 + minutes +} + +function assertAvailabilityRanges( + availability: Array<{ + dayOfWeek: DayOfWeek + startTime: string + endTime: string + }>, +) { + const grouped = new Map>() + + for (const range of availability) { + const start = toMinutes(range.startTime) + const end = toMinutes(range.endTime) + + if (start >= end) { + throw new CourtServiceError( + `El rango ${range.startTime}-${range.endTime} es invalido.`, + 400, + ) + } + + const current = grouped.get(range.dayOfWeek) ?? [] + current.push({ start, end }) + grouped.set(range.dayOfWeek, current) + } + + for (const ranges of grouped.values()) { + ranges.sort((a, b) => a.start - b.start) + + for (let index = 1; index < ranges.length; index += 1) { + const previous = ranges[index - 1] + const current = ranges[index] + + if (previous.end > current.start) { + throw new CourtServiceError( + 'Hay rangos horarios superpuestos para el mismo dia.', + 400, + ) + } + } + } +} + +async function ensureComplexAccess(complexId: string, appUserId: string) { + const complexUser = await db.complexUser.findUnique({ + where: { + complexId_userId: { + complexId, + userId: appUserId, + }, + }, + include: { + complex: { + select: { + id: true, + plan: { + select: { + rules: true, + }, + }, + }, + }, + }, + }) + + if (!complexUser) { + throw new CourtServiceError( + 'No tienes permisos para administrar este complejo.', + 403, + ) + } + + return complexUser.complex +} + +async function ensureActiveSport(sportId: string) { + const sport = await db.sport.findFirst({ + where: { + id: sportId, + isActive: true, + }, + select: { id: true }, + }) + + if (!sport) { + throw new CourtServiceError('El deporte seleccionado no existe o esta inactivo.', 400) + } +} + +async function enforcePlanCourtLimit(complexId: string) { + const complex = await db.complex.findUnique({ + where: { id: complexId }, + select: { + plan: { + select: { + rules: true, + }, + }, + }, + }) + + if (!complex?.plan) { + return + } + + const rules = parsePlanRules(complex.plan.rules) + const courtsCount = await db.court.count({ + where: { complexId }, + }) + + const violations = evaluatePlanUsage(rules, { + courtsCount, + bookingsToday: 0, + }) + + const maxCourtViolation = violations.find( + (violation) => violation.code === 'MAX_COURTS_REACHED', + ) + + if (maxCourtViolation) { + throw new CourtServiceError(maxCourtViolation.message, 409) + } +} + +async function getCourtByIdForUser(courtId: string, appUserId: string) { + return db.court.findFirst({ + where: { + id: courtId, + complex: { + users: { + some: { + userId: appUserId, + }, + }, + }, + }, + include: { + sport: true, + availabilities: { + orderBy: [{ dayOfWeek: 'asc' }, { startTime: 'asc' }], + }, + priceRules: { + where: { isActive: true }, + orderBy: [{ dayOfWeek: 'asc' }, { startTime: 'asc' }], + }, + }, + }) +} + +function mapCourtResponse(court: CourtWithRelations) { + return { + id: court.id, + complexId: court.complexId, + name: court.name, + sportId: court.sportId, + sport: { + id: court.sport.id, + name: court.sport.name, + slug: court.sport.slug, + }, + slotDurationMinutes: court.slotDurationMinutes, + basePrice: Number(court.basePrice), + availability: court.availabilities.map((availability) => ({ + id: availability.id, + dayOfWeek: availability.dayOfWeek, + startTime: availability.startTime, + endTime: availability.endTime, + })), + priceRules: court.priceRules.map((rule) => ({ + id: rule.id, + dayOfWeek: rule.dayOfWeek, + startTime: rule.startTime, + endTime: rule.endTime, + price: Number(rule.price), + isActive: rule.isActive, + })), + hasCustomPricing: court.priceRules.length > 0, + createdAt: court.createdAt.toISOString(), + updatedAt: court.updatedAt.toISOString(), + } +} + +export async function listCourtsByComplex(complexId: string, appUserId: string) { + await ensureComplexAccess(complexId, appUserId) + + const courts = await db.court.findMany({ + where: { complexId }, + include: { + sport: true, + availabilities: { + orderBy: [{ dayOfWeek: 'asc' }, { startTime: 'asc' }], + }, + priceRules: { + where: { isActive: true }, + orderBy: [{ dayOfWeek: 'asc' }, { startTime: 'asc' }], + }, + }, + orderBy: { + createdAt: 'asc', + }, + }) + + return courts.map((court) => mapCourtResponse(court)) +} + +export async function createCourt( + appUserId: string, + complexId: string, + input: CreateCourtInput, +) { + await ensureComplexAccess(complexId, appUserId) + await ensureActiveSport(input.sportId) + await enforcePlanCourtLimit(complexId) + assertAvailabilityRanges(input.availability) + + const createdCourt = await db.$transaction(async (tx) => { + const court = await tx.court.create({ + data: { + id: uuidv7(), + complexId, + sportId: input.sportId, + name: input.name.trim(), + slotDurationMinutes: input.slotDurationMinutes, + basePrice: input.basePrice, + }, + }) + + await tx.courtAvailability.createMany({ + data: input.availability.map((availability) => ({ + id: uuidv7(), + courtId: court.id, + dayOfWeek: availability.dayOfWeek, + startTime: availability.startTime, + endTime: availability.endTime, + })), + }) + + return court + }) + + const court = await getCourtByIdForUser(createdCourt.id, appUserId) + + if (!court) { + throw new CourtServiceError('No se pudo obtener la cancha creada.', 404) + } + + return mapCourtResponse(court) +} + +export async function updateCourt( + appUserId: string, + courtId: string, + input: UpdateCourtInput, +) { + const existingCourt = await getCourtByIdForUser(courtId, appUserId) + + if (!existingCourt) { + throw new CourtServiceError('Cancha no encontrada.', 404) + } + + if (input.sportId) { + await ensureActiveSport(input.sportId) + } + + if (input.availability) { + assertAvailabilityRanges(input.availability) + } + + await db.$transaction(async (tx) => { + await tx.court.update({ + where: { + id: courtId, + }, + data: { + ...(input.name !== undefined ? { name: input.name.trim() } : {}), + ...(input.sportId !== undefined ? { sportId: input.sportId } : {}), + ...(input.slotDurationMinutes !== undefined + ? { slotDurationMinutes: input.slotDurationMinutes } + : {}), + ...(input.basePrice !== undefined ? { basePrice: input.basePrice } : {}), + }, + }) + + if (input.availability) { + await tx.courtAvailability.deleteMany({ + where: { courtId }, + }) + + await tx.courtAvailability.createMany({ + data: input.availability.map((availability) => ({ + id: uuidv7(), + courtId, + dayOfWeek: availability.dayOfWeek, + startTime: availability.startTime, + endTime: availability.endTime, + })), + }) + } + }) + + const updatedCourt = await getCourtByIdForUser(courtId, appUserId) + + if (!updatedCourt) { + throw new CourtServiceError('Cancha no encontrada.', 404) + } + + return mapCourtResponse(updatedCourt) +} diff --git a/apps/backend/src/modules/onboarding/handlers/complete-onboarding.handler.ts b/apps/backend/src/modules/onboarding/handlers/complete-onboarding.handler.ts new file mode 100644 index 0000000..af1a4b8 --- /dev/null +++ b/apps/backend/src/modules/onboarding/handlers/complete-onboarding.handler.ts @@ -0,0 +1,27 @@ +import type { OnboardingCompleteInput } from '@repo/api-contract' +import type { AppContext } from '@/types/hono' +import { + OnboardingError, + completeOnboarding, +} from '@/modules/onboarding/services/onboarding.service' + +export async function completeOnboardingHandler(c: AppContext) { + const payload = c.req.valid('json' as never) as OnboardingCompleteInput + + try { + const result = await completeOnboarding(payload) + return c.json({ + message: 'Onboarding completado correctamente.', + ...result, + }) + } catch (error) { + if (error instanceof OnboardingError) { + return c.json({ message: error.message }, error.status) + } + + if (error instanceof Error) { + return c.json({ message: error.message }, 400) + } + throw error + } +} diff --git a/apps/backend/src/modules/onboarding/handlers/resend-otp.handler.ts b/apps/backend/src/modules/onboarding/handlers/resend-otp.handler.ts new file mode 100644 index 0000000..e51147f --- /dev/null +++ b/apps/backend/src/modules/onboarding/handlers/resend-otp.handler.ts @@ -0,0 +1,25 @@ +import type { OnboardingResendOtpInput } from '@repo/api-contract' +import type { AppContext } from '@/types/hono' +import { + OnboardingError, + resendOnboardingOtp, +} from '@/modules/onboarding/services/onboarding.service' + +export async function resendOtpHandler(c: AppContext) { + const payload = c.req.valid('json' as never) as OnboardingResendOtpInput + + try { + const result = await resendOnboardingOtp(payload) + return c.json(result) + } catch (error) { + if (error instanceof OnboardingError) { + return c.json({ message: error.message }, error.status) + } + + if (error instanceof Error) { + return c.json({ message: error.message }, 400) + } + + throw error + } +} diff --git a/apps/backend/src/modules/onboarding/handlers/start-onboarding.handler.ts b/apps/backend/src/modules/onboarding/handlers/start-onboarding.handler.ts new file mode 100644 index 0000000..88bb3dd --- /dev/null +++ b/apps/backend/src/modules/onboarding/handlers/start-onboarding.handler.ts @@ -0,0 +1,10 @@ +import type { OnboardingStartInput } from '@repo/api-contract' +import type { AppContext } from '@/types/hono' +import { startOnboarding } from '@/modules/onboarding/services/onboarding.service' + +export async function startOnboardingHandler(c: AppContext) { + const payload = c.req.valid('json' as never) as OnboardingStartInput + + const result = await startOnboarding(payload) + return c.json(result, 202) +} diff --git a/apps/backend/src/modules/onboarding/handlers/verify-otp.handler.ts b/apps/backend/src/modules/onboarding/handlers/verify-otp.handler.ts new file mode 100644 index 0000000..44927f0 --- /dev/null +++ b/apps/backend/src/modules/onboarding/handlers/verify-otp.handler.ts @@ -0,0 +1,10 @@ +import type { OnboardingVerifyOtpInput } from '@repo/api-contract' +import type { AppContext } from '@/types/hono' +import { verifyOnboardingOtp } from '@/modules/onboarding/services/onboarding.service' + +export async function verifyOtpHandler(c: AppContext) { + const payload = c.req.valid('json' as never) as OnboardingVerifyOtpInput + const result = await verifyOnboardingOtp(payload) + + return c.json(result) +} diff --git a/apps/backend/src/modules/onboarding/onboarding.routes.ts b/apps/backend/src/modules/onboarding/onboarding.routes.ts new file mode 100644 index 0000000..a32a177 --- /dev/null +++ b/apps/backend/src/modules/onboarding/onboarding.routes.ts @@ -0,0 +1,39 @@ +import { zValidator } from '@hono/zod-validator' +import { + onboardingCompleteSchema, + onboardingResendOtpSchema, + onboardingStartSchema, + onboardingVerifyOtpSchema, +} from '@repo/api-contract' +import { Hono } from 'hono' +import { completeOnboardingHandler } from '@/modules/onboarding/handlers/complete-onboarding.handler' +import { resendOtpHandler } from '@/modules/onboarding/handlers/resend-otp.handler' +import { startOnboardingHandler } from '@/modules/onboarding/handlers/start-onboarding.handler' +import { verifyOtpHandler } from '@/modules/onboarding/handlers/verify-otp.handler' +import type { AppEnv } from '@/types/hono' + +export const onboardingRoutes = new Hono() + +onboardingRoutes.post( + '/start', + zValidator('json', onboardingStartSchema), + startOnboardingHandler, +) + +onboardingRoutes.post( + '/verify-otp', + zValidator('json', onboardingVerifyOtpSchema), + verifyOtpHandler, +) + +onboardingRoutes.post( + '/resend-otp', + zValidator('json', onboardingResendOtpSchema), + resendOtpHandler, +) + +onboardingRoutes.post( + '/complete', + zValidator('json', onboardingCompleteSchema), + completeOnboardingHandler, +) diff --git a/apps/backend/src/modules/onboarding/services/onboarding.service.ts b/apps/backend/src/modules/onboarding/services/onboarding.service.ts new file mode 100644 index 0000000..e0fffe0 --- /dev/null +++ b/apps/backend/src/modules/onboarding/services/onboarding.service.ts @@ -0,0 +1,510 @@ +import { createHash, randomInt } from 'node:crypto' +import { v7 as uuidv7 } from 'uuid' +import type { User as SupabaseAuthUser } from '@supabase/supabase-js' +import type { + OnboardingCompleteInput, + OnboardingResendOtpInput, + OnboardingStartInput, + OnboardingVerifyOtpInput, +} from '@repo/api-contract' +import { db } from '@/lib/prisma' +import { sendMail } from '@/lib/mailer' +import { getSupabaseAdminClient } from '@/lib/supabase-admin' + +const OTP_LENGTH = 6 +const OTP_TTL_MINUTES = Number(Bun.env.ONBOARDING_OTP_TTL_MINUTES ?? 10) +const OTP_MAX_ATTEMPTS = Number(Bun.env.ONBOARDING_OTP_MAX_ATTEMPTS ?? 5) +const OTP_RESEND_COOLDOWN_SECONDS = Number( + Bun.env.ONBOARDING_OTP_RESEND_COOLDOWN_SECONDS ?? 30, +) + +type VerifyOtpResult = { + message: string + verified: boolean + requestId: string + email: string | null + expiresAt: string | null + remainingAttempts: number + cooldownSeconds: number +} + +type ResendOtpResult = { + message: string + requestId: string + email: string + expiresAt: string + cooldownSeconds: number + remainingAttempts: number +} + +type StartOnboardingResult = { + message: string + requestId: string + email: string + expiresAt: string + cooldownSeconds: number +} + +export class OnboardingError extends Error { + status: 400 | 404 | 409 | 429 + + constructor(message: string, status: 400 | 404 | 409 | 429 = 400) { + super(message) + this.name = 'OnboardingError' + this.status = status + } +} + +function nowPlusMinutes(minutes: number): Date { + const date = new Date() + date.setMinutes(date.getMinutes() + minutes) + return date +} + +function normalizeEmail(email: string): string { + return email.trim().toLowerCase() +} + +function createOtpCode(): string { + return randomInt(0, 10 ** OTP_LENGTH).toString().padStart(OTP_LENGTH, '0') +} + +function hashValue(value: string): string { + return createHash('sha256').update(value).digest('hex') +} + +function getRemainingAttempts(otpAttempts: number): number { + return Math.max(0, OTP_MAX_ATTEMPTS - otpAttempts) +} + +function getCooldownSeconds(otpLastSentAt: Date): number { + const elapsedMs = Date.now() - otpLastSentAt.getTime() + const remainingMs = OTP_RESEND_COOLDOWN_SECONDS * 1000 - elapsedMs + return Math.max(0, Math.ceil(remainingMs / 1000)) +} + +function slugify(value: string): string { + return value + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, '') + .toLowerCase() + .trim() + .replace(/[^a-z0-9\s-]/g, '') + .replace(/\s+/g, '-') + .replace(/-+/g, '-') +} + +async function buildUniqueComplexSlug(complexName: string): Promise { + const base = slugify(complexName) + const fallback = base.length > 0 ? base : `complex-${uuidv7().slice(0, 8)}` + + let candidate = fallback + let index = 1 + + while (true) { + const existing = await db.complex.findFirst({ + where: { complexSlug: candidate }, + select: { id: true }, + }) + + if (!existing) { + return candidate + } + + index += 1 + candidate = `${fallback}-${index}` + } +} + +async function sendOtpEmail(email: string, otpCode: string) { + await sendMail({ + to: email, + subject: 'Codigo OTP para validar tu email', + text: `Tu codigo OTP es ${otpCode}. Vence en ${OTP_TTL_MINUTES} minutos.`, + html: `

Tu codigo OTP es ${otpCode}.

Vence en ${OTP_TTL_MINUTES} minutos.

`, + }) +} + +async function findSupabaseUserByEmail( + email: string, +): Promise { + let page = 1 + const perPage = 100 + + while (page <= 10) { + const { data, error } = await getSupabaseAdminClient().auth.admin.listUsers({ + page, + perPage, + }) + + if (error) { + throw new Error(`No se pudo consultar usuarios en Supabase: ${error.message}`) + } + + const found = data.users.find( + (user) => user.email?.toLowerCase() === email.toLowerCase(), + ) + + if (found) { + return found + } + + if (data.users.length < perPage) { + return null + } + + page += 1 + } + + return null +} + +async function ensureSupabaseUser(params: { + email: string + fullName: string + password: string +}): Promise { + const existingUser = await findSupabaseUserByEmail(params.email) + + if (existingUser) { + const { error } = await getSupabaseAdminClient().auth.admin.updateUserById( + existingUser.id, + { + password: params.password, + email_confirm: true, + user_metadata: { + full_name: params.fullName, + name: params.fullName, + }, + }, + ) + + if (error) { + throw new Error( + `No se pudo actualizar usuario existente en Supabase: ${error.message}`, + ) + } + + return existingUser.id + } + + const { data, error } = await getSupabaseAdminClient().auth.admin.createUser({ + email: params.email, + password: params.password, + email_confirm: true, + user_metadata: { + full_name: params.fullName, + name: params.fullName, + }, + }) + + if (error || !data.user) { + throw new Error( + `No se pudo crear usuario en Supabase: ${error?.message ?? 'unknown error'}`, + ) + } + + return data.user.id +} + +export async function startOnboarding( + input: OnboardingStartInput, +): Promise { + const email = normalizeEmail(input.email) + const otpCode = createOtpCode() + const expiresAt = nowPlusMinutes(OTP_TTL_MINUTES) + const now = new Date() + + const request = await db.onboardingRequest.create({ + data: { + id: uuidv7(), + fullName: input.fullName.trim(), + email, + otpHash: hashValue(otpCode), + otpExpiresAt: expiresAt, + otpAttempts: 0, + otpLastSentAt: now, + otpResendCount: 0, + }, + select: { + id: true, + email: true, + otpExpiresAt: true, + }, + }) + + await sendOtpEmail(email, otpCode) + + return { + message: 'Te enviamos un codigo OTP para validar tu direccion.', + requestId: request.id, + email: request.email, + expiresAt: request.otpExpiresAt.toISOString(), + cooldownSeconds: OTP_RESEND_COOLDOWN_SECONDS, + } +} + +export async function verifyOnboardingOtp( + input: OnboardingVerifyOtpInput, +): Promise { + const request = await db.onboardingRequest.findUnique({ + where: { id: input.requestId }, + }) + + if (!request) { + return { + message: 'Solicitud de onboarding invalida o expirada.', + verified: false, + requestId: input.requestId, + email: null, + expiresAt: null, + remainingAttempts: 0, + cooldownSeconds: 0, + } + } + + if (request.completedAt) { + return { + message: 'Este onboarding ya fue completado.', + verified: true, + requestId: request.id, + email: request.email, + expiresAt: request.otpExpiresAt.toISOString(), + remainingAttempts: getRemainingAttempts(request.otpAttempts), + cooldownSeconds: getCooldownSeconds(request.otpLastSentAt), + } + } + + if (request.otpExpiresAt < new Date()) { + return { + message: 'El codigo OTP vencio. Solicita un nuevo codigo.', + verified: false, + requestId: request.id, + email: request.email, + expiresAt: request.otpExpiresAt.toISOString(), + remainingAttempts: getRemainingAttempts(request.otpAttempts), + cooldownSeconds: getCooldownSeconds(request.otpLastSentAt), + } + } + + if (request.otpAttempts >= OTP_MAX_ATTEMPTS) { + return { + message: 'Se agotaron los intentos de OTP. Solicita un nuevo codigo.', + verified: false, + requestId: request.id, + email: request.email, + expiresAt: request.otpExpiresAt.toISOString(), + remainingAttempts: 0, + cooldownSeconds: getCooldownSeconds(request.otpLastSentAt), + } + } + + const otpMatches = hashValue(input.otp) === request.otpHash + + if (!otpMatches) { + const updated = await db.onboardingRequest.update({ + where: { id: request.id }, + data: { + otpAttempts: { + increment: 1, + }, + }, + select: { + id: true, + email: true, + otpAttempts: true, + otpExpiresAt: true, + otpLastSentAt: true, + }, + }) + + const remainingAttempts = getRemainingAttempts(updated.otpAttempts) + + return { + message: + remainingAttempts > 0 + ? 'Codigo OTP invalido.' + : 'Se agotaron los intentos de OTP. Solicita un nuevo codigo.', + verified: false, + requestId: updated.id, + email: updated.email, + expiresAt: updated.otpExpiresAt.toISOString(), + remainingAttempts, + cooldownSeconds: getCooldownSeconds(updated.otpLastSentAt), + } + } + + if (!request.emailVerifiedAt) { + await db.onboardingRequest.update({ + where: { id: request.id }, + data: { emailVerifiedAt: new Date() }, + }) + } + + return { + message: 'Email verificado correctamente.', + verified: true, + requestId: request.id, + email: request.email, + expiresAt: request.otpExpiresAt.toISOString(), + remainingAttempts: getRemainingAttempts(request.otpAttempts), + cooldownSeconds: getCooldownSeconds(request.otpLastSentAt), + } +} + +export async function resendOnboardingOtp( + input: OnboardingResendOtpInput, +): Promise { + const request = await db.onboardingRequest.findUnique({ + where: { id: input.requestId }, + }) + + if (!request) { + throw new OnboardingError('Solicitud de onboarding invalida o expirada.', 404) + } + + if (request.completedAt) { + throw new OnboardingError('Este onboarding ya fue completado.', 400) + } + + if (request.emailVerifiedAt) { + throw new OnboardingError('El email ya fue verificado.', 400) + } + + const cooldownSeconds = getCooldownSeconds(request.otpLastSentAt) + if (cooldownSeconds > 0) { + throw new OnboardingError( + `Debes esperar ${cooldownSeconds}s antes de reenviar el OTP.`, + 429, + ) + } + + const otpCode = createOtpCode() + const expiresAt = nowPlusMinutes(OTP_TTL_MINUTES) + const now = new Date() + + const updated = await db.onboardingRequest.update({ + where: { id: request.id }, + data: { + otpHash: hashValue(otpCode), + otpExpiresAt: expiresAt, + otpAttempts: 0, + otpLastSentAt: now, + otpResendCount: { + increment: 1, + }, + }, + select: { + id: true, + email: true, + otpExpiresAt: true, + otpAttempts: true, + }, + }) + + await sendOtpEmail(updated.email, otpCode) + + return { + message: 'Te enviamos un nuevo codigo OTP.', + requestId: updated.id, + email: updated.email, + expiresAt: updated.otpExpiresAt.toISOString(), + cooldownSeconds: OTP_RESEND_COOLDOWN_SECONDS, + remainingAttempts: getRemainingAttempts(updated.otpAttempts), + } +} + +export async function completeOnboarding(input: OnboardingCompleteInput) { + const onboardingRequest = await db.onboardingRequest.findUnique({ + where: { id: input.onboardingRequestId }, + }) + + if (!onboardingRequest) { + throw new OnboardingError('Solicitud de onboarding invalida o expirada.', 400) + } + + if (onboardingRequest.otpExpiresAt < new Date()) { + throw new OnboardingError( + 'La sesion de onboarding expiro. Solicita un nuevo OTP.', + 400, + ) + } + + if (!onboardingRequest.emailVerifiedAt) { + throw new OnboardingError('Debes verificar el email antes de continuar.', 400) + } + + if (onboardingRequest.completedAt) { + throw new OnboardingError('Este onboarding ya fue completado.', 400) + } + + const plan = await db.plan.findUnique({ + where: { code: input.planCode }, + select: { code: true }, + }) + + if (!plan) { + throw new OnboardingError('El plan seleccionado no existe.', 400) + } + + const supabaseUserId = await ensureSupabaseUser({ + email: onboardingRequest.email, + fullName: onboardingRequest.fullName, + password: input.password, + }) + + const complexSlug = await buildUniqueComplexSlug(input.complexName) + + const result = await db.$transaction(async (tx) => { + const user = await tx.user.upsert({ + where: { email: onboardingRequest.email }, + update: { + fullName: onboardingRequest.fullName, + supabaseUserId, + }, + create: { + id: uuidv7(), + fullName: onboardingRequest.fullName, + email: onboardingRequest.email, + supabaseUserId, + }, + }) + + const complex = await tx.complex.create({ + data: { + id: uuidv7(), + complexName: input.complexName.trim(), + physicalAddress: input.physicalAddress.trim(), + complexSlug, + adminEmail: onboardingRequest.email, + planCode: input.planCode, + }, + }) + + await tx.complexUser.create({ + data: { + complexId: complex.id, + userId: user.id, + role: 'ADMIN', + }, + }) + + await tx.onboardingRequest.update({ + where: { id: onboardingRequest.id }, + data: { + completedAt: new Date(), + }, + }) + + return { + userId: user.id, + complexId: complex.id, + complexSlug: complex.complexSlug, + } + }) + + return { + ...result, + supabaseUserId, + } +} diff --git a/apps/backend/src/modules/plan/handlers/list-plans.handler.ts b/apps/backend/src/modules/plan/handlers/list-plans.handler.ts new file mode 100644 index 0000000..c110348 --- /dev/null +++ b/apps/backend/src/modules/plan/handlers/list-plans.handler.ts @@ -0,0 +1,23 @@ +import type { AppContext } from '@/types/hono' +import { db } from '@/lib/prisma' + +export async function listPlansHandler(c: AppContext) { + const plans = await db.plan.findMany({ + select: { + code: true, + name: true, + price: true, + }, + orderBy: { + price: 'asc', + }, + }) + + return c.json( + plans.map((plan) => ({ + code: plan.code, + name: plan.name, + price: Number(plan.price), + })), + ) +} diff --git a/apps/backend/src/modules/plan/plan.routes.ts b/apps/backend/src/modules/plan/plan.routes.ts new file mode 100644 index 0000000..8a3b16b --- /dev/null +++ b/apps/backend/src/modules/plan/plan.routes.ts @@ -0,0 +1,7 @@ +import { Hono } from 'hono' +import { listPlansHandler } from '@/modules/plan/handlers/list-plans.handler' +import type { AppEnv } from '@/types/hono' + +export const planRoutes = new Hono() + +planRoutes.get('/', listPlansHandler) diff --git a/apps/backend/src/modules/plan/services/plan-rules.service.ts b/apps/backend/src/modules/plan/services/plan-rules.service.ts new file mode 100644 index 0000000..c3a21a0 --- /dev/null +++ b/apps/backend/src/modules/plan/services/plan-rules.service.ts @@ -0,0 +1,63 @@ +import type { PlanRules } from '@repo/api-contract' +import { planRulesSchema } from '@repo/api-contract' + +export type PlanUsageSnapshot = { + courtsCount: number + bookingsToday: number + activeUsersCount?: number +} + +export type PlanViolationCode = + | 'MAX_COURTS_REACHED' + | 'MAX_BOOKINGS_PER_DAY_REACHED' + | 'MAX_ACTIVE_USERS_REACHED' + +export type PlanViolation = { + code: PlanViolationCode + message: string +} + +export function parsePlanRules(input: unknown): PlanRules { + return planRulesSchema.parse(input) +} + +export function evaluatePlanUsage( + rules: PlanRules, + usage: PlanUsageSnapshot, +): PlanViolation[] { + const violations: PlanViolation[] = [] + + if (usage.courtsCount >= rules.limits.maxCourts) { + violations.push({ + code: 'MAX_COURTS_REACHED', + message: `El plan permite hasta ${rules.limits.maxCourts} canchas.`, + }) + } + + if (usage.bookingsToday >= rules.limits.maxBookingsPerDay) { + violations.push({ + code: 'MAX_BOOKINGS_PER_DAY_REACHED', + message: `El plan permite hasta ${rules.limits.maxBookingsPerDay} turnos por dia.`, + }) + } + + if ( + typeof rules.limits.maxActiveUsers === 'number' && + typeof usage.activeUsersCount === 'number' && + usage.activeUsersCount >= rules.limits.maxActiveUsers + ) { + violations.push({ + code: 'MAX_ACTIVE_USERS_REACHED', + message: `El plan permite hasta ${rules.limits.maxActiveUsers} usuarios activos.`, + }) + } + + return violations +} + +export function isFeatureEnabled( + rules: PlanRules, + feature: keyof PlanRules['features'], +): boolean { + return rules.features[feature] +} diff --git a/apps/backend/src/modules/public-booking/handlers/create-public-booking.handler.ts b/apps/backend/src/modules/public-booking/handlers/create-public-booking.handler.ts new file mode 100644 index 0000000..e52ed5a --- /dev/null +++ b/apps/backend/src/modules/public-booking/handlers/create-public-booking.handler.ts @@ -0,0 +1,24 @@ +import type { CreatePublicBookingInput } from '@repo/api-contract' +import { + PublicBookingServiceError, + createPublicBooking, +} from '@/modules/public-booking/services/public-booking.service' +import type { AppContext } from '@/types/hono' + +type ComplexSlugParams = { complexSlug: string } + +export async function createPublicBookingHandler(c: AppContext) { + const { complexSlug } = c.req.valid('param' as never) as ComplexSlugParams + const payload = c.req.valid('json' as never) as CreatePublicBookingInput + + try { + const booking = await createPublicBooking(complexSlug, payload) + return c.json(booking, 201) + } catch (error) { + if (error instanceof PublicBookingServiceError) { + return c.json({ message: error.message }, error.status) + } + + throw error + } +} diff --git a/apps/backend/src/modules/public-booking/handlers/get-public-booking-confirmation.handler.ts b/apps/backend/src/modules/public-booking/handlers/get-public-booking-confirmation.handler.ts new file mode 100644 index 0000000..471ca6b --- /dev/null +++ b/apps/backend/src/modules/public-booking/handlers/get-public-booking-confirmation.handler.ts @@ -0,0 +1,25 @@ +import { + PublicBookingServiceError, + getPublicBookingConfirmation, +} from '@/modules/public-booking/services/public-booking.service' +import type { AppContext } from '@/types/hono' + +type BookingCodeParams = { + complexSlug: string + bookingCode: string +} + +export async function getPublicBookingConfirmationHandler(c: AppContext) { + const { complexSlug, bookingCode } = c.req.valid('param' as never) as BookingCodeParams + + try { + const booking = await getPublicBookingConfirmation(complexSlug, bookingCode) + return c.json(booking) + } catch (error) { + if (error instanceof PublicBookingServiceError) { + return c.json({ message: error.message }, error.status) + } + + throw error + } +} diff --git a/apps/backend/src/modules/public-booking/handlers/list-public-availability.handler.ts b/apps/backend/src/modules/public-booking/handlers/list-public-availability.handler.ts new file mode 100644 index 0000000..283d946 --- /dev/null +++ b/apps/backend/src/modules/public-booking/handlers/list-public-availability.handler.ts @@ -0,0 +1,24 @@ +import type { PublicAvailabilityQuery } from '@repo/api-contract' +import { + PublicBookingServiceError, + listPublicAvailability, +} from '@/modules/public-booking/services/public-booking.service' +import type { AppContext } from '@/types/hono' + +type ComplexSlugParams = { complexSlug: string } + +export async function listPublicAvailabilityHandler(c: AppContext) { + const { complexSlug } = c.req.valid('param' as never) as ComplexSlugParams + const query = c.req.valid('query' as never) as PublicAvailabilityQuery + + try { + const availability = await listPublicAvailability(complexSlug, query) + return c.json(availability) + } catch (error) { + if (error instanceof PublicBookingServiceError) { + return c.json({ message: error.message }, error.status) + } + + throw error + } +} diff --git a/apps/backend/src/modules/public-booking/public-booking.routes.ts b/apps/backend/src/modules/public-booking/public-booking.routes.ts new file mode 100644 index 0000000..17845a0 --- /dev/null +++ b/apps/backend/src/modules/public-booking/public-booking.routes.ts @@ -0,0 +1,38 @@ +import { zValidator } from '@hono/zod-validator' +import { + createPublicBookingSchema, + publicAvailabilityQuerySchema, +} from '@repo/api-contract' +import { Hono } from 'hono' +import { z } from 'zod' +import { createPublicBookingHandler } from '@/modules/public-booking/handlers/create-public-booking.handler' +import { getPublicBookingConfirmationHandler } from '@/modules/public-booking/handlers/get-public-booking-confirmation.handler' +import { listPublicAvailabilityHandler } from '@/modules/public-booking/handlers/list-public-availability.handler' +import type { AppEnv } from '@/types/hono' + +export const publicBookingRoutes = new Hono() +const complexSlugParamsSchema = z.object({ complexSlug: z.string().trim().min(1) }) +const confirmationParamsSchema = z.object({ + complexSlug: z.string().trim().min(1), + bookingCode: z.string().trim().min(6).max(8), +}) + +publicBookingRoutes.get( + '/complex/:complexSlug/availability', + zValidator('param', complexSlugParamsSchema), + zValidator('query', publicAvailabilityQuerySchema), + listPublicAvailabilityHandler, +) + +publicBookingRoutes.post( + '/complex/:complexSlug', + zValidator('param', complexSlugParamsSchema), + zValidator('json', createPublicBookingSchema), + createPublicBookingHandler, +) + +publicBookingRoutes.get( + '/complex/:complexSlug/confirmation/:bookingCode', + zValidator('param', confirmationParamsSchema), + getPublicBookingConfirmationHandler, +) diff --git a/apps/backend/src/modules/public-booking/services/public-booking.service.ts b/apps/backend/src/modules/public-booking/services/public-booking.service.ts new file mode 100644 index 0000000..2d2a78c --- /dev/null +++ b/apps/backend/src/modules/public-booking/services/public-booking.service.ts @@ -0,0 +1,616 @@ +import type { + CreatePublicBookingInput, + DayOfWeek, + PublicAvailabilityQuery, +} from '@repo/api-contract' +import { randomInt } from 'node:crypto' +import { v7 as uuidv7 } from 'uuid' +import { db } from '@/lib/prisma' +import { evaluatePlanUsage, parsePlanRules } from '@/modules/plan/services/plan-rules.service' + +type Slot = { + startTime: string + endTime: string +} + +type ComplexWithPublicBookingData = Awaited> + +const DAY_OF_WEEK_BY_INDEX: DayOfWeek[] = [ + 'SUNDAY', + 'MONDAY', + 'TUESDAY', + 'WEDNESDAY', + 'THURSDAY', + 'FRIDAY', + 'SATURDAY', +] +const BOOKING_CODE_ALPHABET = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789' +const BOOKING_CODE_LENGTH = 6 + +export class PublicBookingServiceError extends Error { + status: 400 | 403 | 404 | 409 + + constructor(message: string, status: 400 | 403 | 404 | 409) { + super(message) + this.name = 'PublicBookingServiceError' + this.status = status + } +} + +function toMinutes(value: string): number { + const [hours, minutes] = value.split(':').map((part) => Number(part)) + return hours * 60 + minutes +} + +function minutesToTime(minutes: number): string { + const safeMinutes = Math.max(0, minutes) + const hours = Math.floor(safeMinutes / 60) + const mins = safeMinutes % 60 + return `${String(hours).padStart(2, '0')}:${String(mins).padStart(2, '0')}` +} + +function parseIsoDate(date: string): { bookingDate: Date; dayOfWeek: DayOfWeek } { + const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(date) + + if (!match) { + throw new PublicBookingServiceError('La fecha debe tener formato YYYY-MM-DD.', 400) + } + + const year = Number(match[1]) + const month = Number(match[2]) + const day = Number(match[3]) + + const bookingDate = new Date(Date.UTC(year, month - 1, day)) + + if ( + Number.isNaN(bookingDate.getTime()) || + bookingDate.getUTCFullYear() !== year || + bookingDate.getUTCMonth() + 1 !== month || + bookingDate.getUTCDate() !== day + ) { + throw new PublicBookingServiceError('La fecha enviada no es valida.', 400) + } + + const dayOfWeek = DAY_OF_WEEK_BY_INDEX[bookingDate.getUTCDay()] + + if (!dayOfWeek) { + throw new PublicBookingServiceError('No se pudo resolver el dia de la semana.', 400) + } + + return { bookingDate, dayOfWeek } +} + +function formatIsoDate(date: Date): string { + return date.toISOString().slice(0, 10) +} + +function generateBookingCode(): string { + let code = '' + + for (let index = 0; index < BOOKING_CODE_LENGTH; index += 1) { + code += BOOKING_CODE_ALPHABET[randomInt(0, BOOKING_CODE_ALPHABET.length)] + } + + return code +} + +function hasOverlap(slot: Slot, existing: Slot): boolean { + return slot.startTime < existing.endTime && slot.endTime > existing.startTime +} + +function buildSlots( + availability: Array<{ + startTime: string + endTime: string + }>, + slotDurationMinutes: number, +): Slot[] { + const slots: Slot[] = [] + + for (const range of availability) { + const start = toMinutes(range.startTime) + const end = toMinutes(range.endTime) + + for ( + let current = start; + current + slotDurationMinutes <= end; + current += slotDurationMinutes + ) { + slots.push({ + startTime: minutesToTime(current), + endTime: minutesToTime(current + slotDurationMinutes), + }) + } + } + + return slots +} + +function resolveSports(data: ComplexWithPublicBookingData) { + const map = new Map() + + for (const court of data.courts) { + if (!court.sport.isActive) { + continue + } + + if (!map.has(court.sport.id)) { + map.set(court.sport.id, { + id: court.sport.id, + name: court.sport.name, + slug: court.sport.slug, + }) + } + } + + return [...map.values()].sort((a, b) => a.name.localeCompare(b.name, 'es')) +} + +function validateSportSelection( + availableSports: Array<{ id: string }>, + sportId: string | undefined, +): { sportSelectionRequired: boolean; selectedSportId: string | undefined } { + const sportSelectionRequired = availableSports.length > 1 + + if (sportSelectionRequired && !sportId) { + throw new PublicBookingServiceError( + 'Debes seleccionar un deporte para consultar disponibilidad.', + 400, + ) + } + + if (sportId && !availableSports.some((sport) => sport.id === sportId)) { + throw new PublicBookingServiceError('El deporte seleccionado no pertenece al complejo.', 400) + } + + if (sportSelectionRequired) { + return { + sportSelectionRequired, + selectedSportId: sportId, + } + } + + return { + sportSelectionRequired, + selectedSportId: sportId ?? availableSports[0]?.id, + } +} + +async function getComplexWithBookingData(complexSlug: string) { + const complex = await db.complex.findUnique({ + where: { complexSlug }, + select: { + id: true, + complexName: true, + complexSlug: true, + plan: { + select: { + rules: true, + }, + }, + courts: { + include: { + sport: { + select: { + id: true, + name: true, + slug: true, + isActive: true, + }, + }, + availabilities: { + orderBy: [{ dayOfWeek: 'asc' }, { startTime: 'asc' }], + }, + }, + orderBy: { createdAt: 'asc' }, + }, + }, + }) + + if (!complex) { + throw new PublicBookingServiceError('Complejo no encontrado.', 404) + } + + if (complex.plan) { + const rules = parsePlanRules(complex.plan.rules) + + if (!rules.features.publicBookingPage) { + throw new PublicBookingServiceError( + 'El complejo no tiene habilitada la reserva publica.', + 403, + ) + } + } + + return complex +} + +function mapBookingResponse(input: { + bookingId: string + bookingCode: string + bookingDate: Date + createdAt: Date + startTime: string + endTime: string + customerName: string + customerPhone: string + status: 'CONFIRMED' | 'CANCELLED' + court: { + id: string + name: string + complexId: string + complexName: string + complexSlug: string + sport: { + id: string + name: string + slug: string + } + } +}) { + return { + id: input.bookingId, + bookingCode: input.bookingCode, + complexId: input.court.complexId, + complexName: input.court.complexName, + complexSlug: input.court.complexSlug, + courtId: input.court.id, + courtName: input.court.name, + sport: input.court.sport, + date: formatIsoDate(input.bookingDate), + startTime: input.startTime, + endTime: input.endTime, + customerName: input.customerName, + customerPhone: input.customerPhone, + status: input.status, + createdAt: input.createdAt.toISOString(), + } +} + +export async function getPublicBookingConfirmation(complexSlug: string, bookingCode: string) { + const normalizedBookingCode = bookingCode.toUpperCase() + const booking = await db.courtBooking.findFirst({ + where: { + bookingCode: normalizedBookingCode, + court: { + complex: { + complexSlug, + }, + }, + }, + select: { + bookingCode: true, + bookingDate: true, + startTime: true, + endTime: true, + status: true, + createdAt: true, + court: { + select: { + name: true, + sport: { + select: { + id: true, + name: true, + slug: true, + }, + }, + complex: { + select: { + complexName: true, + complexSlug: true, + }, + }, + }, + }, + }, + }) + + if (!booking) { + throw new PublicBookingServiceError('Reserva no encontrada.', 404) + } + + return { + bookingCode: booking.bookingCode, + complexName: booking.court.complex.complexName, + complexSlug: booking.court.complex.complexSlug, + date: formatIsoDate(booking.bookingDate), + startTime: booking.startTime, + endTime: booking.endTime, + courtName: booking.court.name, + sport: { + id: booking.court.sport.id, + name: booking.court.sport.name, + slug: booking.court.sport.slug, + }, + status: booking.status, + createdAt: booking.createdAt.toISOString(), + } +} + +export async function listPublicAvailability( + complexSlug: string, + query: PublicAvailabilityQuery, +) { + const { bookingDate, dayOfWeek } = parseIsoDate(query.date) + const complex = await getComplexWithBookingData(complexSlug) + const sports = resolveSports(complex) + const sportSelectionRequired = sports.length > 1 + + if (query.sportId && !sports.some((sport) => sport.id === query.sportId)) { + throw new PublicBookingServiceError('El deporte seleccionado no pertenece al complejo.', 400) + } + + const selectedSportId = sportSelectionRequired + ? query.sportId + : (query.sportId ?? sports[0]?.id) + + const candidateCourts = complex.courts.filter((court) => { + if (!court.sport.isActive) { + return false + } + + if (selectedSportId) { + return court.sportId === selectedSportId + } + + return true + }) + + const courtIds = candidateCourts.map((court) => court.id) + + const bookings = + courtIds.length > 0 + ? await db.courtBooking.findMany({ + where: { + bookingDate, + status: 'CONFIRMED', + courtId: { + in: courtIds, + }, + }, + select: { + courtId: true, + startTime: true, + endTime: true, + }, + }) + : [] + + const bookingsByCourt = new Map() + + for (const booking of bookings) { + const current = bookingsByCourt.get(booking.courtId) ?? [] + current.push({ + startTime: booking.startTime, + endTime: booking.endTime, + }) + bookingsByCourt.set(booking.courtId, current) + } + + const courts = candidateCourts + .map((court) => { + const dayAvailability = court.availabilities.filter( + (availability) => availability.dayOfWeek === dayOfWeek, + ) + + const allSlots = buildSlots(dayAvailability, court.slotDurationMinutes) + const occupiedSlots = bookingsByCourt.get(court.id) ?? [] + + const availableSlots = allSlots.filter( + (slot) => !occupiedSlots.some((occupied) => hasOverlap(slot, occupied)), + ) + + return { + courtId: court.id, + courtName: court.name, + sport: { + id: court.sport.id, + name: court.sport.name, + slug: court.sport.slug, + }, + slotDurationMinutes: court.slotDurationMinutes, + availabilityDay: dayOfWeek, + availableSlots, + } + }) + .filter((court) => court.availableSlots.length > 0) + + return { + complexId: complex.id, + complexName: complex.complexName, + complexSlug: complex.complexSlug, + date: query.date, + sportSelectionRequired, + sports, + courts, + } +} + +export async function createPublicBooking( + complexSlug: string, + input: CreatePublicBookingInput, +) { + const { bookingDate, dayOfWeek } = parseIsoDate(input.date) + const complex = await getComplexWithBookingData(complexSlug) + const sports = resolveSports(complex) + const { sportSelectionRequired } = validateSportSelection(sports, input.sportId) + + const selectedCourt = complex.courts.find( + (court) => court.id === input.courtId && court.sport.isActive, + ) + + if (!selectedCourt) { + throw new PublicBookingServiceError('La cancha seleccionada no existe en el complejo.', 404) + } + + if (sportSelectionRequired && !input.sportId) { + throw new PublicBookingServiceError( + 'Debes seleccionar un deporte para reservar en este complejo.', + 400, + ) + } + + if (input.sportId && input.sportId !== selectedCourt.sportId) { + throw new PublicBookingServiceError( + 'La cancha seleccionada no corresponde al deporte indicado.', + 400, + ) + } + + const dayAvailability = selectedCourt.availabilities.filter( + (availability) => availability.dayOfWeek === dayOfWeek, + ) + + const validSlots = buildSlots(dayAvailability, selectedCourt.slotDurationMinutes) + const selectedStartMinutes = toMinutes(input.startTime) + const selectedEndMinutes = selectedStartMinutes + selectedCourt.slotDurationMinutes + + const selectedSlot = { + startTime: input.startTime, + endTime: minutesToTime(selectedEndMinutes), + } + + const slotExists = validSlots.some( + (slot) => slot.startTime === selectedSlot.startTime && slot.endTime === selectedSlot.endTime, + ) + + if (!slotExists) { + throw new PublicBookingServiceError( + 'El horario seleccionado no esta disponible para esa cancha.', + 409, + ) + } + + for (let attempt = 0; attempt < 5; attempt += 1) { + try { + const booking = await db.$transaction(async (tx) => { + if (complex.plan) { + const rules = parsePlanRules(complex.plan.rules) + const bookingsForDate = await tx.courtBooking.count({ + where: { + bookingDate, + status: 'CONFIRMED', + court: { + complexId: complex.id, + }, + }, + }) + + const violations = evaluatePlanUsage(rules, { + courtsCount: complex.courts.length, + bookingsToday: bookingsForDate, + }) + + const maxBookingsViolation = violations.find( + (violation) => violation.code === 'MAX_BOOKINGS_PER_DAY_REACHED', + ) + + if (maxBookingsViolation) { + throw new PublicBookingServiceError(maxBookingsViolation.message, 409) + } + } + + const overlappingBooking = await tx.courtBooking.findFirst({ + where: { + courtId: selectedCourt.id, + bookingDate, + status: 'CONFIRMED', + startTime: { + lt: selectedSlot.endTime, + }, + endTime: { + gt: selectedSlot.startTime, + }, + }, + }) + + if (overlappingBooking) { + throw new PublicBookingServiceError('El horario seleccionado ya fue reservado.', 409) + } + + return tx.courtBooking.create({ + data: { + id: uuidv7(), + bookingCode: generateBookingCode(), + courtId: selectedCourt.id, + bookingDate, + startTime: selectedSlot.startTime, + endTime: selectedSlot.endTime, + customerName: input.customerName.trim(), + customerPhone: input.customerPhone.trim(), + status: 'CONFIRMED', + }, + select: { + id: true, + bookingCode: true, + bookingDate: true, + createdAt: true, + startTime: true, + endTime: true, + customerName: true, + customerPhone: true, + status: true, + }, + }) + }) + + return mapBookingResponse({ + bookingId: booking.id, + bookingCode: booking.bookingCode, + bookingDate: booking.bookingDate, + createdAt: booking.createdAt, + startTime: booking.startTime, + endTime: booking.endTime, + customerName: booking.customerName, + customerPhone: booking.customerPhone, + status: booking.status, + court: { + id: selectedCourt.id, + name: selectedCourt.name, + complexId: complex.id, + complexName: complex.complexName, + complexSlug: complex.complexSlug, + sport: { + id: selectedCourt.sport.id, + name: selectedCourt.sport.name, + slug: selectedCourt.sport.slug, + }, + }, + }) + } catch (error) { + if (error instanceof PublicBookingServiceError) { + throw error + } + + const prismaError = error as { + code?: string + meta?: { + target?: string[] | string + } + } + + if (prismaError.code === 'P2002') { + const targets = Array.isArray(prismaError.meta?.target) + ? prismaError.meta?.target + : [prismaError.meta?.target] + const isBookingCodeCollision = targets.some((target) => + String(target).includes('booking_code'), + ) + + if (isBookingCodeCollision) { + continue + } + + throw new PublicBookingServiceError('El horario seleccionado ya fue reservado.', 409) + } + + throw error + } + } + + throw new PublicBookingServiceError( + 'No se pudo generar un codigo de reserva unico. Intenta nuevamente.', + 409, + ) +} diff --git a/apps/backend/src/modules/sport/handlers/create-sport.handler.ts b/apps/backend/src/modules/sport/handlers/create-sport.handler.ts new file mode 100644 index 0000000..2b5ea5f --- /dev/null +++ b/apps/backend/src/modules/sport/handlers/create-sport.handler.ts @@ -0,0 +1,18 @@ +import type { CreateSportInput } from '@repo/api-contract' +import { Prisma } from '@/generated/prisma/client' +import type { AppContext } from '@/types/hono' +import { createSport } from '@/modules/sport/services/sport.service' + +export async function createSportHandler(c: AppContext) { + const payload = c.req.valid('json' as never) as CreateSportInput + + try { + const sport = await createSport(payload) + return c.json(sport, 201) + } catch (error) { + if (error instanceof Prisma.PrismaClientKnownRequestError) { + return c.json({ message: 'No se pudo crear el deporte.' }, 409) + } + throw error + } +} diff --git a/apps/backend/src/modules/sport/handlers/list-sports.handler.ts b/apps/backend/src/modules/sport/handlers/list-sports.handler.ts new file mode 100644 index 0000000..415b3e0 --- /dev/null +++ b/apps/backend/src/modules/sport/handlers/list-sports.handler.ts @@ -0,0 +1,7 @@ +import type { AppContext } from '@/types/hono' +import { listSports } from '@/modules/sport/services/sport.service' + +export async function listSportsHandler(c: AppContext) { + const sports = await listSports() + return c.json(sports) +} diff --git a/apps/backend/src/modules/sport/handlers/update-sport.handler.ts b/apps/backend/src/modules/sport/handlers/update-sport.handler.ts new file mode 100644 index 0000000..ebf3517 --- /dev/null +++ b/apps/backend/src/modules/sport/handlers/update-sport.handler.ts @@ -0,0 +1,27 @@ +import type { UpdateSportInput } from '@repo/api-contract' +import { Prisma } from '@/generated/prisma/client' +import type { AppContext } from '@/types/hono' +import { getSportById, updateSport } from '@/modules/sport/services/sport.service' + +type SportIdParams = { id: string } + +export async function updateSportHandler(c: AppContext) { + const { id } = c.req.valid('param' as never) as SportIdParams + const payload = c.req.valid('json' as never) as UpdateSportInput + + const existing = await getSportById(id) + + if (!existing) { + return c.json({ message: 'Deporte no encontrado.' }, 404) + } + + try { + const sport = await updateSport(id, payload) + return c.json(sport) + } catch (error) { + if (error instanceof Prisma.PrismaClientKnownRequestError) { + return c.json({ message: 'No se pudo actualizar el deporte.' }, 409) + } + throw error + } +} diff --git a/apps/backend/src/modules/sport/services/sport.service.ts b/apps/backend/src/modules/sport/services/sport.service.ts new file mode 100644 index 0000000..ff49d26 --- /dev/null +++ b/apps/backend/src/modules/sport/services/sport.service.ts @@ -0,0 +1,96 @@ +import { v7 as uuidv7 } from 'uuid' +import { Prisma } from '@/generated/prisma/client' +import { db } from '@/lib/prisma' + +export type CreateSportInput = { + name: string +} + +export type UpdateSportInput = { + name?: string + isActive?: boolean +} + +function slugify(value: string): string { + return value + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, '') + .toLowerCase() + .trim() + .replace(/[^a-z0-9\s-]/g, '') + .replace(/\s+/g, '-') + .replace(/-+/g, '-') +} + +async function buildUniqueSlug( + source: string, + excludeSportId?: string, +): Promise { + const base = slugify(source) + const fallback = base.length > 0 ? base : `sport-${uuidv7().slice(0, 8)}` + + let candidate = fallback + let index = 1 + + while (true) { + const existing = await db.sport.findFirst({ + where: { + slug: candidate, + ...(excludeSportId + ? { + id: { + not: excludeSportId, + }, + } + : {}), + }, + select: { id: true }, + }) + + if (!existing) return candidate + + index += 1 + candidate = `${fallback}-${index}` + } +} + +export async function listSports() { + return db.sport.findMany({ + orderBy: { name: 'asc' }, + }) +} + +export async function createSport(input: CreateSportInput) { + const slug = await buildUniqueSlug(input.name) + + return db.sport.create({ + data: { + id: uuidv7(), + name: input.name.trim(), + slug, + isActive: true, + }, + }) +} + +export async function getSportById(id: string) { + return db.sport.findUnique({ where: { id } }) +} + +export async function updateSport(id: string, input: UpdateSportInput) { + const data: Prisma.SportUncheckedUpdateInput = {} + + if (input.name) { + data.name = input.name + data.slug = await buildUniqueSlug(input.name, id) + } + + if (input.isActive !== undefined) { + data.isActive = input.isActive + } + + return db.sport.update({ + where: { id }, + data, + }) +} diff --git a/apps/backend/src/modules/sport/sport.routes.ts b/apps/backend/src/modules/sport/sport.routes.ts new file mode 100644 index 0000000..05fffa5 --- /dev/null +++ b/apps/backend/src/modules/sport/sport.routes.ts @@ -0,0 +1,30 @@ +import { zValidator } from '@hono/zod-validator' +import { createSportSchema, updateSportSchema } from '@repo/api-contract' +import { Hono } from 'hono' +import { z } from 'zod' +import { requireAuth } from '@/middlewares/require-auth.middleware' +import { requireSuperAdmin } from '@/middlewares/require-super-admin.middleware' +import { createSportHandler } from '@/modules/sport/handlers/create-sport.handler' +import { listSportsHandler } from '@/modules/sport/handlers/list-sports.handler' +import { updateSportHandler } from '@/modules/sport/handlers/update-sport.handler' +import type { AppEnv } from '@/types/hono' + +export const sportRoutes = new Hono() +const sportIdParamsSchema = z.object({ id: z.uuid() }) + +sportRoutes.use('*', requireAuth) + +sportRoutes.get('/', listSportsHandler) +sportRoutes.post( + '/', + requireSuperAdmin, + zValidator('json', createSportSchema), + createSportHandler, +) +sportRoutes.patch( + '/:id', + requireSuperAdmin, + zValidator('param', sportIdParamsSchema), + zValidator('json', updateSportSchema), + updateSportHandler, +) diff --git a/apps/backend/src/modules/user/handlers/get-user-profile.handler.ts b/apps/backend/src/modules/user/handlers/get-user-profile.handler.ts new file mode 100644 index 0000000..42e9cb6 --- /dev/null +++ b/apps/backend/src/modules/user/handlers/get-user-profile.handler.ts @@ -0,0 +1,8 @@ +import type { AppContext } from '@/types/hono' +import { getUserProfile } from '@/modules/user/services/user.service' + +export function getUserProfileHandler(c: AppContext) { + const authUser = c.get('authUser') + const profile = getUserProfile(authUser) + return c.json(profile) +} diff --git a/apps/backend/src/modules/user/services/user.service.ts b/apps/backend/src/modules/user/services/user.service.ts new file mode 100644 index 0000000..97079ea --- /dev/null +++ b/apps/backend/src/modules/user/services/user.service.ts @@ -0,0 +1,28 @@ +import type { AuthUser } from '@/types/auth-user' +import type { UserProfile } from '@repo/api-contract' + +export function getUserProfile(user: AuthUser): UserProfile { + const fullName = + (typeof user.user_metadata?.full_name === 'string' && + user.user_metadata.full_name) || + (typeof user.user_metadata?.name === 'string' && user.user_metadata.name) || + (user.email ?? 'Usuario') + + const role = + (typeof user.app_metadata?.role === 'string' && user.app_metadata.role) || + 'member' + + const avatarUrl = + (typeof user.user_metadata?.avatar_url === 'string' && + user.user_metadata.avatar_url) || + null + + return { + id: user.id, + fullName, + email: user.email ?? null, + role, + avatarUrl, + createdAt: user.created_at, + } +} diff --git a/apps/backend/src/modules/user/user.routes.ts b/apps/backend/src/modules/user/user.routes.ts new file mode 100644 index 0000000..80f7eba --- /dev/null +++ b/apps/backend/src/modules/user/user.routes.ts @@ -0,0 +1,9 @@ +import { Hono } from 'hono' +import { requireAuth } from '@/middlewares/require-auth.middleware' +import type { AppEnv } from '@/types/hono' +import { getUserProfileHandler } from '@/modules/user/handlers/get-user-profile.handler' + +export const userRoutes = new Hono() + +userRoutes.use('*', requireAuth) +userRoutes.get('/profile', getUserProfileHandler) diff --git a/apps/backend/src/register-routes.ts b/apps/backend/src/register-routes.ts new file mode 100644 index 0000000..de34b57 --- /dev/null +++ b/apps/backend/src/register-routes.ts @@ -0,0 +1,23 @@ +import { registerApiRoutes } from '@repo/api-contract' +import type { Hono } from 'hono' +import { complexRoutes } from '@/modules/complex/complex.routes' +import { courtRoutes } from '@/modules/court/court.routes' +import { onboardingRoutes } from '@/modules/onboarding/onboarding.routes' +import { planRoutes } from '@/modules/plan/plan.routes' +import { publicBookingRoutes } from '@/modules/public-booking/public-booking.routes' +import { sportRoutes } from '@/modules/sport/sport.routes' +import { userRoutes } from '@/modules/user/user.routes' +import type { AppEnv } from '@/types/hono' + +export function registerRoutes(app: Hono) { + registerApiRoutes(app, { + user: userRoutes, + plans: planRoutes, + onboarding: onboardingRoutes, + complexes: complexRoutes, + sports: sportRoutes, + courts: courtRoutes, + }) + + app.route('/api/public-bookings', publicBookingRoutes) +} diff --git a/apps/backend/src/server.ts b/apps/backend/src/server.ts new file mode 100644 index 0000000..239560a --- /dev/null +++ b/apps/backend/src/server.ts @@ -0,0 +1,16 @@ +import app from '@/index' +import { logger } from '@/lib/logger' + +const port = Number(Bun.env.PORT ?? 3000) +const hostname = Bun.env.HOST ?? '0.0.0.0' + +const server = Bun.serve({ + hostname, + port, + fetch: app.fetch, +}) + +logger.info( + { url: `http://${server.hostname}:${server.port}` }, + 'backend_listening', +) diff --git a/apps/backend/src/types/auth-user.ts b/apps/backend/src/types/auth-user.ts new file mode 100644 index 0000000..cf414ca --- /dev/null +++ b/apps/backend/src/types/auth-user.ts @@ -0,0 +1,3 @@ +import type { User } from '@supabase/supabase-js' + +export type AuthUser = User diff --git a/apps/backend/src/types/hono.ts b/apps/backend/src/types/hono.ts new file mode 100644 index 0000000..84c8448 --- /dev/null +++ b/apps/backend/src/types/hono.ts @@ -0,0 +1,13 @@ +import type { Context } from 'hono' +import type { AuthUser } from '@/types/auth-user' + +export type AppVariables = { + authUser: AuthUser + appUserId: string +} + +export type AppEnv = { + Variables: AppVariables +} + +export type AppContext = Context diff --git a/apps/backend/tsconfig.json b/apps/backend/tsconfig.json new file mode 100644 index 0000000..a4db910 --- /dev/null +++ b/apps/backend/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "ignoreDeprecations": "6.0", + "strict": true, + "skipLibCheck": true, + "types": ["bun"], + "baseUrl": ".", + "moduleResolution": "bundler", + "paths": { + "@/*": ["src/*"] + }, + "jsx": "react-jsx", + "jsxImportSource": "hono/jsx" + } +} diff --git a/apps/frontend/.env b/apps/frontend/.env new file mode 100644 index 0000000..d29b43a --- /dev/null +++ b/apps/frontend/.env @@ -0,0 +1,3 @@ +VITE_SUPABASE_URL=https://afzzqgvdkkpyxmifpaya.supabase.co +VITE_SUPABASE_ANON_KEY=sb_publishable_RgMLVBTCTClhK-1Ks_X02Q_Sq1Z1Pq- +VITE_API_BASE_URL=http://localhost:3000 diff --git a/apps/frontend/.env.example b/apps/frontend/.env.example new file mode 100644 index 0000000..86a9cf4 --- /dev/null +++ b/apps/frontend/.env.example @@ -0,0 +1,3 @@ +VITE_SUPABASE_URL=https://your-project-ref.supabase.co +VITE_SUPABASE_ANON_KEY=your-anon-key +VITE_API_BASE_URL=http://localhost:3000 diff --git a/apps/frontend/.gitignore b/apps/frontend/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/apps/frontend/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/apps/frontend/Dockerfile b/apps/frontend/Dockerfile new file mode 100644 index 0000000..f34259a --- /dev/null +++ b/apps/frontend/Dockerfile @@ -0,0 +1,37 @@ +# syntax=docker/dockerfile:1.7 + +FROM oven/bun:1.3 AS deps +WORKDIR /app + +# Workspace manifests first for better layer caching. +COPY package.json bun.lock ./ +COPY apps/frontend/package.json apps/frontend/package.json +COPY packages/api-contract/package.json packages/api-contract/package.json + +RUN bun install --frozen-lockfile + +FROM deps AS build +WORKDIR /app + +COPY apps/frontend apps/frontend +COPY packages/api-contract packages/api-contract + +# Build-time variables for Vite. +ARG VITE_API_BASE_URL=http://localhost:3000 +ARG VITE_SUPABASE_URL= +ARG VITE_SUPABASE_ANON_KEY= +ENV VITE_API_BASE_URL=${VITE_API_BASE_URL} +ENV VITE_SUPABASE_URL=${VITE_SUPABASE_URL} +ENV VITE_SUPABASE_ANON_KEY=${VITE_SUPABASE_ANON_KEY} + +RUN bun --filter frontend build + +FROM nginx:1.27-alpine AS runner +WORKDIR /usr/share/nginx/html + +COPY apps/frontend/nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=build /app/apps/frontend/dist ./ + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/apps/frontend/README.md b/apps/frontend/README.md new file mode 100644 index 0000000..7dbf7eb --- /dev/null +++ b/apps/frontend/README.md @@ -0,0 +1,73 @@ +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) + +## React Compiler + +The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: + +```js +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + + // Remove tseslint.configs.recommended and replace with this + tseslint.configs.recommendedTypeChecked, + // Alternatively, use this for stricter rules + tseslint.configs.strictTypeChecked, + // Optionally, add this for stylistic rules + tseslint.configs.stylisticTypeChecked, + + // Other configs... + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` + +You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: + +```js +// eslint.config.js +import reactX from 'eslint-plugin-react-x' +import reactDom from 'eslint-plugin-react-dom' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + // Enable lint rules for React + reactX.configs['recommended-typescript'], + // Enable lint rules for React DOM + reactDom.configs.recommended, + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` diff --git a/apps/frontend/components.json b/apps/frontend/components.json new file mode 100644 index 0000000..5c23ec4 --- /dev/null +++ b/apps/frontend/components.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "radix-nova", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "", + "css": "src/index.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "iconLibrary": "lucide", + "rtl": false, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "menuColor": "default", + "menuAccent": "subtle", + "registries": {} +} diff --git a/apps/frontend/eslint.config.js b/apps/frontend/eslint.config.js new file mode 100644 index 0000000..5e6b472 --- /dev/null +++ b/apps/frontend/eslint.config.js @@ -0,0 +1,23 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import tseslint from 'typescript-eslint' +import { defineConfig, globalIgnores } from 'eslint/config' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + js.configs.recommended, + tseslint.configs.recommended, + reactHooks.configs.flat.recommended, + reactRefresh.configs.vite, + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + }, +]) diff --git a/apps/frontend/index.html b/apps/frontend/index.html new file mode 100644 index 0000000..0fca6f0 --- /dev/null +++ b/apps/frontend/index.html @@ -0,0 +1,13 @@ + + + + + + + frontend + + +
+ + + diff --git a/apps/frontend/nginx.conf b/apps/frontend/nginx.conf new file mode 100644 index 0000000..45466c4 --- /dev/null +++ b/apps/frontend/nginx.conf @@ -0,0 +1,16 @@ +server { + listen 80; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location /assets/ { + add_header Cache-Control "public, max-age=31536000, immutable"; + try_files $uri =404; + } +} diff --git a/apps/frontend/package.json b/apps/frontend/package.json new file mode 100644 index 0000000..a3b2033 --- /dev/null +++ b/apps/frontend/package.json @@ -0,0 +1,51 @@ +{ + "name": "frontend", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "@fontsource-variable/geist": "^5.2.8", + "@hookform/resolvers": "^5.2.2", + "@repo/api-contract": "workspace:*", + "@supabase/supabase-js": "^2.101.1", + "@tanstack/react-query": "^5.96.1", + "@tanstack/react-query-devtools": "^5.96.1", + "@tanstack/react-router": "^1.168.10", + "@tanstack/router-devtools": "^1.166.11", + "axios": "^1.14.0", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "input-otp": "^1.4.2", + "lucide-react": "^1.7.0", + "radix-ui": "^1.4.3", + "react": "^19.2.4", + "react-dom": "^19.2.4", + "react-hook-form": "^7.72.0", + "shadcn": "^4.1.2", + "tailwind-merge": "^3.5.0", + "tw-animate-css": "^1.4.0" + }, + "devDependencies": { + "@eslint/js": "^9.39.4", + "@tailwindcss/vite": "^4.2.2", + "@tanstack/router-plugin": "^1.167.12", + "@types/node": "^24.12.0", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.1", + "eslint": "^9.39.4", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.5.2", + "globals": "^17.4.0", + "tailwindcss": "^4.2.2", + "typescript": "~5.9.3", + "typescript-eslint": "^8.57.0", + "vite": "^8.0.1" + } +} diff --git a/apps/frontend/public/favicon.svg b/apps/frontend/public/favicon.svg new file mode 100644 index 0000000..6893eb1 --- /dev/null +++ b/apps/frontend/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/frontend/public/icons.svg b/apps/frontend/public/icons.svg new file mode 100644 index 0000000..e952219 --- /dev/null +++ b/apps/frontend/public/icons.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/frontend/src/App.css b/apps/frontend/src/App.css new file mode 100644 index 0000000..f90339d --- /dev/null +++ b/apps/frontend/src/App.css @@ -0,0 +1,184 @@ +.counter { + font-size: 16px; + padding: 5px 10px; + border-radius: 5px; + color: var(--accent); + background: var(--accent-bg); + border: 2px solid transparent; + transition: border-color 0.3s; + margin-bottom: 24px; + + &:hover { + border-color: var(--accent-border); + } + &:focus-visible { + outline: 2px solid var(--accent); + outline-offset: 2px; + } +} + +.hero { + position: relative; + + .base, + .framework, + .vite { + inset-inline: 0; + margin: 0 auto; + } + + .base { + width: 170px; + position: relative; + z-index: 0; + } + + .framework, + .vite { + position: absolute; + } + + .framework { + z-index: 1; + top: 34px; + height: 28px; + transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg) + scale(1.4); + } + + .vite { + z-index: 0; + top: 107px; + height: 26px; + width: auto; + transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg) + scale(0.8); + } +} + +#center { + display: flex; + flex-direction: column; + gap: 25px; + place-content: center; + place-items: center; + flex-grow: 1; + + @media (max-width: 1024px) { + padding: 32px 20px 24px; + gap: 18px; + } +} + +#next-steps { + display: flex; + border-top: 1px solid var(--border); + text-align: left; + + & > div { + flex: 1 1 0; + padding: 32px; + @media (max-width: 1024px) { + padding: 24px 20px; + } + } + + .icon { + margin-bottom: 16px; + width: 22px; + height: 22px; + } + + @media (max-width: 1024px) { + flex-direction: column; + text-align: center; + } +} + +#docs { + border-right: 1px solid var(--border); + + @media (max-width: 1024px) { + border-right: none; + border-bottom: 1px solid var(--border); + } +} + +#next-steps ul { + list-style: none; + padding: 0; + display: flex; + gap: 8px; + margin: 32px 0 0; + + .logo { + height: 18px; + } + + a { + color: var(--text-h); + font-size: 16px; + border-radius: 6px; + background: var(--social-bg); + display: flex; + padding: 6px 12px; + align-items: center; + gap: 8px; + text-decoration: none; + transition: box-shadow 0.3s; + + &:hover { + box-shadow: var(--shadow); + } + .button-icon { + height: 18px; + width: 18px; + } + } + + @media (max-width: 1024px) { + margin-top: 20px; + flex-wrap: wrap; + justify-content: center; + + li { + flex: 1 1 calc(50% - 8px); + } + + a { + width: 100%; + justify-content: center; + box-sizing: border-box; + } + } +} + +#spacer { + height: 88px; + border-top: 1px solid var(--border); + @media (max-width: 1024px) { + height: 48px; + } +} + +.ticks { + position: relative; + width: 100%; + + &::before, + &::after { + content: ''; + position: absolute; + top: -4.5px; + border: 5px solid transparent; + } + + &::before { + left: 0; + border-left-color: var(--border); + } + &::after { + right: 0; + border-right-color: var(--border); + } +} diff --git a/apps/frontend/src/assets/hero.png b/apps/frontend/src/assets/hero.png new file mode 100644 index 0000000..cc51a3d Binary files /dev/null and b/apps/frontend/src/assets/hero.png differ diff --git a/apps/frontend/src/assets/react.svg b/apps/frontend/src/assets/react.svg new file mode 100644 index 0000000..6c87de9 --- /dev/null +++ b/apps/frontend/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/frontend/src/assets/vite.svg b/apps/frontend/src/assets/vite.svg new file mode 100644 index 0000000..5101b67 --- /dev/null +++ b/apps/frontend/src/assets/vite.svg @@ -0,0 +1 @@ +Vite diff --git a/apps/frontend/src/components/ui/avatar.tsx b/apps/frontend/src/components/ui/avatar.tsx new file mode 100644 index 0000000..99f3ed2 --- /dev/null +++ b/apps/frontend/src/components/ui/avatar.tsx @@ -0,0 +1,110 @@ +import * as React from "react" +import { Avatar as AvatarPrimitive } from "radix-ui" + +import { cn } from "@/lib/utils" + +function Avatar({ + className, + size = "default", + ...props +}: React.ComponentProps & { + size?: "default" | "sm" | "lg" +}) { + return ( + + ) +} + +function AvatarImage({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AvatarFallback({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) { + return ( + svg]:hidden", + "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", + "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", + className + )} + {...props} + /> + ) +} + +function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function AvatarGroupCount({ + className, + ...props +}: React.ComponentProps<"div">) { + return ( +
svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", + className + )} + {...props} + /> + ) +} + +export { + Avatar, + AvatarImage, + AvatarFallback, + AvatarGroup, + AvatarGroupCount, + AvatarBadge, +} diff --git a/apps/frontend/src/components/ui/button.tsx b/apps/frontend/src/components/ui/button.tsx new file mode 100644 index 0000000..6138844 --- /dev/null +++ b/apps/frontend/src/components/ui/button.tsx @@ -0,0 +1,67 @@ +import * as React from "react" +import { cva, type VariantProps } from "class-variance-authority" +import { Slot } from "radix-ui" + +import { cn } from "@/lib/utils" + +const buttonVariants = cva( + "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", + { + variants: { + variant: { + default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80", + outline: + "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50", + secondary: + "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground", + ghost: + "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50", + destructive: + "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40", + link: "text-primary underline-offset-4 hover:underline", + }, + size: { + default: + "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2", + xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3", + sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5", + lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2", + icon: "size-8", + "icon-xs": + "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3", + "icon-sm": + "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg", + "icon-lg": "size-9", + }, + }, + defaultVariants: { + variant: "default", + size: "default", + }, + } +) + +function Button({ + className, + variant = "default", + size = "default", + asChild = false, + ...props +}: React.ComponentProps<"button"> & + VariantProps & { + asChild?: boolean + }) { + const Comp = asChild ? Slot.Root : "button" + + return ( + + ) +} + +export { Button, buttonVariants } diff --git a/apps/frontend/src/components/ui/dropdown-menu.tsx b/apps/frontend/src/components/ui/dropdown-menu.tsx new file mode 100644 index 0000000..c263ad5 --- /dev/null +++ b/apps/frontend/src/components/ui/dropdown-menu.tsx @@ -0,0 +1,269 @@ +"use client" + +import * as React from "react" +import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui" + +import { cn } from "@/lib/utils" +import { CheckIcon, ChevronRightIcon } from "lucide-react" + +function DropdownMenu({ + ...props +}: React.ComponentProps) { + return +} + +function DropdownMenuPortal({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuTrigger({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuContent({ + className, + align = "start", + sideOffset = 4, + ...props +}: React.ComponentProps) { + return ( + + + + ) +} + +function DropdownMenuGroup({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuItem({ + className, + inset, + variant = "default", + ...props +}: React.ComponentProps & { + inset?: boolean + variant?: "default" | "destructive" +}) { + return ( + + ) +} + +function DropdownMenuCheckboxItem({ + className, + children, + checked, + inset, + ...props +}: React.ComponentProps & { + inset?: boolean +}) { + return ( + + + + + + + {children} + + ) +} + +function DropdownMenuRadioGroup({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuRadioItem({ + className, + children, + inset, + ...props +}: React.ComponentProps & { + inset?: boolean +}) { + return ( + + + + + + + {children} + + ) +} + +function DropdownMenuLabel({ + className, + inset, + ...props +}: React.ComponentProps & { + inset?: boolean +}) { + return ( + + ) +} + +function DropdownMenuSeparator({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DropdownMenuShortcut({ + className, + ...props +}: React.ComponentProps<"span">) { + return ( + + ) +} + +function DropdownMenuSub({ + ...props +}: React.ComponentProps) { + return +} + +function DropdownMenuSubTrigger({ + className, + inset, + children, + ...props +}: React.ComponentProps & { + inset?: boolean +}) { + return ( + + {children} + + + ) +} + +function DropdownMenuSubContent({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +export { + DropdownMenu, + DropdownMenuPortal, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuLabel, + DropdownMenuItem, + DropdownMenuCheckboxItem, + DropdownMenuRadioGroup, + DropdownMenuRadioItem, + DropdownMenuSeparator, + DropdownMenuShortcut, + DropdownMenuSub, + DropdownMenuSubTrigger, + DropdownMenuSubContent, +} diff --git a/apps/frontend/src/components/ui/field.tsx b/apps/frontend/src/components/ui/field.tsx new file mode 100644 index 0000000..4f1426f --- /dev/null +++ b/apps/frontend/src/components/ui/field.tsx @@ -0,0 +1,236 @@ +import { useMemo } from "react" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" +import { Label } from "@/components/ui/label" +import { Separator } from "@/components/ui/separator" + +function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) { + return ( +
[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", + className + )} + {...props} + /> + ) +} + +function FieldLegend({ + className, + variant = "legend", + ...props +}: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) { + return ( + + ) +} + +function FieldGroup({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +const fieldVariants = cva( + "group/field flex w-full gap-2 data-[invalid=true]:text-destructive", + { + variants: { + orientation: { + vertical: "flex-col *:w-full [&>.sr-only]:w-auto", + horizontal: + "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px", + responsive: + "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px", + }, + }, + defaultVariants: { + orientation: "vertical", + }, + } +) + +function Field({ + className, + orientation = "vertical", + ...props +}: React.ComponentProps<"div"> & VariantProps) { + return ( +
+ ) +} + +function FieldContent({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function FieldLabel({ + className, + ...props +}: React.ComponentProps) { + return ( +