Rentiva v4.51.0 — Vendor Management Faz B: Vendors, Commission & Settings React SPA
Vendor Management completes its React SPA migration with Faz B: the Vendors, Commission, and Settings tabs are now fully client-side. Seven new REST endpoints, three new React components, and an N+1 query fix for vendor listing.
What Changed
Vendors Tab — VendorTable Component
The Vendors tab is now a live React table powered by GET /wp-json/mhm-rentiva/v1/admin/vendors. Features:
- Paginated vendor list with vehicle count per vendor (single
GROUP BYquery — no N+1) - Suspend / Unsuspend actions via
POST /admin/vendors/{id}/suspendandPOST /admin/vendors/{id}/unsuspend - Real-time status badges and inline feedback without page reload
Commission Tab — CommissionTab Component
The Commission tab reads and writes the global commission rate via two new REST routes:
GET /admin/commission— fetch current ratePOST /admin/commission— update rate with validation
The PHP render function has been removed; the tab is entirely SPA-driven.
Settings Tab — SettingsTab Component
Vendor Management settings (enable/disable vendor marketplace, terms URL, approval mode) are now managed through:
GET /admin/vendor-settings— fetch all settingsPOST /admin/vendor-settings— persist changes
REST Endpoints Added (7 total)
| Method | Route | Purpose |
|---|---|---|
| GET | /admin/vendors | Paginated vendor list |
| POST | /admin/vendors/{id}/suspend | Suspend a vendor |
| POST | /admin/vendors/{id}/unsuspend | Unsuspend a vendor |
| GET | /admin/commission | Get commission rate |
| POST | /admin/commission | Set commission rate |
| GET | /admin/vendor-settings | Get vendor settings |
| POST | /admin/vendor-settings | Update vendor settings |
Performance
Vendor list previously issued one COUNT(*) query per vendor to get vehicle counts. This release replaces it with a single GROUP BY aggregation — O(n) → O(1) queries regardless of vendor count.
Test Coverage
19 new PHPUnit tests covering all 7 REST endpoints and their permission, validation, and response contracts.
