admin roadmap trips ops and payment ops
This commit is contained in:
@@ -20,6 +20,46 @@ export const bookingRepo = {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Detail booking lengkap untuk admin investigation: payments (with raw
|
||||
* callback), refunds, payout, trip + organizer, user. Dipakai oleh
|
||||
* `/admin/bookings/[id]` untuk timeline lengkap money flow.
|
||||
*/
|
||||
async findByIdForAdmin(id: string) {
|
||||
return prisma.booking.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
trip: {
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
destination: true,
|
||||
location: true,
|
||||
date: true,
|
||||
endDate: true,
|
||||
price: true,
|
||||
status: true,
|
||||
organizer: { select: { id: true, name: true, email: true } },
|
||||
},
|
||||
},
|
||||
user: { select: { id: true, name: true, email: true, image: true } },
|
||||
participant: true,
|
||||
payments: { orderBy: { createdAt: "asc" } },
|
||||
refunds: {
|
||||
orderBy: { createdAt: "asc" },
|
||||
include: {
|
||||
reviewedBy: { select: { id: true, name: true, email: true } },
|
||||
},
|
||||
},
|
||||
payout: {
|
||||
include: {
|
||||
processedBy: { select: { id: true, name: true, email: true } },
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
async create(
|
||||
data: Pick<
|
||||
Prisma.BookingUncheckedCreateInput,
|
||||
|
||||
Reference in New Issue
Block a user