create public layout and admin and fix escrow and refund
This commit is contained in:
@@ -3,6 +3,7 @@ import { prisma } from "@/lib/prisma";
|
||||
import { bookingRepo } from "@/server/repositories/booking.repo";
|
||||
import { paymentRepo } from "@/server/repositories/payment.repo";
|
||||
import { isTripDepartureDayPast } from "@/lib/trip-dates";
|
||||
import { payoutService } from "@/server/services/payout.service";
|
||||
|
||||
const SERIAL_TX_ATTEMPTS = 6;
|
||||
|
||||
@@ -191,6 +192,9 @@ export const bookingService = {
|
||||
data: { paymentConfirmedAt: now },
|
||||
});
|
||||
|
||||
// Escrow: tahan uang di Payout HELD sampai trip selesai + buffer.
|
||||
await payoutService.createForPaidBooking(tx, { bookingId });
|
||||
|
||||
return { ok: true as const };
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user