add payment and integration with midtrans

This commit is contained in:
2026-05-08 21:44:34 +07:00
parent ecd4dc2ef4
commit 68ffaf2f69
14 changed files with 886 additions and 36 deletions
@@ -0,0 +1,5 @@
-- DropIndex (replace solo userId index dengan unique compound yang lebih berguna)
DROP INDEX "Booking_userId_idx";
-- CreateIndex (unique compound, juga jadi index untuk lookup by tripId+userId)
CREATE UNIQUE INDEX "Booking_tripId_userId_key" ON "Booking"("tripId", "userId");
+4 -1
View File
@@ -262,8 +262,11 @@ model Booking {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
/// Konsistensi: 1-1 ke participant via participantId, dan participant unique
/// per (tripId, userId). Constraint ini eksplisit + jadi index untuk query
/// `findByTripAndUser`.
@@unique([tripId, userId])
@@index([tripId, status])
@@index([userId])
}
enum BookingStatus {