add payment, trust badge, handle race condition, fix booking schema

This commit is contained in:
arifal
2026-04-20 23:57:31 +07:00
parent ba5f64ae0e
commit fcdca34460
33 changed files with 1781 additions and 138 deletions
@@ -0,0 +1,12 @@
-- AlterTable
ALTER TABLE "Trip" ADD COLUMN "itinerary" TEXT,
ADD COLUMN "meetingPoint" TEXT,
ADD COLUMN "whatsExcluded" TEXT,
ADD COLUMN "whatsIncluded" TEXT;
-- AlterTable
ALTER TABLE "TripParticipant" ADD COLUMN "markedPaidAt" TIMESTAMP(3),
ADD COLUMN "paymentConfirmedAt" TIMESTAMP(3);
-- AlterTable
ALTER TABLE "User" ADD COLUMN "isVerified" BOOLEAN NOT NULL DEFAULT false;
+21 -7
View File
@@ -8,13 +8,15 @@ datasource db {
}
model User {
id String @id @default(cuid())
name String
email String @unique
password String
image String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
id String @id @default(cuid())
name String
email String @unique
password String
image String?
/// Akun diverifikasi tim SeTrip (manual / admin) — tampil sebagai badge kepercayaan
isVerified Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
trips Trip[]
participations TripParticipant[]
@@ -27,6 +29,14 @@ model Trip {
description String?
mountain String
location String
/// Titik kumpul / meeting point (teks bebas)
meetingPoint String?
/// Itinerary hari per hari (teks bebas, bullet OK)
itinerary String?
/// Yang termasuk harga (teks bebas)
whatsIncluded String?
/// Yang tidak termasuk (teks bebas)
whatsExcluded String?
date DateTime
endDate DateTime?
maxParticipants Int
@@ -73,6 +83,10 @@ model TripParticipant {
id String @id @default(cuid())
status ParticipantStatus @default(PENDING)
createdAt DateTime @default(now())
/// Peserta menekan "Saya sudah bayar" (pembayaran manual)
markedPaidAt DateTime?
/// Organizer mengonfirmasi uang sudah masuk
paymentConfirmedAt DateTime?
tripId String
trip Trip @relation(fields: [tripId], references: [id])
+22 -6
View File
@@ -28,6 +28,7 @@ async function main() {
name: "Dede Inoen",
email: "dede.inoen@setrip.id",
password,
isVerified: true,
},
});
@@ -36,6 +37,7 @@ async function main() {
name: "Panji Petualang",
email: "panji@setrip.id",
password,
isVerified: true,
},
});
@@ -111,13 +113,27 @@ async function main() {
title: "Open Trip Papandayan Weekend",
description: `Pendakian santai ke Gunung Papandayan, cocok untuk pemula!
📍 Meeting Point: Alun-alun Garut, 05:00 WIB
🎒 Fasilitas: Transport PP, guide, tenda, makan 3x
⚠️ Bawa: Sleeping bag, jaket, headlamp, air 2L
⚠️ Bawa: Sleeping bag, jaket, headlamp, air 2L`,
meetingPoint:
"Alun-alun Garut (depan pendopo), Sabtu 05:00 WIB — detail grup WA.",
itinerary: `Sabtu
• 05:00 Meeting & briefing
• 07:00 Berangkat menuju basecamp
• 12:00 Makan siang trail
• 15:00 Camp area Pondok Salada
Itinerary:
- Sabtu: Berangkat → Basecamp → Summit → Camp
- Minggu: Sunrise → Turun → Pulang`,
Minggu
• 04:00 Summit attack
• 08:00 Sarap & packing
• 11:00 Turun
• 16:00 Estimasi kembali ke Garut`,
whatsIncluded: `• Transport PP Garutbasecamp
• Guide lokal
• Tenda tim (kapasitas sesuai muatan)
• Konsumsi: makan 3x + snack`,
whatsExcluded: `• Tiket masuk TNGGP
• Sleeping bag & matras pribadi
• Asuransi perjalanan`,
mountain: "Gunung Papandayan",
location: "Garut, Jawa Barat",
date: utc(2026, 3, 23, 8, 0),