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:
jackiettran
2026-01-02 17:08:49 -05:00
parent bc01c818aa
commit 4209dcc8fc
17 changed files with 142 additions and 162 deletions

View File

@@ -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",