add cron and partial update refund schema
This commit is contained in:
@@ -385,6 +385,20 @@ export const tripService = {
|
||||
return bookingService.markPaidManual(booking.id, userId);
|
||||
},
|
||||
|
||||
/**
|
||||
* Auto-complete trip yang sudah lewat. Dipakai cron harian.
|
||||
*
|
||||
* Cutoff = start of today UTC. Trip dengan endDate < cutoff (atau, kalau
|
||||
* endDate null, date < cutoff) di-set status COMPLETED — selama statusnya
|
||||
* masih OPEN/FULL. CLOSED trip tidak disentuh (organizer eksplisit batalkan).
|
||||
*
|
||||
* Idempotent: dua kali run di hari sama, run kedua nge-match 0 row.
|
||||
*/
|
||||
async autoCompletePastTrips() {
|
||||
const cutoff = utcStartOfDay(new Date());
|
||||
return tripRepo.bulkCompletePastTrips(cutoff);
|
||||
},
|
||||
|
||||
async confirmParticipantPayment(
|
||||
tripId: string,
|
||||
participantId: string,
|
||||
|
||||
Reference in New Issue
Block a user