diff --git a/README.md b/README.md
index e215bc4..0025b0c 100644
--- a/README.md
+++ b/README.md
@@ -1,36 +1,77 @@
-This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
+# SeTrip
-## Getting Started
+Aplikasi open trip pendakian yang mempertemukan **organizer** (pembuat trip) dengan **peserta** yang ingin naik gunung bareng atau mencari teman trip.
-First, run the development server:
+Stack: [Next.js](https://nextjs.org) (App Router), NextAuth, Prisma (PostgreSQL), Tailwind CSS.
+
+## Alur aplikasi
+
+### 1. Autentikasi
+
+- Pengguna baru mendaftar di `/register` (nama, email, password disimpan di database).
+- Login di `/login` melalui NextAuth; sesi dipakai di server action dan di halaman client (misalnya navbar, form buat trip).
+
+Tanpa login, pengguna tetap bisa melihat daftar trip dan detail trip, tetapi tidak bisa membuat trip atau join.
+
+### 2. Organizer: membuat trip
+
+1. Setelah login, organizer membuka **Buat Trip** (`/create-trip`) dari navbar, halaman `/trips`, beranda, atau tombol mengambang (+).
+2. Halaman form (`app/create-trip/page.tsx`) memvalidasi sesi di client; jika belum login, ditampilkan ajakan login.
+3. Organizer mengisi judul, gunung, lokasi, deskripsi (opsional), rentang tanggal (DatePicker), maks peserta, harga (format Rupiah), dan URL gambar opsional (`ImageUrlInput`).
+4. Submit memanggil server action `createTripAction` (`features/trip/actions.ts`):
+ - Memastikan ada sesi.
+ - Mem-parse dan memvalidasi input dengan Zod (`features/trip/schemas.ts`).
+ - `tripService.createTrip` menulis trip baru ke database lewat `tripRepo.create`, menghubungkan `organizerId` ke user yang login, dan menyimpan gambar jika ada.
+5. Trip baru berstatus **OPEN** (default schema), lalu pengguna diarahkan ke detail trip `/trips/[id]`.
+
+Organizer **tidak** bisa join trip sendiri; di detail trip tombol join diganti pesan bahwa user adalah organizer.
+
+### 3. Peserta: mencari trip dan join
+
+1. **Beranda** (`/`) dan **Open Trip** (`/trips`) menampilkan trip dengan status **OPEN** dan tanggal berangkat tidak di masa lalu (`tripService.getOpenTrips` + filter di repository).
+2. Filter pencarian (`TripFilter`) mengirim query string; daftar trip disaring di server.
+3. Dari kartu trip (`TripCard`), pengguna membuka **detail** `/trips/[id]` (`app/trips/[id]/page.tsx`):
+ - Peserta aktif = baris `TripParticipant` yang statusnya bukan `CANCELLED`.
+ - Slot tersisa dan progress bar memakai jumlah peserta aktif tersebut.
+4. **Join** (`JoinTripButton` + `joinTripAction`):
+ - Jika belum login: tautan ke `/login`.
+ - Jika trip bukan `OPEN` dan user belum join: pendaftaran ditutup (kecuali user sudah terdaftar dan ingin membatalkan, mengikuti logika UI).
+ - `tripService.joinTrip` memeriksa: trip ada, status `OPEN`, bukan organizer, belum terdaftar aktif, kapasitas belum penuh; lalu menambah atau mengaktifkan kembali partisipasi (lihat bagian perbaikan bug di bawah).
+5. Jika jumlah peserta aktif mencapai `maxParticipants`, status trip diperbarui menjadi **FULL**.
+6. **Batal ikut** memanggil `cancelJoinAction` → `tripService.cancelJoin`: partisipasi ditandai `CANCELLED`; jika trip sebelumnya `FULL` dan setelah batal slot kosong lagi, status dikembalikan ke **OPEN**.
+
+### 4. Ringkasan peran data
+
+| Konsep | Penyimpanan |
+|--------|-------------|
+| Trip | Model `Trip` (judul, gunung, lokasi, tanggal, kuota, harga, status, relasi ke organizer) |
+| Peserta | `TripParticipant` unik per `(tripId, userId)` dengan status `CONFIRMED` / `CANCELLED` (default schema juga mengenal `PENDING`; alur UI saat ini memakai `CONFIRMED` saat join) |
+
+## Menjalankan secara lokal
+
+Pastikan PostgreSQL berjalan dan variabel `DATABASE_URL` di `.env` mengarah ke database yang valid.
```bash
+npm install
+npx prisma migrate dev
+npm run seed # opsional: data contoh
npm run dev
-# or
-yarn dev
-# or
-pnpm dev
-# or
-bun dev
```
-Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
+Buka [http://localhost:3000](http://localhost:3000).
-You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
+## Perbaikan bug (yang relevan dengan join & listing)
-This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
+1. **Join lagi setelah “Batal ikut”**
+ Satu user hanya boleh satu baris partisipasi per trip (`@@unique([tripId, userId])`). Kode lama mencoba `create` lagi setelah status `CANCELLED`, sehingga bisa gagal dengan pelanggaran unik. Sekarang jika sudah ada baris `CANCELLED`, partisipasi **diaktifkan kembali** (`CONFIRMED`) lewat `participantRepo.reactivate`, bukan insert baru.
+
+2. **Jumlah peserta di kartu / daftar**
+ `_count.participants` di query listing sebelumnya menghitung semua baris termasuk yang `CANCELLED`, sehingga “slot tersisa” di `TripCard` bisa salah. Count sekarang hanya menghitung peserta dengan status **bukan** `CANCELLED`.
+
+3. **Segar halaman setelah join/batal/buat trip**
+ Setelah aksi trip, cache halaman `/trips` dan `/` ikut di-`revalidatePath` agar jumlah slot dan daftar di beranda konsisten tanpa harus refresh manual.
## Learn More
-To learn more about Next.js, take a look at the following resources:
-
-- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
-- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
-
-You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
-
-## Deploy on Vercel
-
-The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
-
-Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
+- [Next.js Documentation](https://nextjs.org/docs)
+- [Prisma Documentation](https://www.prisma.io/docs)
diff --git a/app/create-trip/page.tsx b/app/create-trip/page.tsx
index e487db8..b0d0124 100644
--- a/app/create-trip/page.tsx
+++ b/app/create-trip/page.tsx
@@ -8,6 +8,7 @@ import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import { createTripAction } from "@/features/trip/actions";
import { ImageUrlInput } from "@/features/trip/components/image-url-input";
+import { formatLocalCalendarYmd } from "@/lib/trip-dates";
const SAMPLE_MOUNTAINS = [
{ name: "Gunung Papandayan", location: "Garut, Jawa Barat" },
@@ -72,10 +73,15 @@ export default function CreateTripPage() {
setLoading(true);
const formData = new FormData(e.currentTarget);
- // Set date values from DatePicker state
- formData.set("date", startDate.toISOString().split("T")[0]);
+ // Hari kalender lokal → YYYY-MM-DD (bukan toISOString, supaya tidak geser ke UTC)
+ formData.set("date", formatLocalCalendarYmd(startDate));
if (endDate) {
- formData.set("endDate", endDate.toISOString().split("T")[0]);
+ const startYmd = formatLocalCalendarYmd(startDate);
+ const endYmd = formatLocalCalendarYmd(endDate);
+ // Satu hari: tanggal pulang sama dengan berangkat → jangan kirim endDate (trip 1 hari)
+ if (endYmd !== startYmd) {
+ formData.set("endDate", endYmd);
+ }
}
// Set raw price number
formData.set("price", parseRupiahInput(priceDisplay));
@@ -222,6 +228,12 @@ export default function CreateTripPage() {
Tanggal Berangkat — Pulang
+
+ Pilih satu tanggal untuk trip satu hari
+ . Pilih rentang untuk trip lebih dari satu hari
+ . Tanggal disimpan sebagai hari kalender yang kamu klik; filter Open Trip memakai{" "}
+ UTC yang sama.
+
{
@@ -208,6 +208,16 @@ export interface PrismaClient<
*/
get trip(): Prisma.TripDelegate;
+ /**
+ * `prisma.tripReview`: Exposes CRUD operations for the **TripReview** model.
+ * Example usage:
+ * ```ts
+ * // Fetch zero or more TripReviews
+ * const tripReviews = await prisma.tripReview.findMany()
+ * ```
+ */
+ get tripReview(): Prisma.TripReviewDelegate;
+
/**
* `prisma.tripImage`: Exposes CRUD operations for the **TripImage** model.
* Example usage:
diff --git a/app/generated/prisma/internal/prismaNamespace.ts b/app/generated/prisma/internal/prismaNamespace.ts
index 9b823f5..167671c 100644
--- a/app/generated/prisma/internal/prismaNamespace.ts
+++ b/app/generated/prisma/internal/prismaNamespace.ts
@@ -386,6 +386,7 @@ type FieldRefInputType = Model extends never ? never : FieldRe
export const ModelName = {
User: 'User',
Trip: 'Trip',
+ TripReview: 'TripReview',
TripImage: 'TripImage',
TripParticipant: 'TripParticipant'
} as const
@@ -403,7 +404,7 @@ export type TypeMap
+ fields: Prisma.TripReviewFieldRefs
+ operations: {
+ findUnique: {
+ args: Prisma.TripReviewFindUniqueArgs
+ result: runtime.Types.Utils.PayloadToResult | null
+ }
+ findUniqueOrThrow: {
+ args: Prisma.TripReviewFindUniqueOrThrowArgs
+ result: runtime.Types.Utils.PayloadToResult
+ }
+ findFirst: {
+ args: Prisma.TripReviewFindFirstArgs
+ result: runtime.Types.Utils.PayloadToResult | null
+ }
+ findFirstOrThrow: {
+ args: Prisma.TripReviewFindFirstOrThrowArgs
+ result: runtime.Types.Utils.PayloadToResult
+ }
+ findMany: {
+ args: Prisma.TripReviewFindManyArgs
+ result: runtime.Types.Utils.PayloadToResult[]
+ }
+ create: {
+ args: Prisma.TripReviewCreateArgs
+ result: runtime.Types.Utils.PayloadToResult
+ }
+ createMany: {
+ args: Prisma.TripReviewCreateManyArgs
+ result: BatchPayload
+ }
+ createManyAndReturn: {
+ args: Prisma.TripReviewCreateManyAndReturnArgs
+ result: runtime.Types.Utils.PayloadToResult[]
+ }
+ delete: {
+ args: Prisma.TripReviewDeleteArgs
+ result: runtime.Types.Utils.PayloadToResult
+ }
+ update: {
+ args: Prisma.TripReviewUpdateArgs
+ result: runtime.Types.Utils.PayloadToResult
+ }
+ deleteMany: {
+ args: Prisma.TripReviewDeleteManyArgs
+ result: BatchPayload
+ }
+ updateMany: {
+ args: Prisma.TripReviewUpdateManyArgs
+ result: BatchPayload
+ }
+ updateManyAndReturn: {
+ args: Prisma.TripReviewUpdateManyAndReturnArgs
+ result: runtime.Types.Utils.PayloadToResult[]
+ }
+ upsert: {
+ args: Prisma.TripReviewUpsertArgs
+ result: runtime.Types.Utils.PayloadToResult
+ }
+ aggregate: {
+ args: Prisma.TripReviewAggregateArgs
+ result: runtime.Types.Utils.Optional
+ }
+ groupBy: {
+ args: Prisma.TripReviewGroupByArgs
+ result: runtime.Types.Utils.Optional[]
+ }
+ count: {
+ args: Prisma.TripReviewCountArgs
+ result: runtime.Types.Utils.Optional | number
+ }
+ }
+ }
TripImage: {
payload: Prisma.$TripImagePayload
fields: Prisma.TripImageFieldRefs
@@ -774,6 +849,19 @@ export const TripScalarFieldEnum = {
export type TripScalarFieldEnum = (typeof TripScalarFieldEnum)[keyof typeof TripScalarFieldEnum]
+export const TripReviewScalarFieldEnum = {
+ id: 'id',
+ rating: 'rating',
+ comment: 'comment',
+ createdAt: 'createdAt',
+ updatedAt: 'updatedAt',
+ tripId: 'tripId',
+ userId: 'userId'
+} as const
+
+export type TripReviewScalarFieldEnum = (typeof TripReviewScalarFieldEnum)[keyof typeof TripReviewScalarFieldEnum]
+
+
export const TripImageScalarFieldEnum = {
id: 'id',
url: 'url',
@@ -1006,6 +1094,7 @@ export type PrismaClientOptions = ({
export type GlobalOmitConfig = {
user?: Prisma.UserOmit
trip?: Prisma.TripOmit
+ tripReview?: Prisma.TripReviewOmit
tripImage?: Prisma.TripImageOmit
tripParticipant?: Prisma.TripParticipantOmit
}
diff --git a/app/generated/prisma/internal/prismaNamespaceBrowser.ts b/app/generated/prisma/internal/prismaNamespaceBrowser.ts
index 6675056..64ac317 100644
--- a/app/generated/prisma/internal/prismaNamespaceBrowser.ts
+++ b/app/generated/prisma/internal/prismaNamespaceBrowser.ts
@@ -53,6 +53,7 @@ export const AnyNull = runtime.AnyNull
export const ModelName = {
User: 'User',
Trip: 'Trip',
+ TripReview: 'TripReview',
TripImage: 'TripImage',
TripParticipant: 'TripParticipant'
} as const
@@ -105,6 +106,19 @@ export const TripScalarFieldEnum = {
export type TripScalarFieldEnum = (typeof TripScalarFieldEnum)[keyof typeof TripScalarFieldEnum]
+export const TripReviewScalarFieldEnum = {
+ id: 'id',
+ rating: 'rating',
+ comment: 'comment',
+ createdAt: 'createdAt',
+ updatedAt: 'updatedAt',
+ tripId: 'tripId',
+ userId: 'userId'
+} as const
+
+export type TripReviewScalarFieldEnum = (typeof TripReviewScalarFieldEnum)[keyof typeof TripReviewScalarFieldEnum]
+
+
export const TripImageScalarFieldEnum = {
id: 'id',
url: 'url',
diff --git a/app/generated/prisma/models.ts b/app/generated/prisma/models.ts
index d59fef0..28a8f96 100644
--- a/app/generated/prisma/models.ts
+++ b/app/generated/prisma/models.ts
@@ -10,6 +10,7 @@
*/
export type * from './models/User'
export type * from './models/Trip'
+export type * from './models/TripReview'
export type * from './models/TripImage'
export type * from './models/TripParticipant'
export type * from './commonInputTypes'
\ No newline at end of file
diff --git a/app/generated/prisma/models/Trip.ts b/app/generated/prisma/models/Trip.ts
index 636b99c..ce18263 100644
--- a/app/generated/prisma/models/Trip.ts
+++ b/app/generated/prisma/models/Trip.ts
@@ -287,6 +287,7 @@ export type TripWhereInput = {
organizer?: Prisma.XOR
participants?: Prisma.TripParticipantListRelationFilter
images?: Prisma.TripImageListRelationFilter
+ reviews?: Prisma.TripReviewListRelationFilter
}
export type TripOrderByWithRelationInput = {
@@ -306,6 +307,7 @@ export type TripOrderByWithRelationInput = {
organizer?: Prisma.UserOrderByWithRelationInput
participants?: Prisma.TripParticipantOrderByRelationAggregateInput
images?: Prisma.TripImageOrderByRelationAggregateInput
+ reviews?: Prisma.TripReviewOrderByRelationAggregateInput
}
export type TripWhereUniqueInput = Prisma.AtLeast<{
@@ -328,6 +330,7 @@ export type TripWhereUniqueInput = Prisma.AtLeast<{
organizer?: Prisma.XOR
participants?: Prisma.TripParticipantListRelationFilter
images?: Prisma.TripImageListRelationFilter
+ reviews?: Prisma.TripReviewListRelationFilter
}, "id">
export type TripOrderByWithAggregationInput = {
@@ -386,6 +389,7 @@ export type TripCreateInput = {
organizer: Prisma.UserCreateNestedOneWithoutTripsInput
participants?: Prisma.TripParticipantCreateNestedManyWithoutTripInput
images?: Prisma.TripImageCreateNestedManyWithoutTripInput
+ reviews?: Prisma.TripReviewCreateNestedManyWithoutTripInput
}
export type TripUncheckedCreateInput = {
@@ -404,6 +408,7 @@ export type TripUncheckedCreateInput = {
organizerId: string
participants?: Prisma.TripParticipantUncheckedCreateNestedManyWithoutTripInput
images?: Prisma.TripImageUncheckedCreateNestedManyWithoutTripInput
+ reviews?: Prisma.TripReviewUncheckedCreateNestedManyWithoutTripInput
}
export type TripUpdateInput = {
@@ -422,6 +427,7 @@ export type TripUpdateInput = {
organizer?: Prisma.UserUpdateOneRequiredWithoutTripsNestedInput
participants?: Prisma.TripParticipantUpdateManyWithoutTripNestedInput
images?: Prisma.TripImageUpdateManyWithoutTripNestedInput
+ reviews?: Prisma.TripReviewUpdateManyWithoutTripNestedInput
}
export type TripUncheckedUpdateInput = {
@@ -440,6 +446,7 @@ export type TripUncheckedUpdateInput = {
organizerId?: Prisma.StringFieldUpdateOperationsInput | string
participants?: Prisma.TripParticipantUncheckedUpdateManyWithoutTripNestedInput
images?: Prisma.TripImageUncheckedUpdateManyWithoutTripNestedInput
+ reviews?: Prisma.TripReviewUncheckedUpdateManyWithoutTripNestedInput
}
export type TripCreateManyInput = {
@@ -620,6 +627,20 @@ export type EnumTripStatusFieldUpdateOperationsInput = {
set?: $Enums.TripStatus
}
+export type TripCreateNestedOneWithoutReviewsInput = {
+ create?: Prisma.XOR
+ connectOrCreate?: Prisma.TripCreateOrConnectWithoutReviewsInput
+ connect?: Prisma.TripWhereUniqueInput
+}
+
+export type TripUpdateOneRequiredWithoutReviewsNestedInput = {
+ create?: Prisma.XOR
+ connectOrCreate?: Prisma.TripCreateOrConnectWithoutReviewsInput
+ upsert?: Prisma.TripUpsertWithoutReviewsInput
+ connect?: Prisma.TripWhereUniqueInput
+ update?: Prisma.XOR, Prisma.TripUncheckedUpdateWithoutReviewsInput>
+}
+
export type TripCreateNestedOneWithoutImagesInput = {
create?: Prisma.XOR
connectOrCreate?: Prisma.TripCreateOrConnectWithoutImagesInput
@@ -663,6 +684,7 @@ export type TripCreateWithoutOrganizerInput = {
updatedAt?: Date | string
participants?: Prisma.TripParticipantCreateNestedManyWithoutTripInput
images?: Prisma.TripImageCreateNestedManyWithoutTripInput
+ reviews?: Prisma.TripReviewCreateNestedManyWithoutTripInput
}
export type TripUncheckedCreateWithoutOrganizerInput = {
@@ -680,6 +702,7 @@ export type TripUncheckedCreateWithoutOrganizerInput = {
updatedAt?: Date | string
participants?: Prisma.TripParticipantUncheckedCreateNestedManyWithoutTripInput
images?: Prisma.TripImageUncheckedCreateNestedManyWithoutTripInput
+ reviews?: Prisma.TripReviewUncheckedCreateNestedManyWithoutTripInput
}
export type TripCreateOrConnectWithoutOrganizerInput = {
@@ -727,6 +750,94 @@ export type TripScalarWhereInput = {
organizerId?: Prisma.StringFilter<"Trip"> | string
}
+export type TripCreateWithoutReviewsInput = {
+ id?: string
+ title: string
+ description?: string | null
+ mountain: string
+ location: string
+ date: Date | string
+ endDate?: Date | string | null
+ maxParticipants: number
+ price: number
+ status?: $Enums.TripStatus
+ createdAt?: Date | string
+ updatedAt?: Date | string
+ organizer: Prisma.UserCreateNestedOneWithoutTripsInput
+ participants?: Prisma.TripParticipantCreateNestedManyWithoutTripInput
+ images?: Prisma.TripImageCreateNestedManyWithoutTripInput
+}
+
+export type TripUncheckedCreateWithoutReviewsInput = {
+ id?: string
+ title: string
+ description?: string | null
+ mountain: string
+ location: string
+ date: Date | string
+ endDate?: Date | string | null
+ maxParticipants: number
+ price: number
+ status?: $Enums.TripStatus
+ createdAt?: Date | string
+ updatedAt?: Date | string
+ organizerId: string
+ participants?: Prisma.TripParticipantUncheckedCreateNestedManyWithoutTripInput
+ images?: Prisma.TripImageUncheckedCreateNestedManyWithoutTripInput
+}
+
+export type TripCreateOrConnectWithoutReviewsInput = {
+ where: Prisma.TripWhereUniqueInput
+ create: Prisma.XOR
+}
+
+export type TripUpsertWithoutReviewsInput = {
+ update: Prisma.XOR
+ create: Prisma.XOR
+ where?: Prisma.TripWhereInput
+}
+
+export type TripUpdateToOneWithWhereWithoutReviewsInput = {
+ where?: Prisma.TripWhereInput
+ data: Prisma.XOR
+}
+
+export type TripUpdateWithoutReviewsInput = {
+ id?: Prisma.StringFieldUpdateOperationsInput | string
+ title?: Prisma.StringFieldUpdateOperationsInput | string
+ description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
+ mountain?: Prisma.StringFieldUpdateOperationsInput | string
+ location?: Prisma.StringFieldUpdateOperationsInput | string
+ date?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ endDate?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
+ maxParticipants?: Prisma.IntFieldUpdateOperationsInput | number
+ price?: Prisma.IntFieldUpdateOperationsInput | number
+ status?: Prisma.EnumTripStatusFieldUpdateOperationsInput | $Enums.TripStatus
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ organizer?: Prisma.UserUpdateOneRequiredWithoutTripsNestedInput
+ participants?: Prisma.TripParticipantUpdateManyWithoutTripNestedInput
+ images?: Prisma.TripImageUpdateManyWithoutTripNestedInput
+}
+
+export type TripUncheckedUpdateWithoutReviewsInput = {
+ id?: Prisma.StringFieldUpdateOperationsInput | string
+ title?: Prisma.StringFieldUpdateOperationsInput | string
+ description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
+ mountain?: Prisma.StringFieldUpdateOperationsInput | string
+ location?: Prisma.StringFieldUpdateOperationsInput | string
+ date?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ endDate?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
+ maxParticipants?: Prisma.IntFieldUpdateOperationsInput | number
+ price?: Prisma.IntFieldUpdateOperationsInput | number
+ status?: Prisma.EnumTripStatusFieldUpdateOperationsInput | $Enums.TripStatus
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ organizerId?: Prisma.StringFieldUpdateOperationsInput | string
+ participants?: Prisma.TripParticipantUncheckedUpdateManyWithoutTripNestedInput
+ images?: Prisma.TripImageUncheckedUpdateManyWithoutTripNestedInput
+}
+
export type TripCreateWithoutImagesInput = {
id?: string
title: string
@@ -742,6 +853,7 @@ export type TripCreateWithoutImagesInput = {
updatedAt?: Date | string
organizer: Prisma.UserCreateNestedOneWithoutTripsInput
participants?: Prisma.TripParticipantCreateNestedManyWithoutTripInput
+ reviews?: Prisma.TripReviewCreateNestedManyWithoutTripInput
}
export type TripUncheckedCreateWithoutImagesInput = {
@@ -759,6 +871,7 @@ export type TripUncheckedCreateWithoutImagesInput = {
updatedAt?: Date | string
organizerId: string
participants?: Prisma.TripParticipantUncheckedCreateNestedManyWithoutTripInput
+ reviews?: Prisma.TripReviewUncheckedCreateNestedManyWithoutTripInput
}
export type TripCreateOrConnectWithoutImagesInput = {
@@ -792,6 +905,7 @@ export type TripUpdateWithoutImagesInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
organizer?: Prisma.UserUpdateOneRequiredWithoutTripsNestedInput
participants?: Prisma.TripParticipantUpdateManyWithoutTripNestedInput
+ reviews?: Prisma.TripReviewUpdateManyWithoutTripNestedInput
}
export type TripUncheckedUpdateWithoutImagesInput = {
@@ -809,6 +923,7 @@ export type TripUncheckedUpdateWithoutImagesInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
organizerId?: Prisma.StringFieldUpdateOperationsInput | string
participants?: Prisma.TripParticipantUncheckedUpdateManyWithoutTripNestedInput
+ reviews?: Prisma.TripReviewUncheckedUpdateManyWithoutTripNestedInput
}
export type TripCreateWithoutParticipantsInput = {
@@ -826,6 +941,7 @@ export type TripCreateWithoutParticipantsInput = {
updatedAt?: Date | string
organizer: Prisma.UserCreateNestedOneWithoutTripsInput
images?: Prisma.TripImageCreateNestedManyWithoutTripInput
+ reviews?: Prisma.TripReviewCreateNestedManyWithoutTripInput
}
export type TripUncheckedCreateWithoutParticipantsInput = {
@@ -843,6 +959,7 @@ export type TripUncheckedCreateWithoutParticipantsInput = {
updatedAt?: Date | string
organizerId: string
images?: Prisma.TripImageUncheckedCreateNestedManyWithoutTripInput
+ reviews?: Prisma.TripReviewUncheckedCreateNestedManyWithoutTripInput
}
export type TripCreateOrConnectWithoutParticipantsInput = {
@@ -876,6 +993,7 @@ export type TripUpdateWithoutParticipantsInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
organizer?: Prisma.UserUpdateOneRequiredWithoutTripsNestedInput
images?: Prisma.TripImageUpdateManyWithoutTripNestedInput
+ reviews?: Prisma.TripReviewUpdateManyWithoutTripNestedInput
}
export type TripUncheckedUpdateWithoutParticipantsInput = {
@@ -893,6 +1011,7 @@ export type TripUncheckedUpdateWithoutParticipantsInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
organizerId?: Prisma.StringFieldUpdateOperationsInput | string
images?: Prisma.TripImageUncheckedUpdateManyWithoutTripNestedInput
+ reviews?: Prisma.TripReviewUncheckedUpdateManyWithoutTripNestedInput
}
export type TripCreateManyOrganizerInput = {
@@ -925,6 +1044,7 @@ export type TripUpdateWithoutOrganizerInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
participants?: Prisma.TripParticipantUpdateManyWithoutTripNestedInput
images?: Prisma.TripImageUpdateManyWithoutTripNestedInput
+ reviews?: Prisma.TripReviewUpdateManyWithoutTripNestedInput
}
export type TripUncheckedUpdateWithoutOrganizerInput = {
@@ -942,6 +1062,7 @@ export type TripUncheckedUpdateWithoutOrganizerInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
participants?: Prisma.TripParticipantUncheckedUpdateManyWithoutTripNestedInput
images?: Prisma.TripImageUncheckedUpdateManyWithoutTripNestedInput
+ reviews?: Prisma.TripReviewUncheckedUpdateManyWithoutTripNestedInput
}
export type TripUncheckedUpdateManyWithoutOrganizerInput = {
@@ -967,11 +1088,13 @@ export type TripUncheckedUpdateManyWithoutOrganizerInput = {
export type TripCountOutputType = {
participants: number
images: number
+ reviews: number
}
export type TripCountOutputTypeSelect = {
participants?: boolean | TripCountOutputTypeCountParticipantsArgs
images?: boolean | TripCountOutputTypeCountImagesArgs
+ reviews?: boolean | TripCountOutputTypeCountReviewsArgs
}
/**
@@ -998,6 +1121,13 @@ export type TripCountOutputTypeCountImagesArgs = {
+ where?: Prisma.TripReviewWhereInput
+}
+
export type TripSelect = runtime.Types.Extensions.GetSelect<{
id?: boolean
@@ -1016,6 +1146,7 @@ export type TripSelect
participants?: boolean | Prisma.Trip$participantsArgs
images?: boolean | Prisma.Trip$imagesArgs
+ reviews?: boolean | Prisma.Trip$reviewsArgs
_count?: boolean | Prisma.TripCountOutputTypeDefaultArgs
}, ExtArgs["result"]["trip"]>
@@ -1074,6 +1205,7 @@ export type TripInclude
participants?: boolean | Prisma.Trip$participantsArgs
images?: boolean | Prisma.Trip$imagesArgs
+ reviews?: boolean | Prisma.Trip$reviewsArgs
_count?: boolean | Prisma.TripCountOutputTypeDefaultArgs
}
export type TripIncludeCreateManyAndReturn = {
@@ -1089,6 +1221,7 @@ export type $TripPayload
participants: Prisma.$TripParticipantPayload[]
images: Prisma.$TripImagePayload[]
+ reviews: Prisma.$TripReviewPayload[]
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: string
@@ -1501,6 +1634,7 @@ export interface Prisma__TripClient = {}>(args?: Prisma.Subset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
participants = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null>
images = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null>
+ reviews = {}>(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.
@@ -1991,6 +2125,30 @@ export type Trip$imagesArgs = {
+ /**
+ * Select specific fields to fetch from the TripReview
+ */
+ select?: Prisma.TripReviewSelect | null
+ /**
+ * Omit specific fields from the TripReview
+ */
+ omit?: Prisma.TripReviewOmit | null
+ /**
+ * Choose, which related nodes to fetch as well
+ */
+ include?: Prisma.TripReviewInclude | null
+ where?: Prisma.TripReviewWhereInput
+ orderBy?: Prisma.TripReviewOrderByWithRelationInput | Prisma.TripReviewOrderByWithRelationInput[]
+ cursor?: Prisma.TripReviewWhereUniqueInput
+ take?: number
+ skip?: number
+ distinct?: Prisma.TripReviewScalarFieldEnum | Prisma.TripReviewScalarFieldEnum[]
+}
+
/**
* Trip without action
*/
diff --git a/app/generated/prisma/models/TripReview.ts b/app/generated/prisma/models/TripReview.ts
new file mode 100644
index 0000000..0d48a43
--- /dev/null
+++ b/app/generated/prisma/models/TripReview.ts
@@ -0,0 +1,1597 @@
+
+/* !!! This is code generated by Prisma. Do not edit directly. !!! */
+/* eslint-disable */
+// biome-ignore-all lint: generated file
+// @ts-nocheck
+/*
+ * This file exports the `TripReview` 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 TripReview
+ *
+ */
+export type TripReviewModel = runtime.Types.Result.DefaultSelection
+
+export type AggregateTripReview = {
+ _count: TripReviewCountAggregateOutputType | null
+ _avg: TripReviewAvgAggregateOutputType | null
+ _sum: TripReviewSumAggregateOutputType | null
+ _min: TripReviewMinAggregateOutputType | null
+ _max: TripReviewMaxAggregateOutputType | null
+}
+
+export type TripReviewAvgAggregateOutputType = {
+ rating: number | null
+}
+
+export type TripReviewSumAggregateOutputType = {
+ rating: number | null
+}
+
+export type TripReviewMinAggregateOutputType = {
+ id: string | null
+ rating: number | null
+ comment: string | null
+ createdAt: Date | null
+ updatedAt: Date | null
+ tripId: string | null
+ userId: string | null
+}
+
+export type TripReviewMaxAggregateOutputType = {
+ id: string | null
+ rating: number | null
+ comment: string | null
+ createdAt: Date | null
+ updatedAt: Date | null
+ tripId: string | null
+ userId: string | null
+}
+
+export type TripReviewCountAggregateOutputType = {
+ id: number
+ rating: number
+ comment: number
+ createdAt: number
+ updatedAt: number
+ tripId: number
+ userId: number
+ _all: number
+}
+
+
+export type TripReviewAvgAggregateInputType = {
+ rating?: true
+}
+
+export type TripReviewSumAggregateInputType = {
+ rating?: true
+}
+
+export type TripReviewMinAggregateInputType = {
+ id?: true
+ rating?: true
+ comment?: true
+ createdAt?: true
+ updatedAt?: true
+ tripId?: true
+ userId?: true
+}
+
+export type TripReviewMaxAggregateInputType = {
+ id?: true
+ rating?: true
+ comment?: true
+ createdAt?: true
+ updatedAt?: true
+ tripId?: true
+ userId?: true
+}
+
+export type TripReviewCountAggregateInputType = {
+ id?: true
+ rating?: true
+ comment?: true
+ createdAt?: true
+ updatedAt?: true
+ tripId?: true
+ userId?: true
+ _all?: true
+}
+
+export type TripReviewAggregateArgs = {
+ /**
+ * Filter which TripReview to aggregate.
+ */
+ where?: Prisma.TripReviewWhereInput
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
+ *
+ * Determine the order of TripReviews to fetch.
+ */
+ orderBy?: Prisma.TripReviewOrderByWithRelationInput | Prisma.TripReviewOrderByWithRelationInput[]
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
+ *
+ * Sets the start position
+ */
+ cursor?: Prisma.TripReviewWhereUniqueInput
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
+ *
+ * Take `±n` TripReviews 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` TripReviews.
+ */
+ skip?: number
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
+ *
+ * Count returned TripReviews
+ **/
+ _count?: true | TripReviewCountAggregateInputType
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
+ *
+ * Select which fields to average
+ **/
+ _avg?: TripReviewAvgAggregateInputType
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
+ *
+ * Select which fields to sum
+ **/
+ _sum?: TripReviewSumAggregateInputType
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
+ *
+ * Select which fields to find the minimum value
+ **/
+ _min?: TripReviewMinAggregateInputType
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
+ *
+ * Select which fields to find the maximum value
+ **/
+ _max?: TripReviewMaxAggregateInputType
+}
+
+export type GetTripReviewAggregateType = {
+ [P in keyof T & keyof AggregateTripReview]: P extends '_count' | 'count'
+ ? T[P] extends true
+ ? number
+ : Prisma.GetScalarType
+ : Prisma.GetScalarType
+}
+
+
+
+
+export type TripReviewGroupByArgs = {
+ where?: Prisma.TripReviewWhereInput
+ orderBy?: Prisma.TripReviewOrderByWithAggregationInput | Prisma.TripReviewOrderByWithAggregationInput[]
+ by: Prisma.TripReviewScalarFieldEnum[] | Prisma.TripReviewScalarFieldEnum
+ having?: Prisma.TripReviewScalarWhereWithAggregatesInput
+ take?: number
+ skip?: number
+ _count?: TripReviewCountAggregateInputType | true
+ _avg?: TripReviewAvgAggregateInputType
+ _sum?: TripReviewSumAggregateInputType
+ _min?: TripReviewMinAggregateInputType
+ _max?: TripReviewMaxAggregateInputType
+}
+
+export type TripReviewGroupByOutputType = {
+ id: string
+ rating: number
+ comment: string | null
+ createdAt: Date
+ updatedAt: Date
+ tripId: string
+ userId: string
+ _count: TripReviewCountAggregateOutputType | null
+ _avg: TripReviewAvgAggregateOutputType | null
+ _sum: TripReviewSumAggregateOutputType | null
+ _min: TripReviewMinAggregateOutputType | null
+ _max: TripReviewMaxAggregateOutputType | null
+}
+
+export type GetTripReviewGroupByPayload = Prisma.PrismaPromise<
+ Array<
+ Prisma.PickEnumerable &
+ {
+ [P in ((keyof T) & (keyof TripReviewGroupByOutputType))]: P extends '_count'
+ ? T[P] extends boolean
+ ? number
+ : Prisma.GetScalarType
+ : Prisma.GetScalarType
+ }
+ >
+ >
+
+
+
+export type TripReviewWhereInput = {
+ AND?: Prisma.TripReviewWhereInput | Prisma.TripReviewWhereInput[]
+ OR?: Prisma.TripReviewWhereInput[]
+ NOT?: Prisma.TripReviewWhereInput | Prisma.TripReviewWhereInput[]
+ id?: Prisma.StringFilter<"TripReview"> | string
+ rating?: Prisma.IntFilter<"TripReview"> | number
+ comment?: Prisma.StringNullableFilter<"TripReview"> | string | null
+ createdAt?: Prisma.DateTimeFilter<"TripReview"> | Date | string
+ updatedAt?: Prisma.DateTimeFilter<"TripReview"> | Date | string
+ tripId?: Prisma.StringFilter<"TripReview"> | string
+ userId?: Prisma.StringFilter<"TripReview"> | string
+ trip?: Prisma.XOR
+ user?: Prisma.XOR
+}
+
+export type TripReviewOrderByWithRelationInput = {
+ id?: Prisma.SortOrder
+ rating?: Prisma.SortOrder
+ comment?: Prisma.SortOrderInput | Prisma.SortOrder
+ createdAt?: Prisma.SortOrder
+ updatedAt?: Prisma.SortOrder
+ tripId?: Prisma.SortOrder
+ userId?: Prisma.SortOrder
+ trip?: Prisma.TripOrderByWithRelationInput
+ user?: Prisma.UserOrderByWithRelationInput
+}
+
+export type TripReviewWhereUniqueInput = Prisma.AtLeast<{
+ id?: string
+ tripId_userId?: Prisma.TripReviewTripIdUserIdCompoundUniqueInput
+ AND?: Prisma.TripReviewWhereInput | Prisma.TripReviewWhereInput[]
+ OR?: Prisma.TripReviewWhereInput[]
+ NOT?: Prisma.TripReviewWhereInput | Prisma.TripReviewWhereInput[]
+ rating?: Prisma.IntFilter<"TripReview"> | number
+ comment?: Prisma.StringNullableFilter<"TripReview"> | string | null
+ createdAt?: Prisma.DateTimeFilter<"TripReview"> | Date | string
+ updatedAt?: Prisma.DateTimeFilter<"TripReview"> | Date | string
+ tripId?: Prisma.StringFilter<"TripReview"> | string
+ userId?: Prisma.StringFilter<"TripReview"> | string
+ trip?: Prisma.XOR
+ user?: Prisma.XOR
+}, "id" | "tripId_userId">
+
+export type TripReviewOrderByWithAggregationInput = {
+ id?: Prisma.SortOrder
+ rating?: Prisma.SortOrder
+ comment?: Prisma.SortOrderInput | Prisma.SortOrder
+ createdAt?: Prisma.SortOrder
+ updatedAt?: Prisma.SortOrder
+ tripId?: Prisma.SortOrder
+ userId?: Prisma.SortOrder
+ _count?: Prisma.TripReviewCountOrderByAggregateInput
+ _avg?: Prisma.TripReviewAvgOrderByAggregateInput
+ _max?: Prisma.TripReviewMaxOrderByAggregateInput
+ _min?: Prisma.TripReviewMinOrderByAggregateInput
+ _sum?: Prisma.TripReviewSumOrderByAggregateInput
+}
+
+export type TripReviewScalarWhereWithAggregatesInput = {
+ AND?: Prisma.TripReviewScalarWhereWithAggregatesInput | Prisma.TripReviewScalarWhereWithAggregatesInput[]
+ OR?: Prisma.TripReviewScalarWhereWithAggregatesInput[]
+ NOT?: Prisma.TripReviewScalarWhereWithAggregatesInput | Prisma.TripReviewScalarWhereWithAggregatesInput[]
+ id?: Prisma.StringWithAggregatesFilter<"TripReview"> | string
+ rating?: Prisma.IntWithAggregatesFilter<"TripReview"> | number
+ comment?: Prisma.StringNullableWithAggregatesFilter<"TripReview"> | string | null
+ createdAt?: Prisma.DateTimeWithAggregatesFilter<"TripReview"> | Date | string
+ updatedAt?: Prisma.DateTimeWithAggregatesFilter<"TripReview"> | Date | string
+ tripId?: Prisma.StringWithAggregatesFilter<"TripReview"> | string
+ userId?: Prisma.StringWithAggregatesFilter<"TripReview"> | string
+}
+
+export type TripReviewCreateInput = {
+ id?: string
+ rating: number
+ comment?: string | null
+ createdAt?: Date | string
+ updatedAt?: Date | string
+ trip: Prisma.TripCreateNestedOneWithoutReviewsInput
+ user: Prisma.UserCreateNestedOneWithoutTripReviewsInput
+}
+
+export type TripReviewUncheckedCreateInput = {
+ id?: string
+ rating: number
+ comment?: string | null
+ createdAt?: Date | string
+ updatedAt?: Date | string
+ tripId: string
+ userId: string
+}
+
+export type TripReviewUpdateInput = {
+ id?: Prisma.StringFieldUpdateOperationsInput | string
+ rating?: Prisma.IntFieldUpdateOperationsInput | number
+ comment?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ trip?: Prisma.TripUpdateOneRequiredWithoutReviewsNestedInput
+ user?: Prisma.UserUpdateOneRequiredWithoutTripReviewsNestedInput
+}
+
+export type TripReviewUncheckedUpdateInput = {
+ id?: Prisma.StringFieldUpdateOperationsInput | string
+ rating?: Prisma.IntFieldUpdateOperationsInput | number
+ comment?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ tripId?: Prisma.StringFieldUpdateOperationsInput | string
+ userId?: Prisma.StringFieldUpdateOperationsInput | string
+}
+
+export type TripReviewCreateManyInput = {
+ id?: string
+ rating: number
+ comment?: string | null
+ createdAt?: Date | string
+ updatedAt?: Date | string
+ tripId: string
+ userId: string
+}
+
+export type TripReviewUpdateManyMutationInput = {
+ id?: Prisma.StringFieldUpdateOperationsInput | string
+ rating?: Prisma.IntFieldUpdateOperationsInput | number
+ comment?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+}
+
+export type TripReviewUncheckedUpdateManyInput = {
+ id?: Prisma.StringFieldUpdateOperationsInput | string
+ rating?: Prisma.IntFieldUpdateOperationsInput | number
+ comment?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ tripId?: Prisma.StringFieldUpdateOperationsInput | string
+ userId?: Prisma.StringFieldUpdateOperationsInput | string
+}
+
+export type TripReviewListRelationFilter = {
+ every?: Prisma.TripReviewWhereInput
+ some?: Prisma.TripReviewWhereInput
+ none?: Prisma.TripReviewWhereInput
+}
+
+export type TripReviewOrderByRelationAggregateInput = {
+ _count?: Prisma.SortOrder
+}
+
+export type TripReviewTripIdUserIdCompoundUniqueInput = {
+ tripId: string
+ userId: string
+}
+
+export type TripReviewCountOrderByAggregateInput = {
+ id?: Prisma.SortOrder
+ rating?: Prisma.SortOrder
+ comment?: Prisma.SortOrder
+ createdAt?: Prisma.SortOrder
+ updatedAt?: Prisma.SortOrder
+ tripId?: Prisma.SortOrder
+ userId?: Prisma.SortOrder
+}
+
+export type TripReviewAvgOrderByAggregateInput = {
+ rating?: Prisma.SortOrder
+}
+
+export type TripReviewMaxOrderByAggregateInput = {
+ id?: Prisma.SortOrder
+ rating?: Prisma.SortOrder
+ comment?: Prisma.SortOrder
+ createdAt?: Prisma.SortOrder
+ updatedAt?: Prisma.SortOrder
+ tripId?: Prisma.SortOrder
+ userId?: Prisma.SortOrder
+}
+
+export type TripReviewMinOrderByAggregateInput = {
+ id?: Prisma.SortOrder
+ rating?: Prisma.SortOrder
+ comment?: Prisma.SortOrder
+ createdAt?: Prisma.SortOrder
+ updatedAt?: Prisma.SortOrder
+ tripId?: Prisma.SortOrder
+ userId?: Prisma.SortOrder
+}
+
+export type TripReviewSumOrderByAggregateInput = {
+ rating?: Prisma.SortOrder
+}
+
+export type TripReviewCreateNestedManyWithoutUserInput = {
+ create?: Prisma.XOR | Prisma.TripReviewCreateWithoutUserInput[] | Prisma.TripReviewUncheckedCreateWithoutUserInput[]
+ connectOrCreate?: Prisma.TripReviewCreateOrConnectWithoutUserInput | Prisma.TripReviewCreateOrConnectWithoutUserInput[]
+ createMany?: Prisma.TripReviewCreateManyUserInputEnvelope
+ connect?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+}
+
+export type TripReviewUncheckedCreateNestedManyWithoutUserInput = {
+ create?: Prisma.XOR | Prisma.TripReviewCreateWithoutUserInput[] | Prisma.TripReviewUncheckedCreateWithoutUserInput[]
+ connectOrCreate?: Prisma.TripReviewCreateOrConnectWithoutUserInput | Prisma.TripReviewCreateOrConnectWithoutUserInput[]
+ createMany?: Prisma.TripReviewCreateManyUserInputEnvelope
+ connect?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+}
+
+export type TripReviewUpdateManyWithoutUserNestedInput = {
+ create?: Prisma.XOR | Prisma.TripReviewCreateWithoutUserInput[] | Prisma.TripReviewUncheckedCreateWithoutUserInput[]
+ connectOrCreate?: Prisma.TripReviewCreateOrConnectWithoutUserInput | Prisma.TripReviewCreateOrConnectWithoutUserInput[]
+ upsert?: Prisma.TripReviewUpsertWithWhereUniqueWithoutUserInput | Prisma.TripReviewUpsertWithWhereUniqueWithoutUserInput[]
+ createMany?: Prisma.TripReviewCreateManyUserInputEnvelope
+ set?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ disconnect?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ delete?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ connect?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ update?: Prisma.TripReviewUpdateWithWhereUniqueWithoutUserInput | Prisma.TripReviewUpdateWithWhereUniqueWithoutUserInput[]
+ updateMany?: Prisma.TripReviewUpdateManyWithWhereWithoutUserInput | Prisma.TripReviewUpdateManyWithWhereWithoutUserInput[]
+ deleteMany?: Prisma.TripReviewScalarWhereInput | Prisma.TripReviewScalarWhereInput[]
+}
+
+export type TripReviewUncheckedUpdateManyWithoutUserNestedInput = {
+ create?: Prisma.XOR | Prisma.TripReviewCreateWithoutUserInput[] | Prisma.TripReviewUncheckedCreateWithoutUserInput[]
+ connectOrCreate?: Prisma.TripReviewCreateOrConnectWithoutUserInput | Prisma.TripReviewCreateOrConnectWithoutUserInput[]
+ upsert?: Prisma.TripReviewUpsertWithWhereUniqueWithoutUserInput | Prisma.TripReviewUpsertWithWhereUniqueWithoutUserInput[]
+ createMany?: Prisma.TripReviewCreateManyUserInputEnvelope
+ set?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ disconnect?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ delete?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ connect?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ update?: Prisma.TripReviewUpdateWithWhereUniqueWithoutUserInput | Prisma.TripReviewUpdateWithWhereUniqueWithoutUserInput[]
+ updateMany?: Prisma.TripReviewUpdateManyWithWhereWithoutUserInput | Prisma.TripReviewUpdateManyWithWhereWithoutUserInput[]
+ deleteMany?: Prisma.TripReviewScalarWhereInput | Prisma.TripReviewScalarWhereInput[]
+}
+
+export type TripReviewCreateNestedManyWithoutTripInput = {
+ create?: Prisma.XOR | Prisma.TripReviewCreateWithoutTripInput[] | Prisma.TripReviewUncheckedCreateWithoutTripInput[]
+ connectOrCreate?: Prisma.TripReviewCreateOrConnectWithoutTripInput | Prisma.TripReviewCreateOrConnectWithoutTripInput[]
+ createMany?: Prisma.TripReviewCreateManyTripInputEnvelope
+ connect?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+}
+
+export type TripReviewUncheckedCreateNestedManyWithoutTripInput = {
+ create?: Prisma.XOR | Prisma.TripReviewCreateWithoutTripInput[] | Prisma.TripReviewUncheckedCreateWithoutTripInput[]
+ connectOrCreate?: Prisma.TripReviewCreateOrConnectWithoutTripInput | Prisma.TripReviewCreateOrConnectWithoutTripInput[]
+ createMany?: Prisma.TripReviewCreateManyTripInputEnvelope
+ connect?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+}
+
+export type TripReviewUpdateManyWithoutTripNestedInput = {
+ create?: Prisma.XOR | Prisma.TripReviewCreateWithoutTripInput[] | Prisma.TripReviewUncheckedCreateWithoutTripInput[]
+ connectOrCreate?: Prisma.TripReviewCreateOrConnectWithoutTripInput | Prisma.TripReviewCreateOrConnectWithoutTripInput[]
+ upsert?: Prisma.TripReviewUpsertWithWhereUniqueWithoutTripInput | Prisma.TripReviewUpsertWithWhereUniqueWithoutTripInput[]
+ createMany?: Prisma.TripReviewCreateManyTripInputEnvelope
+ set?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ disconnect?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ delete?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ connect?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ update?: Prisma.TripReviewUpdateWithWhereUniqueWithoutTripInput | Prisma.TripReviewUpdateWithWhereUniqueWithoutTripInput[]
+ updateMany?: Prisma.TripReviewUpdateManyWithWhereWithoutTripInput | Prisma.TripReviewUpdateManyWithWhereWithoutTripInput[]
+ deleteMany?: Prisma.TripReviewScalarWhereInput | Prisma.TripReviewScalarWhereInput[]
+}
+
+export type TripReviewUncheckedUpdateManyWithoutTripNestedInput = {
+ create?: Prisma.XOR | Prisma.TripReviewCreateWithoutTripInput[] | Prisma.TripReviewUncheckedCreateWithoutTripInput[]
+ connectOrCreate?: Prisma.TripReviewCreateOrConnectWithoutTripInput | Prisma.TripReviewCreateOrConnectWithoutTripInput[]
+ upsert?: Prisma.TripReviewUpsertWithWhereUniqueWithoutTripInput | Prisma.TripReviewUpsertWithWhereUniqueWithoutTripInput[]
+ createMany?: Prisma.TripReviewCreateManyTripInputEnvelope
+ set?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ disconnect?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ delete?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ connect?: Prisma.TripReviewWhereUniqueInput | Prisma.TripReviewWhereUniqueInput[]
+ update?: Prisma.TripReviewUpdateWithWhereUniqueWithoutTripInput | Prisma.TripReviewUpdateWithWhereUniqueWithoutTripInput[]
+ updateMany?: Prisma.TripReviewUpdateManyWithWhereWithoutTripInput | Prisma.TripReviewUpdateManyWithWhereWithoutTripInput[]
+ deleteMany?: Prisma.TripReviewScalarWhereInput | Prisma.TripReviewScalarWhereInput[]
+}
+
+export type TripReviewCreateWithoutUserInput = {
+ id?: string
+ rating: number
+ comment?: string | null
+ createdAt?: Date | string
+ updatedAt?: Date | string
+ trip: Prisma.TripCreateNestedOneWithoutReviewsInput
+}
+
+export type TripReviewUncheckedCreateWithoutUserInput = {
+ id?: string
+ rating: number
+ comment?: string | null
+ createdAt?: Date | string
+ updatedAt?: Date | string
+ tripId: string
+}
+
+export type TripReviewCreateOrConnectWithoutUserInput = {
+ where: Prisma.TripReviewWhereUniqueInput
+ create: Prisma.XOR
+}
+
+export type TripReviewCreateManyUserInputEnvelope = {
+ data: Prisma.TripReviewCreateManyUserInput | Prisma.TripReviewCreateManyUserInput[]
+ skipDuplicates?: boolean
+}
+
+export type TripReviewUpsertWithWhereUniqueWithoutUserInput = {
+ where: Prisma.TripReviewWhereUniqueInput
+ update: Prisma.XOR
+ create: Prisma.XOR
+}
+
+export type TripReviewUpdateWithWhereUniqueWithoutUserInput = {
+ where: Prisma.TripReviewWhereUniqueInput
+ data: Prisma.XOR
+}
+
+export type TripReviewUpdateManyWithWhereWithoutUserInput = {
+ where: Prisma.TripReviewScalarWhereInput
+ data: Prisma.XOR
+}
+
+export type TripReviewScalarWhereInput = {
+ AND?: Prisma.TripReviewScalarWhereInput | Prisma.TripReviewScalarWhereInput[]
+ OR?: Prisma.TripReviewScalarWhereInput[]
+ NOT?: Prisma.TripReviewScalarWhereInput | Prisma.TripReviewScalarWhereInput[]
+ id?: Prisma.StringFilter<"TripReview"> | string
+ rating?: Prisma.IntFilter<"TripReview"> | number
+ comment?: Prisma.StringNullableFilter<"TripReview"> | string | null
+ createdAt?: Prisma.DateTimeFilter<"TripReview"> | Date | string
+ updatedAt?: Prisma.DateTimeFilter<"TripReview"> | Date | string
+ tripId?: Prisma.StringFilter<"TripReview"> | string
+ userId?: Prisma.StringFilter<"TripReview"> | string
+}
+
+export type TripReviewCreateWithoutTripInput = {
+ id?: string
+ rating: number
+ comment?: string | null
+ createdAt?: Date | string
+ updatedAt?: Date | string
+ user: Prisma.UserCreateNestedOneWithoutTripReviewsInput
+}
+
+export type TripReviewUncheckedCreateWithoutTripInput = {
+ id?: string
+ rating: number
+ comment?: string | null
+ createdAt?: Date | string
+ updatedAt?: Date | string
+ userId: string
+}
+
+export type TripReviewCreateOrConnectWithoutTripInput = {
+ where: Prisma.TripReviewWhereUniqueInput
+ create: Prisma.XOR
+}
+
+export type TripReviewCreateManyTripInputEnvelope = {
+ data: Prisma.TripReviewCreateManyTripInput | Prisma.TripReviewCreateManyTripInput[]
+ skipDuplicates?: boolean
+}
+
+export type TripReviewUpsertWithWhereUniqueWithoutTripInput = {
+ where: Prisma.TripReviewWhereUniqueInput
+ update: Prisma.XOR
+ create: Prisma.XOR
+}
+
+export type TripReviewUpdateWithWhereUniqueWithoutTripInput = {
+ where: Prisma.TripReviewWhereUniqueInput
+ data: Prisma.XOR
+}
+
+export type TripReviewUpdateManyWithWhereWithoutTripInput = {
+ where: Prisma.TripReviewScalarWhereInput
+ data: Prisma.XOR
+}
+
+export type TripReviewCreateManyUserInput = {
+ id?: string
+ rating: number
+ comment?: string | null
+ createdAt?: Date | string
+ updatedAt?: Date | string
+ tripId: string
+}
+
+export type TripReviewUpdateWithoutUserInput = {
+ id?: Prisma.StringFieldUpdateOperationsInput | string
+ rating?: Prisma.IntFieldUpdateOperationsInput | number
+ comment?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ trip?: Prisma.TripUpdateOneRequiredWithoutReviewsNestedInput
+}
+
+export type TripReviewUncheckedUpdateWithoutUserInput = {
+ id?: Prisma.StringFieldUpdateOperationsInput | string
+ rating?: Prisma.IntFieldUpdateOperationsInput | number
+ comment?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ tripId?: Prisma.StringFieldUpdateOperationsInput | string
+}
+
+export type TripReviewUncheckedUpdateManyWithoutUserInput = {
+ id?: Prisma.StringFieldUpdateOperationsInput | string
+ rating?: Prisma.IntFieldUpdateOperationsInput | number
+ comment?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ tripId?: Prisma.StringFieldUpdateOperationsInput | string
+}
+
+export type TripReviewCreateManyTripInput = {
+ id?: string
+ rating: number
+ comment?: string | null
+ createdAt?: Date | string
+ updatedAt?: Date | string
+ userId: string
+}
+
+export type TripReviewUpdateWithoutTripInput = {
+ id?: Prisma.StringFieldUpdateOperationsInput | string
+ rating?: Prisma.IntFieldUpdateOperationsInput | number
+ comment?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ user?: Prisma.UserUpdateOneRequiredWithoutTripReviewsNestedInput
+}
+
+export type TripReviewUncheckedUpdateWithoutTripInput = {
+ id?: Prisma.StringFieldUpdateOperationsInput | string
+ rating?: Prisma.IntFieldUpdateOperationsInput | number
+ comment?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ userId?: Prisma.StringFieldUpdateOperationsInput | string
+}
+
+export type TripReviewUncheckedUpdateManyWithoutTripInput = {
+ id?: Prisma.StringFieldUpdateOperationsInput | string
+ rating?: Prisma.IntFieldUpdateOperationsInput | number
+ comment?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
+ createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
+ userId?: Prisma.StringFieldUpdateOperationsInput | string
+}
+
+
+
+export type TripReviewSelect = runtime.Types.Extensions.GetSelect<{
+ id?: boolean
+ rating?: boolean
+ comment?: boolean
+ createdAt?: boolean
+ updatedAt?: boolean
+ tripId?: boolean
+ userId?: boolean
+ trip?: boolean | Prisma.TripDefaultArgs
+ user?: boolean | Prisma.UserDefaultArgs
+}, ExtArgs["result"]["tripReview"]>
+
+export type TripReviewSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{
+ id?: boolean
+ rating?: boolean
+ comment?: boolean
+ createdAt?: boolean
+ updatedAt?: boolean
+ tripId?: boolean
+ userId?: boolean
+ trip?: boolean | Prisma.TripDefaultArgs
+ user?: boolean | Prisma.UserDefaultArgs
+}, ExtArgs["result"]["tripReview"]>
+
+export type TripReviewSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{
+ id?: boolean
+ rating?: boolean
+ comment?: boolean
+ createdAt?: boolean
+ updatedAt?: boolean
+ tripId?: boolean
+ userId?: boolean
+ trip?: boolean | Prisma.TripDefaultArgs
+ user?: boolean | Prisma.UserDefaultArgs
+}, ExtArgs["result"]["tripReview"]>
+
+export type TripReviewSelectScalar = {
+ id?: boolean
+ rating?: boolean
+ comment?: boolean
+ createdAt?: boolean
+ updatedAt?: boolean
+ tripId?: boolean
+ userId?: boolean
+}
+
+export type TripReviewOmit = runtime.Types.Extensions.GetOmit<"id" | "rating" | "comment" | "createdAt" | "updatedAt" | "tripId" | "userId", ExtArgs["result"]["tripReview"]>
+export type TripReviewInclude = {
+ trip?: boolean | Prisma.TripDefaultArgs
+ user?: boolean | Prisma.UserDefaultArgs
+}
+export type TripReviewIncludeCreateManyAndReturn = {
+ trip?: boolean | Prisma.TripDefaultArgs
+ user?: boolean | Prisma.UserDefaultArgs
+}
+export type TripReviewIncludeUpdateManyAndReturn = {
+ trip?: boolean | Prisma.TripDefaultArgs
+ user?: boolean | Prisma.UserDefaultArgs
+}
+
+export type $TripReviewPayload = {
+ name: "TripReview"
+ objects: {
+ trip: Prisma.$TripPayload
+ user: Prisma.$UserPayload
+ }
+ scalars: runtime.Types.Extensions.GetPayloadResult<{
+ id: string
+ rating: number
+ comment: string | null
+ createdAt: Date
+ updatedAt: Date
+ tripId: string
+ userId: string
+ }, ExtArgs["result"]["tripReview"]>
+ composites: {}
+}
+
+export type TripReviewGetPayload = runtime.Types.Result.GetResult
+
+export type TripReviewCountArgs =
+ Omit & {
+ select?: TripReviewCountAggregateInputType | true
+ }
+
+export interface TripReviewDelegate {
+ [K: symbol]: { types: Prisma.TypeMap['model']['TripReview'], meta: { name: 'TripReview' } }
+ /**
+ * Find zero or one TripReview that matches the filter.
+ * @param {TripReviewFindUniqueArgs} args - Arguments to find a TripReview
+ * @example
+ * // Get one TripReview
+ * const tripReview = await prisma.tripReview.findUnique({
+ * where: {
+ * // ... provide filter here
+ * }
+ * })
+ */
+ findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__TripReviewClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
+
+ /**
+ * Find one TripReview that matches the filter or throw an error with `error.code='P2025'`
+ * if no matches were found.
+ * @param {TripReviewFindUniqueOrThrowArgs} args - Arguments to find a TripReview
+ * @example
+ * // Get one TripReview
+ * const tripReview = await prisma.tripReview.findUniqueOrThrow({
+ * where: {
+ * // ... provide filter here
+ * }
+ * })
+ */
+ findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__TripReviewClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>
+
+ /**
+ * Find the first TripReview 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 {TripReviewFindFirstArgs} args - Arguments to find a TripReview
+ * @example
+ * // Get one TripReview
+ * const tripReview = await prisma.tripReview.findFirst({
+ * where: {
+ * // ... provide filter here
+ * }
+ * })
+ */
+ findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__TripReviewClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
+
+ /**
+ * Find the first TripReview 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 {TripReviewFindFirstOrThrowArgs} args - Arguments to find a TripReview
+ * @example
+ * // Get one TripReview
+ * const tripReview = await prisma.tripReview.findFirstOrThrow({
+ * where: {
+ * // ... provide filter here
+ * }
+ * })
+ */
+ findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__TripReviewClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>
+
+ /**
+ * Find zero or more TripReviews 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 {TripReviewFindManyArgs} args - Arguments to filter and select certain fields only.
+ * @example
+ * // Get all TripReviews
+ * const tripReviews = await prisma.tripReview.findMany()
+ *
+ * // Get first 10 TripReviews
+ * const tripReviews = await prisma.tripReview.findMany({ take: 10 })
+ *
+ * // Only select the `id`
+ * const tripReviewWithIdOnly = await prisma.tripReview.findMany({ select: { id: true } })
+ *
+ */
+ findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>>
+
+ /**
+ * Create a TripReview.
+ * @param {TripReviewCreateArgs} args - Arguments to create a TripReview.
+ * @example
+ * // Create one TripReview
+ * const TripReview = await prisma.tripReview.create({
+ * data: {
+ * // ... data to create a TripReview
+ * }
+ * })
+ *
+ */
+ create(args: Prisma.SelectSubset>): Prisma.Prisma__TripReviewClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>
+
+ /**
+ * Create many TripReviews.
+ * @param {TripReviewCreateManyArgs} args - Arguments to create many TripReviews.
+ * @example
+ * // Create many TripReviews
+ * const tripReview = await prisma.tripReview.createMany({
+ * data: [
+ * // ... provide data here
+ * ]
+ * })
+ *
+ */
+ createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise
+
+ /**
+ * Create many TripReviews and returns the data saved in the database.
+ * @param {TripReviewCreateManyAndReturnArgs} args - Arguments to create many TripReviews.
+ * @example
+ * // Create many TripReviews
+ * const tripReview = await prisma.tripReview.createManyAndReturn({
+ * data: [
+ * // ... provide data here
+ * ]
+ * })
+ *
+ * // Create many TripReviews and only return the `id`
+ * const tripReviewWithIdOnly = await prisma.tripReview.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 TripReview.
+ * @param {TripReviewDeleteArgs} args - Arguments to delete one TripReview.
+ * @example
+ * // Delete one TripReview
+ * const TripReview = await prisma.tripReview.delete({
+ * where: {
+ * // ... filter to delete one TripReview
+ * }
+ * })
+ *
+ */
+ delete(args: Prisma.SelectSubset>): Prisma.Prisma__TripReviewClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>
+
+ /**
+ * Update one TripReview.
+ * @param {TripReviewUpdateArgs} args - Arguments to update one TripReview.
+ * @example
+ * // Update one TripReview
+ * const tripReview = await prisma.tripReview.update({
+ * where: {
+ * // ... provide filter here
+ * },
+ * data: {
+ * // ... provide data here
+ * }
+ * })
+ *
+ */
+ update(args: Prisma.SelectSubset>): Prisma.Prisma__TripReviewClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>
+
+ /**
+ * Delete zero or more TripReviews.
+ * @param {TripReviewDeleteManyArgs} args - Arguments to filter TripReviews to delete.
+ * @example
+ * // Delete a few TripReviews
+ * const { count } = await prisma.tripReview.deleteMany({
+ * where: {
+ * // ... provide filter here
+ * }
+ * })
+ *
+ */
+ deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise
+
+ /**
+ * Update zero or more TripReviews.
+ * Note, that providing `undefined` is treated as the value not being there.
+ * Read more here: https://pris.ly/d/null-undefined
+ * @param {TripReviewUpdateManyArgs} args - Arguments to update one or more rows.
+ * @example
+ * // Update many TripReviews
+ * const tripReview = await prisma.tripReview.updateMany({
+ * where: {
+ * // ... provide filter here
+ * },
+ * data: {
+ * // ... provide data here
+ * }
+ * })
+ *
+ */
+ updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise
+
+ /**
+ * Update zero or more TripReviews and returns the data updated in the database.
+ * @param {TripReviewUpdateManyAndReturnArgs} args - Arguments to update many TripReviews.
+ * @example
+ * // Update many TripReviews
+ * const tripReview = await prisma.tripReview.updateManyAndReturn({
+ * where: {
+ * // ... provide filter here
+ * },
+ * data: [
+ * // ... provide data here
+ * ]
+ * })
+ *
+ * // Update zero or more TripReviews and only return the `id`
+ * const tripReviewWithIdOnly = await prisma.tripReview.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 TripReview.
+ * @param {TripReviewUpsertArgs} args - Arguments to update or create a TripReview.
+ * @example
+ * // Update or create a TripReview
+ * const tripReview = await prisma.tripReview.upsert({
+ * create: {
+ * // ... data to create a TripReview
+ * },
+ * update: {
+ * // ... in case it already exists, update
+ * },
+ * where: {
+ * // ... the filter for the TripReview we want to update
+ * }
+ * })
+ */
+ upsert(args: Prisma.SelectSubset>): Prisma.Prisma__TripReviewClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>
+
+
+ /**
+ * Count the number of TripReviews.
+ * Note, that providing `undefined` is treated as the value not being there.
+ * Read more here: https://pris.ly/d/null-undefined
+ * @param {TripReviewCountArgs} args - Arguments to filter TripReviews to count.
+ * @example
+ * // Count the number of TripReviews
+ * const count = await prisma.tripReview.count({
+ * where: {
+ * // ... the filter for the TripReviews 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 TripReview.
+ * Note, that providing `undefined` is treated as the value not being there.
+ * Read more here: https://pris.ly/d/null-undefined
+ * @param {TripReviewAggregateArgs} 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 TripReview.
+ * Note, that providing `undefined` is treated as the value not being there.
+ * Read more here: https://pris.ly/d/null-undefined
+ * @param {TripReviewGroupByArgs} 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 TripReviewGroupByArgs,
+ HasSelectOrTake extends Prisma.Or<
+ Prisma.Extends<'skip', Prisma.Keys>,
+ Prisma.Extends<'take', Prisma.Keys>
+ >,
+ OrderByArg extends Prisma.True extends HasSelectOrTake
+ ? { orderBy: TripReviewGroupByArgs['orderBy'] }
+ : { orderBy?: TripReviewGroupByArgs['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 ? GetTripReviewGroupByPayload : Prisma.PrismaPromise
+/**
+ * Fields of the TripReview model
+ */
+readonly fields: TripReviewFieldRefs;
+}
+
+/**
+ * The delegate class that acts as a "Promise-like" for TripReview.
+ * 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__TripReviewClient extends Prisma.PrismaPromise {
+ readonly [Symbol.toStringTag]: "PrismaPromise"
+ trip = {}>(args?: Prisma.Subset>): Prisma.Prisma__TripClient, 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 TripReview model
+ */
+export interface TripReviewFieldRefs {
+ readonly id: Prisma.FieldRef<"TripReview", 'String'>
+ readonly rating: Prisma.FieldRef<"TripReview", 'Int'>
+ readonly comment: Prisma.FieldRef<"TripReview", 'String'>
+ readonly createdAt: Prisma.FieldRef<"TripReview", 'DateTime'>
+ readonly updatedAt: Prisma.FieldRef<"TripReview", 'DateTime'>
+ readonly tripId: Prisma.FieldRef<"TripReview", 'String'>
+ readonly userId: Prisma.FieldRef<"TripReview", 'String'>
+}
+
+
+// Custom InputTypes
+/**
+ * TripReview findUnique
+ */
+export type TripReviewFindUniqueArgs = {
+ /**
+ * Select specific fields to fetch from the TripReview
+ */
+ select?: Prisma.TripReviewSelect | null
+ /**
+ * Omit specific fields from the TripReview
+ */
+ omit?: Prisma.TripReviewOmit | null
+ /**
+ * Choose, which related nodes to fetch as well
+ */
+ include?: Prisma.TripReviewInclude | null
+ /**
+ * Filter, which TripReview to fetch.
+ */
+ where: Prisma.TripReviewWhereUniqueInput
+}
+
+/**
+ * TripReview findUniqueOrThrow
+ */
+export type TripReviewFindUniqueOrThrowArgs = {
+ /**
+ * Select specific fields to fetch from the TripReview
+ */
+ select?: Prisma.TripReviewSelect | null
+ /**
+ * Omit specific fields from the TripReview
+ */
+ omit?: Prisma.TripReviewOmit | null
+ /**
+ * Choose, which related nodes to fetch as well
+ */
+ include?: Prisma.TripReviewInclude | null
+ /**
+ * Filter, which TripReview to fetch.
+ */
+ where: Prisma.TripReviewWhereUniqueInput
+}
+
+/**
+ * TripReview findFirst
+ */
+export type TripReviewFindFirstArgs = {
+ /**
+ * Select specific fields to fetch from the TripReview
+ */
+ select?: Prisma.TripReviewSelect | null
+ /**
+ * Omit specific fields from the TripReview
+ */
+ omit?: Prisma.TripReviewOmit | null
+ /**
+ * Choose, which related nodes to fetch as well
+ */
+ include?: Prisma.TripReviewInclude | null
+ /**
+ * Filter, which TripReview to fetch.
+ */
+ where?: Prisma.TripReviewWhereInput
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
+ *
+ * Determine the order of TripReviews to fetch.
+ */
+ orderBy?: Prisma.TripReviewOrderByWithRelationInput | Prisma.TripReviewOrderByWithRelationInput[]
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
+ *
+ * Sets the position for searching for TripReviews.
+ */
+ cursor?: Prisma.TripReviewWhereUniqueInput
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
+ *
+ * Take `±n` TripReviews 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` TripReviews.
+ */
+ skip?: number
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
+ *
+ * Filter by unique combinations of TripReviews.
+ */
+ distinct?: Prisma.TripReviewScalarFieldEnum | Prisma.TripReviewScalarFieldEnum[]
+}
+
+/**
+ * TripReview findFirstOrThrow
+ */
+export type TripReviewFindFirstOrThrowArgs = {
+ /**
+ * Select specific fields to fetch from the TripReview
+ */
+ select?: Prisma.TripReviewSelect | null
+ /**
+ * Omit specific fields from the TripReview
+ */
+ omit?: Prisma.TripReviewOmit | null
+ /**
+ * Choose, which related nodes to fetch as well
+ */
+ include?: Prisma.TripReviewInclude | null
+ /**
+ * Filter, which TripReview to fetch.
+ */
+ where?: Prisma.TripReviewWhereInput
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
+ *
+ * Determine the order of TripReviews to fetch.
+ */
+ orderBy?: Prisma.TripReviewOrderByWithRelationInput | Prisma.TripReviewOrderByWithRelationInput[]
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
+ *
+ * Sets the position for searching for TripReviews.
+ */
+ cursor?: Prisma.TripReviewWhereUniqueInput
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
+ *
+ * Take `±n` TripReviews 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` TripReviews.
+ */
+ skip?: number
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
+ *
+ * Filter by unique combinations of TripReviews.
+ */
+ distinct?: Prisma.TripReviewScalarFieldEnum | Prisma.TripReviewScalarFieldEnum[]
+}
+
+/**
+ * TripReview findMany
+ */
+export type TripReviewFindManyArgs = {
+ /**
+ * Select specific fields to fetch from the TripReview
+ */
+ select?: Prisma.TripReviewSelect | null
+ /**
+ * Omit specific fields from the TripReview
+ */
+ omit?: Prisma.TripReviewOmit | null
+ /**
+ * Choose, which related nodes to fetch as well
+ */
+ include?: Prisma.TripReviewInclude | null
+ /**
+ * Filter, which TripReviews to fetch.
+ */
+ where?: Prisma.TripReviewWhereInput
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
+ *
+ * Determine the order of TripReviews to fetch.
+ */
+ orderBy?: Prisma.TripReviewOrderByWithRelationInput | Prisma.TripReviewOrderByWithRelationInput[]
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
+ *
+ * Sets the position for listing TripReviews.
+ */
+ cursor?: Prisma.TripReviewWhereUniqueInput
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
+ *
+ * Take `±n` TripReviews 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` TripReviews.
+ */
+ skip?: number
+ /**
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
+ *
+ * Filter by unique combinations of TripReviews.
+ */
+ distinct?: Prisma.TripReviewScalarFieldEnum | Prisma.TripReviewScalarFieldEnum[]
+}
+
+/**
+ * TripReview create
+ */
+export type TripReviewCreateArgs = {
+ /**
+ * Select specific fields to fetch from the TripReview
+ */
+ select?: Prisma.TripReviewSelect | null
+ /**
+ * Omit specific fields from the TripReview
+ */
+ omit?: Prisma.TripReviewOmit | null
+ /**
+ * Choose, which related nodes to fetch as well
+ */
+ include?: Prisma.TripReviewInclude | null
+ /**
+ * The data needed to create a TripReview.
+ */
+ data: Prisma.XOR
+}
+
+/**
+ * TripReview createMany
+ */
+export type TripReviewCreateManyArgs = {
+ /**
+ * The data used to create many TripReviews.
+ */
+ data: Prisma.TripReviewCreateManyInput | Prisma.TripReviewCreateManyInput[]
+ skipDuplicates?: boolean
+}
+
+/**
+ * TripReview createManyAndReturn
+ */
+export type TripReviewCreateManyAndReturnArgs = {
+ /**
+ * Select specific fields to fetch from the TripReview
+ */
+ select?: Prisma.TripReviewSelectCreateManyAndReturn | null
+ /**
+ * Omit specific fields from the TripReview
+ */
+ omit?: Prisma.TripReviewOmit | null
+ /**
+ * The data used to create many TripReviews.
+ */
+ data: Prisma.TripReviewCreateManyInput | Prisma.TripReviewCreateManyInput[]
+ skipDuplicates?: boolean
+ /**
+ * Choose, which related nodes to fetch as well
+ */
+ include?: Prisma.TripReviewIncludeCreateManyAndReturn | null
+}
+
+/**
+ * TripReview update
+ */
+export type TripReviewUpdateArgs = {
+ /**
+ * Select specific fields to fetch from the TripReview
+ */
+ select?: Prisma.TripReviewSelect | null
+ /**
+ * Omit specific fields from the TripReview
+ */
+ omit?: Prisma.TripReviewOmit