can cancel a rental request before owner approval
This commit is contained in:
@@ -93,8 +93,12 @@ class RefundService {
|
||||
};
|
||||
}
|
||||
|
||||
// Check payment status - allow cancellation for both paid and free rentals
|
||||
if (rental.paymentStatus !== "paid" && rental.paymentStatus !== "not_required") {
|
||||
// Allow cancellation for pending rentals (before owner approval) or paid/free rentals
|
||||
const isPendingRequest = rental.status === "pending";
|
||||
const isPaymentSettled =
|
||||
rental.paymentStatus === "paid" || rental.paymentStatus === "not_required";
|
||||
|
||||
if (!isPendingRequest && !isPaymentSettled) {
|
||||
return {
|
||||
canCancel: false,
|
||||
reason: "Cannot cancel rental that hasn't been paid",
|
||||
|
||||
Reference in New Issue
Block a user