add booking and payment schema

This commit is contained in:
2026-05-08 20:59:01 +07:00
parent c9c4c0e683
commit 2223a4630e
23 changed files with 5618 additions and 184 deletions
+16
View File
@@ -59,3 +59,19 @@ export type TripImage = Prisma.TripImageModel
*
*/
export type TripParticipant = Prisma.TripParticipantModel
/**
* Model Booking
* Booking 1-1 ke TripParticipant. Lifecycle ikut peserta:
* - join → Booking PENDING (menunggu approve organizer)
* - organizer confirm → AWAITING_PAY (paid trip) atau PAID (free trip)
* - peserta + organizer rampungkan pembayaran → PAID
* - cancel/reject → CANCELLED
* `amount` adalah snapshot harga saat booking dibuat — protect dari perubahan trip.price.
*/
export type Booking = Prisma.BookingModel
/**
* Model Payment
* Satu attempt pembayaran. Satu Booking bisa punya banyak Payment kalau retry
* (di Phase MIDTRANS nanti). Untuk MANUAL biasanya cukup 1 Payment.
*/
export type Payment = Prisma.PaymentModel