Skip to content

Conversation

@demeyerthom
Copy link
Member

This pull request introduces support for the order search endpoint in the mock Commercetools API, allowing users to search for orders with pagination. It adds a new OrderSearch service, integrates it into the order repository and service, and exposes a new /search route for orders. Additionally, there are some minor code cleanups and refactoring in the order repository.

Order search functionality:

  • Added a new OrderSearch class in src/orderSearch.ts to handle searching and paginating orders, returning results in the expected format.
  • Integrated the OrderSearch service into the OrderRepository, including a new search method that delegates to the service. (Fb3d1219L40R40, src/repositories/order/index.tsR406-R412)
  • Exposed a new /search POST endpoint in the OrderService to allow clients to search for orders. [1] [2]
  • Declared the new endpoint and its release in the changeset file.

Code cleanup and refactoring:

  • Simplified the creation of line items and custom line items in OrderRepository by returning objects directly and using the satisfies operator for type safety. [1] [2] [3] [4]

Copilot AI review requested due to automatic review settings January 2, 2026 13:58
@changeset-bot
Copy link

changeset-bot bot commented Jan 2, 2026

🦋 Changeset detected

Latest commit: ea54bd9

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds order search functionality to the mock commercetools API, enabling clients to search for orders with pagination support. The implementation follows the existing pattern used for product search and introduces the necessary service, repository, and endpoint components.

  • Implements a new OrderSearch service class for handling order search operations with pagination
  • Adds a /search POST endpoint to the OrderService for client access
  • Refactors line item creation in OrderRepository to use direct object returns with the satisfies operator

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
src/orderSearch.ts New file implementing the OrderSearch class with pagination support for order queries
src/services/order.ts Adds the /search POST endpoint route and handler method to expose order search functionality
src/repositories/order/index.ts Integrates OrderSearch service, adds search method delegation, and refactors line item creation for cleaner code
.changeset/proud-results-sort.md Documents the new order search endpoint feature as a minor version change

@demeyerthom demeyerthom merged commit a91c04e into main Jan 2, 2026
11 checks passed
@demeyerthom demeyerthom deleted the feat/order-search branch January 2, 2026 14:26
@github-actions github-actions bot mentioned this pull request Jan 2, 2026
demeyerthom pushed a commit that referenced this pull request Jan 2, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @labdigital/[email protected]

### Minor Changes

- [#368](#368)
[`a91c04e`](a91c04e)
Thanks [@demeyerthom](https://github.com/demeyerthom)! - Add order
search endpoint functionality

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants