replaced vague notes with specific intended use, also fixed modal on top of modal for reviews
This commit is contained in:
210
backend/migrations/20241124000005-create-rentals.js
Normal file
210
backend/migrations/20241124000005-create-rentals.js
Normal file
@@ -0,0 +1,210 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.createTable("Rentals", {
|
||||
id: {
|
||||
type: Sequelize.UUID,
|
||||
defaultValue: Sequelize.UUIDV4,
|
||||
primaryKey: true,
|
||||
},
|
||||
itemId: {
|
||||
type: Sequelize.UUID,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: "Items",
|
||||
key: "id",
|
||||
},
|
||||
onUpdate: "CASCADE",
|
||||
onDelete: "CASCADE",
|
||||
},
|
||||
renterId: {
|
||||
type: Sequelize.UUID,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: "Users",
|
||||
key: "id",
|
||||
},
|
||||
onUpdate: "CASCADE",
|
||||
onDelete: "CASCADE",
|
||||
},
|
||||
ownerId: {
|
||||
type: Sequelize.UUID,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: "Users",
|
||||
key: "id",
|
||||
},
|
||||
onUpdate: "CASCADE",
|
||||
onDelete: "CASCADE",
|
||||
},
|
||||
startDateTime: {
|
||||
type: Sequelize.DATE,
|
||||
allowNull: false,
|
||||
},
|
||||
endDateTime: {
|
||||
type: Sequelize.DATE,
|
||||
allowNull: false,
|
||||
},
|
||||
totalAmount: {
|
||||
type: Sequelize.DECIMAL(10, 2),
|
||||
allowNull: false,
|
||||
},
|
||||
platformFee: {
|
||||
type: Sequelize.DECIMAL(10, 2),
|
||||
allowNull: false,
|
||||
},
|
||||
payoutAmount: {
|
||||
type: Sequelize.DECIMAL(10, 2),
|
||||
allowNull: false,
|
||||
},
|
||||
status: {
|
||||
type: Sequelize.ENUM(
|
||||
"pending",
|
||||
"confirmed",
|
||||
"declined",
|
||||
"active",
|
||||
"completed",
|
||||
"cancelled",
|
||||
"returned_late",
|
||||
"returned_late_and_damaged",
|
||||
"damaged",
|
||||
"lost"
|
||||
),
|
||||
allowNull: false,
|
||||
},
|
||||
paymentStatus: {
|
||||
type: Sequelize.ENUM("pending", "paid", "refunded", "not_required"),
|
||||
allowNull: false,
|
||||
},
|
||||
payoutStatus: {
|
||||
type: Sequelize.ENUM("pending", "completed", "failed"),
|
||||
allowNull: true,
|
||||
},
|
||||
payoutProcessedAt: {
|
||||
type: Sequelize.DATE,
|
||||
},
|
||||
stripeTransferId: {
|
||||
type: Sequelize.STRING,
|
||||
},
|
||||
refundAmount: {
|
||||
type: Sequelize.DECIMAL(10, 2),
|
||||
},
|
||||
refundProcessedAt: {
|
||||
type: Sequelize.DATE,
|
||||
},
|
||||
refundReason: {
|
||||
type: Sequelize.TEXT,
|
||||
},
|
||||
stripeRefundId: {
|
||||
type: Sequelize.STRING,
|
||||
},
|
||||
cancelledBy: {
|
||||
type: Sequelize.ENUM("renter", "owner"),
|
||||
},
|
||||
cancelledAt: {
|
||||
type: Sequelize.DATE,
|
||||
},
|
||||
declineReason: {
|
||||
type: Sequelize.TEXT,
|
||||
},
|
||||
stripePaymentMethodId: {
|
||||
type: Sequelize.STRING,
|
||||
},
|
||||
stripePaymentIntentId: {
|
||||
type: Sequelize.STRING,
|
||||
},
|
||||
paymentMethodBrand: {
|
||||
type: Sequelize.STRING,
|
||||
},
|
||||
paymentMethodLast4: {
|
||||
type: Sequelize.STRING,
|
||||
},
|
||||
chargedAt: {
|
||||
type: Sequelize.DATE,
|
||||
},
|
||||
deliveryMethod: {
|
||||
type: Sequelize.ENUM("pickup", "delivery"),
|
||||
defaultValue: "pickup",
|
||||
},
|
||||
deliveryAddress: {
|
||||
type: Sequelize.TEXT,
|
||||
},
|
||||
intendedUse: {
|
||||
type: Sequelize.TEXT,
|
||||
},
|
||||
itemRating: {
|
||||
type: Sequelize.INTEGER,
|
||||
},
|
||||
itemReview: {
|
||||
type: Sequelize.TEXT,
|
||||
},
|
||||
itemReviewSubmittedAt: {
|
||||
type: Sequelize.DATE,
|
||||
},
|
||||
itemReviewVisible: {
|
||||
type: Sequelize.BOOLEAN,
|
||||
defaultValue: false,
|
||||
},
|
||||
renterRating: {
|
||||
type: Sequelize.INTEGER,
|
||||
},
|
||||
renterReview: {
|
||||
type: Sequelize.TEXT,
|
||||
},
|
||||
renterReviewSubmittedAt: {
|
||||
type: Sequelize.DATE,
|
||||
},
|
||||
renterReviewVisible: {
|
||||
type: Sequelize.BOOLEAN,
|
||||
defaultValue: false,
|
||||
},
|
||||
itemPrivateMessage: {
|
||||
type: Sequelize.TEXT,
|
||||
},
|
||||
renterPrivateMessage: {
|
||||
type: Sequelize.TEXT,
|
||||
},
|
||||
actualReturnDateTime: {
|
||||
type: Sequelize.DATE,
|
||||
},
|
||||
lateFees: {
|
||||
type: Sequelize.DECIMAL(10, 2),
|
||||
defaultValue: 0.0,
|
||||
},
|
||||
damageFees: {
|
||||
type: Sequelize.DECIMAL(10, 2),
|
||||
defaultValue: 0.0,
|
||||
},
|
||||
replacementFees: {
|
||||
type: Sequelize.DECIMAL(10, 2),
|
||||
defaultValue: 0.0,
|
||||
},
|
||||
itemLostReportedAt: {
|
||||
type: Sequelize.DATE,
|
||||
},
|
||||
damageAssessment: {
|
||||
type: Sequelize.JSONB,
|
||||
defaultValue: {},
|
||||
},
|
||||
createdAt: {
|
||||
type: Sequelize.DATE,
|
||||
allowNull: false,
|
||||
},
|
||||
updatedAt: {
|
||||
type: Sequelize.DATE,
|
||||
allowNull: false,
|
||||
},
|
||||
});
|
||||
|
||||
// Add indexes
|
||||
await queryInterface.addIndex("Rentals", ["itemId"]);
|
||||
await queryInterface.addIndex("Rentals", ["renterId"]);
|
||||
await queryInterface.addIndex("Rentals", ["ownerId"]);
|
||||
await queryInterface.addIndex("Rentals", ["status"]);
|
||||
},
|
||||
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.dropTable("Rentals");
|
||||
},
|
||||
};
|
||||
@@ -124,7 +124,7 @@ const Rental = sequelize.define("Rental", {
|
||||
deliveryAddress: {
|
||||
type: DataTypes.TEXT,
|
||||
},
|
||||
notes: {
|
||||
intendedUse: {
|
||||
type: DataTypes.TEXT,
|
||||
},
|
||||
// Renter's review of the item (existing fields renamed for clarity)
|
||||
|
||||
@@ -183,7 +183,7 @@ router.post("/", authenticateToken, requireVerifiedEmail, async (req, res) => {
|
||||
endDateTime,
|
||||
deliveryMethod,
|
||||
deliveryAddress,
|
||||
notes,
|
||||
intendedUse,
|
||||
stripePaymentMethodId,
|
||||
} = req.body;
|
||||
|
||||
@@ -274,7 +274,7 @@ router.post("/", authenticateToken, requireVerifiedEmail, async (req, res) => {
|
||||
status: "pending",
|
||||
deliveryMethod,
|
||||
deliveryAddress,
|
||||
notes,
|
||||
intendedUse,
|
||||
};
|
||||
|
||||
// Only add stripePaymentMethodId if it's provided (for paid rentals)
|
||||
@@ -1099,7 +1099,7 @@ router.post("/:id/cancel", authenticateToken, async (req, res) => {
|
||||
// Mark item return status (owner only)
|
||||
router.post("/:id/mark-return", authenticateToken, async (req, res) => {
|
||||
try {
|
||||
const { status, actualReturnDateTime, notes, statusOptions } = req.body;
|
||||
const { status, actualReturnDateTime, statusOptions } = req.body;
|
||||
const rentalId = req.params.id;
|
||||
const userId = req.user.id;
|
||||
|
||||
@@ -1133,7 +1133,6 @@ router.post("/:id/mark-return", authenticateToken, async (req, res) => {
|
||||
status: "completed",
|
||||
payoutStatus: "pending",
|
||||
actualReturnDateTime: actualReturnDateTime || rental.endDateTime,
|
||||
notes: notes || null,
|
||||
});
|
||||
|
||||
// Fetch full rental details with associations for email
|
||||
@@ -1177,15 +1176,13 @@ router.post("/:id/mark-return", authenticateToken, async (req, res) => {
|
||||
status: "damaged",
|
||||
payoutStatus: "pending",
|
||||
actualReturnDateTime: actualReturnDateTime || rental.endDateTime,
|
||||
notes: notes || null,
|
||||
};
|
||||
|
||||
// Check if ALSO returned late
|
||||
if (statusOptions?.returned_late && actualReturnDateTime) {
|
||||
const lateReturnDamaged = await LateReturnService.processLateReturn(
|
||||
rentalId,
|
||||
actualReturnDateTime,
|
||||
notes
|
||||
actualReturnDateTime
|
||||
);
|
||||
damageUpdates.status = "returned_late_and_damaged";
|
||||
damageUpdates.lateFees = lateReturnDamaged.lateCalculation.lateFee;
|
||||
@@ -1207,8 +1204,7 @@ router.post("/:id/mark-return", authenticateToken, async (req, res) => {
|
||||
|
||||
const lateReturn = await LateReturnService.processLateReturn(
|
||||
rentalId,
|
||||
actualReturnDateTime,
|
||||
notes
|
||||
actualReturnDateTime
|
||||
);
|
||||
|
||||
updatedRental = lateReturn.rental;
|
||||
@@ -1221,7 +1217,6 @@ router.post("/:id/mark-return", authenticateToken, async (req, res) => {
|
||||
status: "lost",
|
||||
payoutStatus: "pending",
|
||||
itemLostReportedAt: new Date(),
|
||||
notes: notes || null,
|
||||
});
|
||||
|
||||
// Send notification to customer service
|
||||
|
||||
@@ -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>
|
||||
`
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -295,8 +295,8 @@
|
||||
</table>
|
||||
|
||||
<div class="info-box">
|
||||
<p><strong>Renter's Notes:</strong></p>
|
||||
<p>{{rentalNotes}}</p>
|
||||
<p><strong>Intended Use:</strong></p>
|
||||
<p>{{intendedUse}}</p>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center">
|
||||
|
||||
@@ -289,7 +289,6 @@ describe('Rentals Routes', () => {
|
||||
endDateTime: '2024-01-15T18:00:00.000Z',
|
||||
deliveryMethod: 'pickup',
|
||||
deliveryAddress: null,
|
||||
notes: 'Test rental',
|
||||
stripePaymentMethodId: 'pm_test123',
|
||||
};
|
||||
|
||||
|
||||
@@ -449,7 +449,6 @@ describe('EmailService', () => {
|
||||
totalAmount: 150.00,
|
||||
payoutAmount: 135.00,
|
||||
deliveryMethod: 'pickup',
|
||||
notes: 'Please have it ready by 9am',
|
||||
item: { name: 'Power Drill' }
|
||||
};
|
||||
|
||||
@@ -522,7 +521,6 @@ describe('EmailService', () => {
|
||||
totalAmount: 0,
|
||||
payoutAmount: 0,
|
||||
deliveryMethod: 'pickup',
|
||||
notes: null,
|
||||
item: { name: 'Free Item' }
|
||||
};
|
||||
|
||||
@@ -531,39 +529,6 @@ describe('EmailService', () => {
|
||||
expect(result.success).toBe(true);
|
||||
});
|
||||
|
||||
it('should handle missing rental notes', async () => {
|
||||
const mockOwner = {
|
||||
email: 'owner@example.com',
|
||||
firstName: 'John'
|
||||
};
|
||||
const mockRenter = {
|
||||
firstName: 'Jane',
|
||||
lastName: 'Doe'
|
||||
};
|
||||
|
||||
User.findByPk
|
||||
.mockResolvedValueOnce(mockOwner)
|
||||
.mockResolvedValueOnce(mockRenter);
|
||||
|
||||
const rental = {
|
||||
id: 1,
|
||||
ownerId: 10,
|
||||
renterId: 20,
|
||||
startDateTime: new Date('2024-12-01T10:00:00Z'),
|
||||
endDateTime: new Date('2024-12-03T10:00:00Z'),
|
||||
totalAmount: 100,
|
||||
payoutAmount: 90,
|
||||
deliveryMethod: 'delivery',
|
||||
notes: null, // No notes
|
||||
item: { name: 'Test Item' }
|
||||
};
|
||||
|
||||
const result = await emailService.sendRentalRequestEmail(rental);
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
expect(mockSend).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should generate correct approval URL', async () => {
|
||||
const mockOwner = {
|
||||
email: 'owner@example.com',
|
||||
@@ -589,7 +554,6 @@ describe('EmailService', () => {
|
||||
totalAmount: 100,
|
||||
payoutAmount: 90,
|
||||
deliveryMethod: 'pickup',
|
||||
notes: 'Test notes',
|
||||
item: { name: 'Test Item' }
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ const ReturnStatusModal: React.FC<ReturnStatusModalProps> = ({
|
||||
lost: false,
|
||||
});
|
||||
const [actualReturnDateTime, setActualReturnDateTime] = useState("");
|
||||
const [notes, setNotes] = useState("");
|
||||
const [conditionNotes, setConditionNotes] = useState("");
|
||||
const [photos, setPhotos] = useState<File[]>([]);
|
||||
const [processing, setProcessing] = useState(false);
|
||||
@@ -56,7 +55,6 @@ const ReturnStatusModal: React.FC<ReturnStatusModalProps> = ({
|
||||
lost: false,
|
||||
});
|
||||
setActualReturnDateTime("");
|
||||
setNotes("");
|
||||
setConditionNotes("");
|
||||
setPhotos([]);
|
||||
setError(null);
|
||||
@@ -71,13 +69,13 @@ const ReturnStatusModal: React.FC<ReturnStatusModalProps> = ({
|
||||
|
||||
// Create blob URLs for photo previews and clean them up
|
||||
const photoBlobUrls = useMemo(() => {
|
||||
return photos.map(photo => URL.createObjectURL(photo));
|
||||
return photos.map((photo) => URL.createObjectURL(photo));
|
||||
}, [photos]);
|
||||
|
||||
// Cleanup blob URLs when photos change or component unmounts
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
photoBlobUrls.forEach(url => URL.revokeObjectURL(url));
|
||||
photoBlobUrls.forEach((url) => URL.revokeObjectURL(url));
|
||||
};
|
||||
}, [photoBlobUrls]);
|
||||
|
||||
@@ -202,6 +200,7 @@ const ReturnStatusModal: React.FC<ReturnStatusModalProps> = ({
|
||||
);
|
||||
if (!hasSelection) {
|
||||
setError("Please select at least one return status option");
|
||||
setProcessing(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -316,7 +315,6 @@ const ReturnStatusModal: React.FC<ReturnStatusModalProps> = ({
|
||||
const data: any = {
|
||||
status: primaryStatus,
|
||||
statusOptions, // Send all selected options
|
||||
notes: notes.trim() || undefined,
|
||||
};
|
||||
|
||||
if (statusOptions.returned_late) {
|
||||
@@ -346,7 +344,6 @@ const ReturnStatusModal: React.FC<ReturnStatusModalProps> = ({
|
||||
lost: false,
|
||||
});
|
||||
setActualReturnDateTime("");
|
||||
setNotes("");
|
||||
setConditionNotes("");
|
||||
setPhotos([]);
|
||||
setError(null);
|
||||
@@ -950,7 +947,7 @@ const ReturnStatusModal: React.FC<ReturnStatusModalProps> = ({
|
||||
>
|
||||
<span className="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
Processing...
|
||||
Submitting...
|
||||
</>
|
||||
) : (
|
||||
"Submit"
|
||||
|
||||
@@ -69,6 +69,18 @@ const ReviewItemModal: React.FC<ReviewItemModalProps> = ({
|
||||
|
||||
if (!show) return null;
|
||||
|
||||
// Show success modal instead of review modal after successful submission
|
||||
if (showSuccessModal) {
|
||||
return (
|
||||
<SuccessModal
|
||||
show={true}
|
||||
onClose={handleSuccessModalClose}
|
||||
title="Thank you for your review!"
|
||||
message={successMessage}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="modal d-block"
|
||||
@@ -212,13 +224,6 @@ const ReviewItemModal: React.FC<ReviewItemModalProps> = ({
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<SuccessModal
|
||||
show={showSuccessModal}
|
||||
onClose={handleSuccessModalClose}
|
||||
title="Thank you for your review!"
|
||||
message={successMessage}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -69,6 +69,18 @@ const ReviewRenterModal: React.FC<ReviewRenterModalProps> = ({
|
||||
|
||||
if (!show) return null;
|
||||
|
||||
// Show success modal instead of review modal after successful submission
|
||||
if (showSuccessModal) {
|
||||
return (
|
||||
<SuccessModal
|
||||
show={true}
|
||||
onClose={handleSuccessModalClose}
|
||||
title="Thank you for your review!"
|
||||
message={successMessage}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="modal d-block"
|
||||
@@ -212,13 +224,6 @@ const ReviewRenterModal: React.FC<ReviewRenterModalProps> = ({
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<SuccessModal
|
||||
show={showSuccessModal}
|
||||
onClose={handleSuccessModalClose}
|
||||
title="Thank you for your review!"
|
||||
message={successMessage}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -359,6 +359,14 @@ const Owning: React.FC = () => {
|
||||
<strong>Total:</strong> ${rental.totalAmount}
|
||||
</p>
|
||||
|
||||
{rental.intendedUse && rental.status === "pending" && (
|
||||
<div className="alert alert-light mt-2 mb-2 p-2 small">
|
||||
<strong>Intended Use:</strong>
|
||||
<br />
|
||||
{rental.intendedUse}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{rental.status === "cancelled" &&
|
||||
rental.refundAmount !== undefined && (
|
||||
<div className="alert alert-info mt-2 mb-2 p-2 small">
|
||||
@@ -620,9 +628,7 @@ const Owning: React.FC = () => {
|
||||
onClick={() => toggleAvailability(item)}
|
||||
className="btn btn-sm btn-outline-info"
|
||||
>
|
||||
{item.isAvailable
|
||||
? "Mark Unavailable"
|
||||
: "Mark Available"}
|
||||
{item.isAvailable ? "Mark Unavailable" : "Mark Available"}
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleDelete(item.id)}
|
||||
|
||||
@@ -17,6 +17,7 @@ const RentItem: React.FC = () => {
|
||||
const [formData, setFormData] = useState({
|
||||
deliveryMethod: "pickup" as "pickup" | "delivery",
|
||||
deliveryAddress: "",
|
||||
intendedUse: "",
|
||||
});
|
||||
|
||||
const [manualSelection, setManualSelection] = useState({
|
||||
@@ -143,6 +144,7 @@ const RentItem: React.FC = () => {
|
||||
endDateTime,
|
||||
deliveryMethod: formData.deliveryMethod,
|
||||
deliveryAddress: formData.deliveryAddress,
|
||||
intendedUse: formData.intendedUse || undefined,
|
||||
totalAmount: totalCost,
|
||||
};
|
||||
} catch (error: any) {
|
||||
@@ -261,6 +263,26 @@ const RentItem: React.FC = () => {
|
||||
</p>
|
||||
)}
|
||||
|
||||
<div className="mb-3">
|
||||
<label htmlFor="intendedUse" className="form-label">
|
||||
What will you use this for?{" "}
|
||||
<span className="text-muted">(Optional)</span>
|
||||
</label>
|
||||
<textarea
|
||||
id="intendedUse"
|
||||
name="intendedUse"
|
||||
className="form-control"
|
||||
rows={3}
|
||||
value={formData.intendedUse}
|
||||
onChange={handleChange}
|
||||
placeholder="Let the owner know how you plan to use their item..."
|
||||
maxLength={500}
|
||||
/>
|
||||
<div className="form-text">
|
||||
{formData.intendedUse.length}/500 characters
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!manualSelection.startDate ||
|
||||
!manualSelection.endDate ||
|
||||
!getRentalData() ? (
|
||||
|
||||
@@ -232,7 +232,7 @@ export const rentalAPI = {
|
||||
// Return status marking
|
||||
markReturn: (
|
||||
id: string,
|
||||
data: { status: string; actualReturnDateTime?: string; notes?: string }
|
||||
data: { status: string; actualReturnDateTime?: string }
|
||||
) => api.post(`/rentals/${id}/mark-return`, data),
|
||||
reportDamage: (id: string, data: any) =>
|
||||
api.post(`/rentals/${id}/report-damage`, data),
|
||||
|
||||
@@ -152,7 +152,7 @@ export interface Rental {
|
||||
stripeTransferId?: string;
|
||||
deliveryMethod: "pickup" | "delivery";
|
||||
deliveryAddress?: string;
|
||||
notes?: string;
|
||||
intendedUse?: string;
|
||||
rating?: number;
|
||||
review?: string;
|
||||
declineReason?: string;
|
||||
|
||||
Reference in New Issue
Block a user