removed cron job that made rentals active. Now whether or not the rental is active is determined on the fly
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const { Rental } = require("../models");
|
||||
const StripeService = require("./stripeService");
|
||||
const { isActive } = require("../utils/rentalStatus");
|
||||
|
||||
class RefundService {
|
||||
/**
|
||||
@@ -69,8 +70,8 @@ class RefundService {
|
||||
};
|
||||
}
|
||||
|
||||
// Check if rental is active
|
||||
if (rental.status === "active") {
|
||||
// Check if rental is active (computed from confirmed + start time passed)
|
||||
if (isActive(rental)) {
|
||||
return {
|
||||
canCancel: false,
|
||||
reason: "Cannot cancel active rental",
|
||||
|
||||
Reference in New Issue
Block a user