feat(ControlPanel): improved store order retrieval and search index - #906
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the ControlPanel Store Management experience by moving the admin order list to a dedicated storeOrders Meilisearch index, eliminating per-row live Stripe calls and adding basic search/filtering support.
Changes:
- Persist
amountTotalandcurrencyonStoreOrderand add a one-time migration to backfill historical orders from Stripe. - Introduce a
storeOrdersMeilisearch index with server-side sync/upsert helpers and SearchService configuration. - Update the admin orders endpoint and ControlPanel UI to page/search via Meilisearch and render a Stripe-free list item shape.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| server/types/Store.ts | Adds StoreOrderListItem type for the new admin list response shape. |
| server/models/storeorder.ts | Persists amountTotal/currency fields on StoreOrder. |
| server/migrations/BackfillStoreOrderAmounts.ts | New migration to backfill totals/currency (and missing emails) from Stripe sessions. |
| server/api/services/store-service.ts | Mirrors totals into Mongo on processing and switches admin list retrieval to Meilisearch; upserts index on key state changes. |
| server/api/services/store-order-search-service.ts | New index sync/upsert/remove helpers and aggregation shaping for storeOrders. |
| server/api/services/search-service.ts | Registers storeOrders index and its primary key/searchable/filterable/sortable attributes. |
| server/api/search-index-management.ts | Adds storeOrders support to the admin “Re-sync” workflow. |
| client/src/types/Store.ts | Adds client-side StoreOrderListItem type. |
| client/src/screens/conductor/controlpanel/StoreManager/index.tsx | Updates Store Manager to use Meilisearch-backed pagination and adds debounced search UI. |
| client/src/api.ts | Updates adminGetStoreOrders typing to return StoreOrderListItem items. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+48
to
+51
| const debouncedSetQuery = useMemo( | ||
| () => debounce((value: string) => setSearchQuery(value.trim()), 400), | ||
| [] | ||
| ); |
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.
No description provided.