Verified Direct-Message (DM) Orders, Protected Product Photos & Server-Only Admin Console
In Plain English: Secures ShopMi Direct-Message (DM) orders so only signed-in customers and verified store owners can update order statuses, protects product images from public tampering, speeds up order & ride lookups with new database indexes, and moves all Admin dashboard screens to secure server APIs.
- Protected Direct-Message (DM) Orders: Only you and the store owner can view or update your DM order status (marking a bank transfer as sent or confirming delivery).
- Faster Order & Ride History: Added database indexes on customer orders and rides so your order history loads faster.
- Reliable DM Order Email Alerts: Fixed a database lookup bug that previously stopped store owners from receiving email alerts on new DM orders.
- Protected Product Photos & Store Catalog: Public browser keys can no longer overwrite or delete product images in storage, and only approved, active stores and products appear on the public storefront.
- Fair Store SLA Points: SLA points are awarded once when an order is genuinely marked paid and completed by the store owner.
- Faster Rider Broadcasts (Every 15 Seconds): RiderMi dispatch broadcasts now tick smoothly every 15 seconds on the database scheduler so nearby riders receive store pickups faster.
- Migrated all 7 Admin Console screens (Users, Products, Moderation, Vendors, Vendor Detail, Reviews, Dashboard) in apps/admin from browser database calls to authenticated /api/admin/* server routes.
- Fixed the empty category expansion request list on the Admin Vendors & Dashboard screens.
- Updated apps/shopmi/pages/vendor/orders.tsx and apps/shopmi/pages/vendor/messages.tsx to pass the vendor’s Firebase ID token when recording or updating DM orders.
- Locked down apps/shopmi/pages/api/orders/dm-order.ts with Firebase ID token verification (@delivermi/auth), store owner vs. customer role checks, one-time SLA point awards, and HTML escaping on vendor emails.
- Applied 4 production migrations: 20261109172702 (revoke anon/authenticated privileges on 36 internal tables), 20261109173631 (lock shopmi-product-images storage writes), 20261109183648 (15-second RiderMi broadcast cron), and 20261109183649 (indexes on orders.user_id, rides.user_id, shopmi_vendor_categories.category_id).
- Queued migration 20261109184448 (closing users, restaurants, and unapproved catalogue rows to the anon key once Admin deploys).
- Added supabase/OWNERS.md and scripts/db/table-writers.mjs to enforce which backend service is allowed to write to each database table.