Rentals — Admin & Vendor Panels
Admin routes: /admin/rentals, /admin/rental-bookings
Vendor routes: /vendor/rentals, /vendor/rentals/new, /vendor/rentals/[id], /vendor/rentals/bookings, /vendor/rentals/bookings/[bookingNumber]
Files: ayts-admin/app/(admin)/rentals/**, ayts-admin/app/(admin)/rental-bookings/**, ayts-admin/app/vendor/rentals/**
Admin Panel
/admin/rentals — Rental Listings Oversight
File: ayts-admin/app/(admin)/rentals/page.tsx
- Table of all rental listings across all vendors: title, category, rate, units, vendor, active toggle, verified toggle
- Search by title or vendor; filter by category
- Active toggle — emergency deactivate/reactivate any listing (
PATCH /api/admin/rentals/listings/:id) - Verified toggle — mark listings as admin-verified
- New Listing modal — admin can create a listing on behalf of any vendor (
POST /api/admin/rentals/listings): vendor + category selectors, title, description, rate + pricing unit (per hour/day/week), security deposit, total units, min/max rental units, pickup address, delivery toggle + fee, advance booking days, turnaround units
/admin/rental-bookings — Booking Oversight
File: ayts-admin/app/(admin)/rental-bookings/page.tsx
- All bookings platform-wide (last 100), queried directly via Supabase
- Status tabs: All / Pending / Confirmed / Active / Returned / Done / Cancelled
- Search by customer name, booking number, or listing title
- Columns: booking number + date, customer + phone, listing + vendor, date range + units, total, status badge
/admin/agreements — Vendor Agreements
Admin can view vendor rental/service agreements and their captured signatures (agreement snapshots preserve the exact signed version).
Vendor Panel
/vendor/rentals — Listing Management
File: ayts-admin/app/vendor/rentals/page.tsx
- The vendor's own listings with active/inactive toggle
- Quick link card to Rental Bookings
- "New Listing" → 4-section create form
/vendor/rentals/new — Create Listing
Create form posting to POST /api/vendor/rentals/listings: category, title, description (rich text), pricing unit + rate, security deposit, total units, min/max rental duration, pickup address + instructions, delivery toggle + fee, advance booking days, turnaround buffer, optional linked agreement.
/vendor/rentals/[id] — Edit Listing + Blocked Dates
- Edit all listing fields (
PATCH /api/vendor/rentals/listings/:id), upload images - Blocked dates calendar — block/unblock specific dates (maintenance, personal use) via
POST/DELETE /api/vendor/rentals/listings/:id/block-dates; blocked dates show as unavailable on the storefront calendar
/vendor/rentals/bookings — Incoming Bookings
- List of bookings for the vendor's listings, filterable by status
/vendor/rentals/bookings/[bookingNumber] — Booking Detail + Actions
Lookup works by UUID or booking number. The action panel changes by status:
| Booking status | Available action | Endpoint |
|---|---|---|
pending | Confirm | PATCH .../bookings/:id/confirm |
confirmed | Mark Handed Over (→ active) | PATCH .../bookings/:id/handover |
active | Mark Returned — condition (good/damaged), damage notes, deposit deduction | PATCH .../bookings/:id/return |
returned / active | Complete — closes the booking | PATCH .../bookings/:id/complete |
| any non-final | Cancel with reason | PATCH /api/rentals/bookings/:id/cancel |
Agreements Integration
- Vendors draft agreements at
/vendor/agreements(title, content, applies-to-rentals flag); content edits bump the version - A listing linked to an agreement forces customers to accept it before booking; signatures are stored with an immutable snapshot, IP, and user agent
Notifications
New bookings trigger an in-app notification + push + branded email to the vendor (best-effort, non-blocking) with booking reference, dates, units, contact, fulfillment mode, and total.