replaced vague notes with specific intended use, also fixed modal on top of modal for reviews

This commit is contained in:
jackiettran
2025-11-25 16:40:42 -05:00
parent 13268784fd
commit 8de814fdee
16 changed files with 282 additions and 85 deletions

View File

@@ -303,7 +303,7 @@ class TemplateManager {
<p><strong>Total Amount:</strong> ${{totalAmount}}</p>
<p><strong>Your Earnings:</strong> ${{payoutAmount}}</p>
<p><strong>Delivery Method:</strong> {{deliveryMethod}}</p>
<p><strong>Renter Notes:</strong> {{rentalNotes}}</p>
<p><strong>Intended Use:</strong> {{intendedUse}}</p>
<p><a href="{{approveUrl}}" class="button">Review & Respond</a></p>
<p>Please respond to this request within 24 hours.</p>
`

View File

@@ -53,7 +53,6 @@ class RentalFlowEmailService {
* @param {string} rental.totalAmount - Total rental amount
* @param {string} rental.payoutAmount - Owner's payout amount
* @param {string} rental.deliveryMethod - Delivery method
* @param {string} rental.notes - Rental notes from renter
* @returns {Promise<{success: boolean, messageId?: string, error?: string}>}
*/
async sendRentalRequestEmail(owner, renter, rental) {
@@ -88,7 +87,7 @@ class RentalFlowEmailService {
? parseFloat(rental.payoutAmount).toFixed(2)
: "0.00",
deliveryMethod: rental.deliveryMethod || "Not specified",
rentalNotes: rental.notes || "No additional notes provided",
intendedUse: rental.intendedUse || "Not specified",
approveUrl: approveUrl,
};

View File

@@ -60,10 +60,9 @@ class LateReturnService {
* Process late return and update rental with fees
* @param {string} rentalId - Rental ID
* @param {Date} actualReturnDateTime - When item was returned
* @param {string} notes - Optional notes about the return
* @returns {Object} - Updated rental with late fee information
*/
static async processLateReturn(rentalId, actualReturnDateTime, notes = null) {
static async processLateReturn(rentalId, actualReturnDateTime) {
const rental = await Rental.findByPk(rentalId, {
include: [{ model: Item, as: "item" }],
});
@@ -84,10 +83,6 @@ class LateReturnService {
payoutStatus: "pending",
};
if (notes) {
updates.notes = notes;
}
const updatedRental = await rental.update(updates);
// Send notification to customer service if late return detected