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
+2 -2
View File
@@ -14,8 +14,8 @@ export const bookingRepo = {
},
async findByTripAndUser(tripId: string, userId: string) {
return prisma.booking.findFirst({
where: { tripId, userId },
return prisma.booking.findUnique({
where: { tripId_userId: { tripId, userId } },
include: { payments: { orderBy: { createdAt: "desc" } } },
});
},