master^2
Varun 3 weeks ago
parent 86fad2fd65
commit 14eb04cd4e

@ -699,6 +699,12 @@ exports.respondToRecurringRequestedBooking = async (req, reply) => {
supplierEntry.status = action === "accept" ? "accepted" : "rejected"; supplierEntry.status = action === "accept" ? "accepted" : "rejected";
await booking.save(); 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") { if (action === "reject") {
return reply.code(200).send({ return reply.code(200).send({

Loading…
Cancel
Save