This pull request introduces a new "orders" feature to the API, including a new endpoint for paginated order retrieval, scripts for managing the orders table and importing data, and updates to the API documentation and root endpoints. #81
Merged
goldlabelapps merged 3 commits intomasterfrom Apr 11, 2026
Conversation
Bump app version to 2.2.1 and add a new orders API package plus tooling. Introduces a GET /orders endpoint with pagination, search (case-insensitive partial match), hide/flag filtering, ordering and pagination metadata. Adds SQL utilities: a check_orders_table script for quick row/sample inspection and an import_magento_products_to_orders script to ingest magento_products.csv into the orders table (uses ON CONFLICT (sku) DO NOTHING). Also adds a large magento_products.csv sample data file and wires the orders router into the API routes/root updates. Note: importer assumes column mapping in ORDERS_COLUMNS matches the DB schema and performs basic type conversions for booleans, numerics and dates; review schema alignment before running.
Update orders endpoint to query the orders table (no first_name/last_name search or ordering by first_name) and adjust error messaging. Enhance CSV import: truncate orders before import, print progress messages, ensure SKUs are unique within the import batch by suffixing duplicates, and change INSERT behavior (remove ON CONFLICT DO NOTHING). Add a sample Magento products CSV at app/static/csv/magento_products_sample.csv for testing/imports.
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.
The changes also include a sample CSV for testing and update the project version.
New Orders API and Data Management
ordersAPI endpoint with support for pagination, filtering, and ordering, returning metadata and results in a structured format (app/api/orders/orders.py).app/api/orders/__init__.py,app/api/routes.py). [1] [2] [3]Database Schema and Import Scripts
orderstable with a schema matching Magento product data plus custom fields (app/api/orders/sql/recreate_orders_table.py).orderstable, handling type conversion, uniqueness, and error reporting (app/api/orders/sql/import_magento_products_to_orders.py).orderstable (app/api/orders/sql/check_orders_table.py).app/static/csv/magento_products_sample.csv).API Documentation and Root Endpoint Updates
app/api/root.py).README.md).Versioning
2.2.1to reflect the new features (app/__init__.py).Other
app/api/routes.py).