Skip to content

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
staging
Apr 11, 2026

Conversation

@goldlabelapps
Copy link
Copy Markdown
Owner

The changes also include a sample CSV for testing and update the project version.

New Orders API and Data Management

  • Adds a new orders API endpoint with support for pagination, filtering, and ordering, returning metadata and results in a structured format (app/api/orders/orders.py).
  • Registers the new orders route in the FastAPI application (app/api/orders/__init__.py, app/api/routes.py). [1] [2] [3]

Database Schema and Import Scripts

  • Adds a script to recreate the orders table with a schema matching Magento product data plus custom fields (app/api/orders/sql/recreate_orders_table.py).
  • Adds a script to import data from a Magento products CSV into the orders table, handling type conversion, uniqueness, and error reporting (app/api/orders/sql/import_magento_products_to_orders.py).
  • Adds a script to check the row count and print a sample row from the orders table (app/api/orders/sql/check_orders_table.py).
  • Provides a sample Magento products CSV for testing (app/static/csv/magento_products_sample.csv).

API Documentation and Root Endpoint Updates

  • Updates the root API endpoint to include the new orders and LLM endpoints, and reorganizes the endpoint listing for clarity (app/api/root.py).
  • Updates the README with the correct repository clone URL (README.md).

Versioning

  • Bumps the application version to 2.2.1 to reflect the new features (app/__init__.py).

Other

  • Minor docstring and comment improvements for clarity (app/api/routes.py).

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.
@goldlabelapps goldlabelapps self-assigned this Apr 11, 2026
@goldlabelapps goldlabelapps merged commit 621aff2 into master Apr 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant