fixing platform admin

This commit is contained in:
root
2026-05-06 22:58:23 -04:00
parent 695a7f7cc7
commit 750ae56a29
175 changed files with 31249 additions and 328 deletions
+7 -7
View File
@@ -1,9 +1,9 @@
---
name: rental-car-advanced-features
description: Build advanced rental operations features for RentFlow. Use this skill when the user asks about: vehicle damage diagrams/inspection (contract car layout), insurance policies and charges, second driver (additional driver) with optional charge, driver license validation (expiry check, 3-month rule, flagging), age-based pricing rules (25+ discount, license+5 surcharge), gasoline/fuel policies (FULL_TO_FULL etc.), billing period reporting (weekly/monthly/yearly export for accountants), or the platform admin panel (managing tenants, staff, roles, permissions). This skill works alongside document-service.md and schema.md.
description: Build advanced rental operations features for RentalDriveGo. Use this skill when the user asks about: vehicle damage diagrams/inspection (contract car layout), insurance policies and charges, second driver (additional driver) with optional charge, driver license validation (expiry check, 3-month rule, flagging), age-based pricing rules (25+ discount, license+5 surcharge), gasoline/fuel policies (FULL_TO_FULL etc.), billing period reporting (weekly/monthly/yearly export for accountants), or the platform admin panel (managing tenants, staff, roles, permissions). This skill works alongside document-service.md and schema.md.
---
# Skill: RentFlow Advanced Features
# Skill: RentalDriveGo Advanced Features
## Features Covered
@@ -1074,7 +1074,7 @@ Located at `/dashboard/reports` (new page).
## 8. Platform Admin Panel
The platform administrator (RentFlow team) manages all companies and their staff.
The platform administrator (RentalDriveGo team) manages all companies and their staff.
### Admin model
@@ -1124,8 +1124,8 @@ model AdminAuditLog {
### Admin API routes
```
Base: https://admin.rentflow.com/api/v1/ (separate app)
OR: https://api.rentflow.com/api/v1/admin/ (preferred — same API, admin middleware)
Base: https://admin.RentalDriveGo.com/api/v1/ (separate app)
OR: https://api.RentalDriveGo.com/api/v1/admin/ (preferred — same API, admin middleware)
Middleware: requireAdminAuth → attaches req.admin (AdminUser)
```
@@ -1168,7 +1168,7 @@ Admins can impersonate any company employee for support purposes:
// Returns a short-lived JWT that grants dashboard access as the company OWNER
// Duration: 30 minutes max
// All actions logged in AdminAuditLog
// Dashboard shows "⚠️ Impersonation Mode — RentFlow Admin" banner
// Dashboard shows "⚠️ Impersonation Mode — RentalDriveGo Admin" banner
async function impersonateCompany(req, res) {
const company = await prisma.company.findUniqueOrThrow({
@@ -1197,7 +1197,7 @@ async function impersonateCompany(req, res) {
}
```
### Admin UI (admin.rentflow.com)
### Admin UI (admin.RentalDriveGo.com)
Separate Next.js app with its own auth (email + password, NO Clerk).