Skip to main content

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

ColumnSource
Store Namestores.name
Categorystores.category
Statusstores.status
Ownerusers.first_name + last_name
Locationstores.city + barangay
Ratingstores.rating
Createdstores.created_at
ActionsVerify / 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 isVerifiedis_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

ItemStatus
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:

  1. Delete test stores via Supabase SQL Editor:
DELETE FROM stores WHERE name IN ('Test', 'Testtttt', 'asdasd', 'Test Store Dropzoned', 'Hilpoy');
  1. Verify + Activate all real stores via Admin → Stores