Appearance
Admin Flows Playbook ​
Purpose: Practical steps for common admin operations: listing moderation, profile/seller verification, and email template testing. Audience: Admin, Developer Prerequisites: Admin account; Supabase linked; Edge functions enabled.
Listing moderation
- Where:
/admin/listings,/admin/listings/:id,/admin/listings/:id/details- Code:
src/pages/admin/AdminListings.tsx,src/pages/admin/AdminListingsDetail.tsx,src/pages/admin/AdminListingEdit.tsx - Components:
src/components/admin/listings/*,src/components/admin/AdminListingPreview.tsx
- Code:
- Steps
- Filter "Pending" and open listing
- Add field-level comments (admin_listing_comments)
- IMPORTANT: Check seller verification status before approving
- Approve or request changes
- Critical Approval Process:
- For Verified Sellers: System automatically updates both
status='active'ANDverification_status='approved' - For Unverified Sellers: Only updates
status='active', keepsverification_status='pending' - Result: Only verified sellers' approved listings are visible to public
- For Verified Sellers: System automatically updates both
- SQL quick checkssql
-- Recent admin comments select listing_id, field_key, comment, is_resolved, created_at from admin_listing_comments order by created_at desc limit 20; -- Listing status distribution select status, count(*) from listings group by status; -- Check seller verification status before approval select l.id, l.title, l.status, l.verification_status, p.seller_verification_status, p.seller_verified from listings l join profiles p on l.seller_id = p.id where l.status = 'pending'; -- Verify listing visibility (should show only approved listings for public) select id, title, status, verification_status, case when status='active' and verification_status='approved' then 'VISIBLE' else 'HIDDEN' end as visibility from listings order by created_at desc limit 10;
Seller/Profile verification
- Where:
/admin/profile-verifications,/profile-verification,/seller-verification- Code:
src/pages/admin/AdminSellerVerifications.tsx,src/pages/ProfileVerification.tsx,src/pages/SellerVerification.tsx
- Code:
- Tables:
seller_verifications(docs/data-model/schema.md) - Steps
- User submits docs (status
pending) - Admin reviews and updates status to
approved|rejected - Optional: notify via email (send-email)
- User submits docs (status
- SQL quick checkssql
select status, count(*) from seller_verifications group by status; select * from seller_verifications order by submitted_at desc limit 20;
Admin direct messages and templates
- Where:
/admin/templates- Code:
src/components/admin/templates/*(EmailTemplateEditor, AdminDirectMessage, NotificationTemplateEditor)
- Code:
- Steps (send test)
- Open Admin → Templates → pick template
- Edit subject/HTML → Send Test (calls
send-email) - Verify
email_logsin/admin/logs
- SQL quick checkssql
select recipient_email, email_type, template_name, send_status, created_at from email_logs order by created_at desc limit 20;
Contact messages
- Where: Admin → Logs or dedicated view (TBD)
- Table:
admin_contact_messages— incoming messages from users - SQL quick checkssql
select status, count(*) from admin_contact_messages group by status; select subject, message, admin_response from admin_contact_messages order by created_at desc limit 20;
Tips
- Keep moderation feedback actionable and tied to specific
field_key - Use email templates for consistent admin communications
- Confirm role checks and RLS before exposing any admin data to end-users
Related
- Admin tables:
docs/architecture/admin-tables.md - Email & Templates:
docs/architecture/email-templates.md