Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(medusa,inventory,types): Expand list-reservation capabilities #3979

Merged
merged 26 commits into from
May 24, 2023

Conversation

pKorsholm
Copy link
Contributor

What

  • Add filter capabilities to reservation items based on:
    • description query: "contains", "startsWith", "endsWith", "equals"
    • date querying

How

  • Introducing a new filtering primitive: "StringSearchOperator" resembling the "dateComparisonOperator"

Fixes CORE-1373

@changeset-bot
Copy link

changeset-bot bot commented May 2, 2023

🦋 Changeset detected

Latest commit: 950ac84

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

This PR includes changesets to release 20 packages
Name Type
@medusajs/client-types Patch
@medusajs/inventory Patch
@medusajs/medusa Patch
@medusajs/types Patch
@medusajs/admin-ui Patch
@medusajs/admin Patch
@medusajs/medusa-js Patch
medusa-payment-paypal Patch
medusa-payment-stripe Patch
medusa-plugin-restock-notification Patch
medusa-react Patch
@medusajs/medusa-oas-cli Patch
@medusajs/cache-inmemory Patch
@medusajs/cache-redis Patch
@medusajs/event-bus-local Patch
@medusajs/event-bus-redis Patch
medusa-plugin-algolia Patch
@medusajs/modules-sdk Patch
@medusajs/stock-location Patch
@medusajs/oas-github-ci Patch

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

@vercel
Copy link

vercel bot commented May 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
medusa-docs ⬜️ Ignored (Inspect) Visit Preview May 24, 2023 9:39am

Base automatically changed from feat/reservation-item-inventory-item-updates to develop May 4, 2023 15:25
@pKorsholm pKorsholm marked this pull request as ready for review May 11, 2023 12:43
@pKorsholm pKorsholm requested a review from a team as a code owner May 11, 2023 12:43
@@ -164,6 +168,28 @@ export class StringComparisonOperator {
lte?: string
}

export class StringSearchOperator {
Copy link
Contributor

@olivermrbl olivermrbl May 16, 2023

Choose a reason for hiding this comment

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

thought(non-blocking): Are these necessary? Wouldn't it suffice to use our existing simple text search mechanism?

Just dreading that we are adding unnecessary complexity to the UI implementation/filters in admin. What's your take?

Copy link
Member

Choose a reason for hiding this comment

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

I think it is nice to have but maybe not a must, something we can discuss but otherwise I ve written a comment to move the prepare method to an util as part of the buildQuery utils.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, think it is a nice-to-have, but I am fine keeping it in. I like the verbosity of this approach compared to alternatives. And this is consistent with the in and nin` operators introduced in the products module.

@srindom – I would like you to sign off on this too :)

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

We generally use snake_case for things passed to the API, so if we keep the StringSearchOperator, we could change that.

I realise we haven't had nested "multi-syllable word filters" (only lte, gt, etc.), but I just thought it would make for a more consistent API.

@@ -164,6 +168,28 @@ export class StringComparisonOperator {
lte?: string
}

export class StringSearchOperator {
Copy link
Member

Choose a reason for hiding this comment

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

I think it is nice to have but maybe not a must, something we can discuss but otherwise I ve written a comment to move the prepare method to an util as part of the buildQuery utils.

@pKorsholm pKorsholm requested review from olivermrbl and adrien2p May 22, 2023 17:12
Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

LGTM!

+1 on moving the prepareSearchQuery to utils, but I don't find it to be a blocker for this PR to be merged :)

@olivermrbl
Copy link
Contributor

@adrien2p – can I get you to give this another round of review today to not let it hang? :)

@adrien2p
Copy link
Member

@adrien2p – can I get you to give this another round of review today to not let it hang? :)

Sure I ll do another round

Copy link
Member

@adrien2p adrien2p left a comment

Choose a reason for hiding this comment

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

LGTM

@pKorsholm pKorsholm requested a review from olivermrbl May 23, 2023 20:44
@pKorsholm
Copy link
Contributor Author

@olivermrbl I updated the description querying as discussed, wanna take another look?

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

LGTM with a comment :)

@kodiakhq kodiakhq bot merged commit 3a38c84 into develop May 24, 2023
@kodiakhq kodiakhq bot deleted the feat/expand-filter-reservations branch May 24, 2023 09:54
This was referenced May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants