ashok 3 weeks ago
commit a29a929374

@ -699,6 +699,12 @@ exports.respondToRecurringRequestedBooking = async (req, reply) => {
supplierEntry.status = action === "accept" ? "accepted" : "rejected";
await booking.save();
// 🔽 ADD THIS
const allAccepted = booking.requested_suppliers.every(s => s.status === "accepted");
if (allAccepted) {
booking.status = "processed";
await booking.save();
}
if (action === "reject") {
return reply.code(200).send({

Loading…
Cancel
Save