Store Management
Route: /admin/stores
File: ayts-admin/app/(admin)/stores/page.tsx
Auth required: Admin
Purpose
Admins review, verify, and activate vendor stores. No store appears on the customer storefront until it is both verified and active.
Store Lifecycle
Vendor submits → status: "pending"
Admin reviews in this page:
→ Click "Verify" → status: "verified"
→ Click "Activate" → status: "active" ← now visible to customers
→ Click "Deactivate" → status: "inactive"
→ Click "Suspend" → status: "suspended"
Table Columns
| Column | Source |
|---|---|
| Store Name | stores.name |
| Category | stores.category |
| Status | stores.status |
| Owner | users.first_name + last_name |
| Location | stores.city + barangay |
| Rating | stores.rating |
| Created | stores.created_at |
| Actions | Verify / Activate / Deactivate buttons |
Data Fetching
// Get all stores (admin view, all statuses)
GET /api/admin/stores?status={filter}&limit=20&offset={page}
// Update store status
PATCH /api/admin/stores/{storeId}
{ isVerified: boolean, isActive: boolean }
camelCase fix
The API converts isVerified → is_verified before updating Supabase. This was fixed in ayts-api/src/routes/admin.ts.
Store Detail
Clicking a store opens /admin/stores/[id] showing:
- Full store info
- Product list
- Order history for this store
- Verification history / notes
Create Store
/admin/stores/create — Admin can create a store directly (bypasses vendor application flow).
Known Issues / Status
| Item | Status |
|---|---|
| Store list from real API | ✅ Working |
| Verify button | ✅ Working |
| Activate button | ✅ Working |
| Status column shows value | ⚠️ May show blank — data rendering issue |
| Category column shows value | ⚠️ May show blank — data rendering issue |
| Test stores cleanup | ❌ Must delete before launch |
| Bulk verify/activate | ❌ Not implemented |
Launch Checklist
Before going live:
- Delete test stores via Supabase SQL Editor:
DELETE FROM stores WHERE name IN ('Test', 'Testtttt', 'asdasd', 'Test Store Dropzoned', 'Hilpoy');
- Verify + Activate all real stores via Admin → Stores