schema updates to rental statuses
This commit is contained in:
@@ -823,7 +823,7 @@ router.post("/:id/mark-completed", authenticateToken, async (req, res) => {
|
||||
});
|
||||
}
|
||||
|
||||
await rental.update({ status: "completed" });
|
||||
await rental.update({ status: "completed", payoutStatus: "pending" });
|
||||
|
||||
const updatedRental = await Rental.findByPk(rental.id, {
|
||||
include: [
|
||||
@@ -1131,6 +1131,7 @@ router.post("/:id/mark-return", authenticateToken, async (req, res) => {
|
||||
// Item returned on time
|
||||
updatedRental = await rental.update({
|
||||
status: "completed",
|
||||
payoutStatus: "pending",
|
||||
actualReturnDateTime: actualReturnDateTime || rental.endDateTime,
|
||||
notes: notes || null,
|
||||
});
|
||||
@@ -1174,6 +1175,7 @@ router.post("/:id/mark-return", authenticateToken, async (req, res) => {
|
||||
// Item returned damaged
|
||||
const damageUpdates = {
|
||||
status: "damaged",
|
||||
payoutStatus: "pending",
|
||||
actualReturnDateTime: actualReturnDateTime || rental.endDateTime,
|
||||
notes: notes || null,
|
||||
};
|
||||
@@ -1217,6 +1219,7 @@ router.post("/:id/mark-return", authenticateToken, async (req, res) => {
|
||||
// Item reported as lost
|
||||
updatedRental = await rental.update({
|
||||
status: "lost",
|
||||
payoutStatus: "pending",
|
||||
itemLostReportedAt: new Date(),
|
||||
notes: notes || null,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user