Vendor Applications
Route: /admin/applications ⚠️ NOT YET BUILT
Planned file: ayts-admin/app/(admin)/applications/page.tsx
Auth required: Admin
This page does not exist yet. The API endpoints are fully implemented but there is no admin UI to approve or reject vendor applications. This blocks vendors from being activated after submitting the onboarding form.
Purpose
Admins review vendor applications submitted through the customer-facing /vendor/onboard form. They approve or reject applications, which activates or rejects the vendor's store.
How to Build
1. Create the page file
ayts-admin/app/(admin)/applications/page.tsx
2. Fetch pending applications
// List all applications
GET /api/admin/applications?status=pending&limit=20&offset=0
// Response
{
applications: [{
id: string,
userId: string,
storeName: string,
category: string,
description: string,
address: string,
logoUrl: string,
bannerUrl: string,
status: 'pending' | 'approved' | 'rejected',
createdAt: string,
user: { firstName, lastName, email, phone }
}]
}
3. Approve or reject
// Approve
PATCH /api/admin/applications/{id}/review
{ action: 'approve' }
// → Creates store, assigns vendor role to user
// Reject
PATCH /api/admin/applications/{id}/review
{ action: 'reject', reason: string }
// → Updates status, optionally sends rejection email
4. Add to sidebar navigation
In ayts-admin/components/sidebar.tsx (or equivalent), add:
{ href: '/admin/applications', label: 'Vendor Applications', icon: FileCheck }
Application Table Design
| Column | Value |
|---|---|
| Applicant | User name + email |
| Store Name | Proposed store name |
| Category | Store category |
| Location | City + barangay |
| Submitted | Date |
| Actions | Approve / Reject / View Details |
Application Detail Modal
When admin clicks "View Details":
- Store logo + banner image preview
- Full store description
- Contact info
- Operating hours
- Approve / Reject buttons with reason input
Status: Implementation Priority
Priority: HIGH — This is the missing link in the vendor onboarding flow. Without it, vendors who apply can never be approved.
Estimated effort: ~4 hours (UI only — API is complete)