Add order history for all 3 roles#16
Merged
Merged
Conversation
- Add customer /orders, vendor /vendor/orders, delivery /delivery/history pages - Add useCustomerOrders, useVendorOrderHistory, useDeliveryHistory hooks - Add History/Orders nav buttons to all 3 dashboards - Fix vendor/delivery provisioning (fallback SELECT on INSERT failure) - Fix delivery order visibility (SECURITY DEFINER to avoid RLS recursion) - Fix delivery UPDATE policy + backfill delivery_person_id on existing orders - Fix infinite recursion in orders RLS policy - Fix user registration via DB trigger (handle_new_user) - Add full_reset.sql for clean test environment setup - Migrations 007-011
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's New
Order History Pages
/orders— all orders grouped into Active / Past with stats (total orders, total spent, active count)/vendor/orders— completed + cancelled orders with revenue stats/delivery/history— delivered assignments with weekly statsNavigation
New Hooks
useCustomerOrders— all orders newest firstuseVendorOrderHistory— delivered/cancelled onlyuseDeliveryHistory— delivered assignments onlyBug Fixes
UNIQUE(user_id)todelivery_persons+ ensure INSERT policies existdelivery_person_idgets set on new ordersSECURITY DEFINERfunctiondelivery_person_idon existing ordersassignment.ordernull crash on delivery dashboardhandle_new_usertrigger instead of client-side insertDatabase
supabase/full_reset.sql— full wipe + schema + policies + seed in one filesupabase/reset_and_seed.sql— data-only reset for existing schema