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(core-flows, fulfillment): Add create return specific method and add more tests #7357

Merged
merged 11 commits into from
May 21, 2024

Conversation

adrien2p
Copy link
Member

@adrien2p adrien2p commented May 17, 2024

What

  • fix create return workflow
  • add more integration tests for this iteration

Copy link

vercel bot commented May 17, 2024

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

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 10:48am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) May 21, 2024 10:48am
docs-ui ⬜️ Ignored (Inspect) Visit Preview May 21, 2024 10:48am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview May 21, 2024 10:48am

Copy link

changeset-bot bot commented May 17, 2024

⚠️ No Changeset found

Latest commit: 2a84e3d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@adrien2p adrien2p marked this pull request as ready for review May 21, 2024 09:48
@adrien2p adrien2p requested a review from a team as a code owner May 21, 2024 09:48
@@ -37,6 +37,7 @@ export const joinerConfig: ModuleJoinerConfig = {
name: ["return_reason", "return_reasons"],
args: {
entity: ReturnReason.name,
methodSuffix: pluralize(ReturnReason.name),
Copy link
Member Author

@adrien2p adrien2p May 21, 2024

Choose a reason for hiding this comment

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

@carlos-r-l-rodrigues do you think it would be wise by default to do that? if the entity if provided and it is not the first ailas then we do that under the hood? convention being the main entity is always the first

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it is alright to do that.
Maybe we could even infer the methodSuffix in the remote query from the property entity. and if it is different we can specify it.
But not in this PR.

@adrien2p
Copy link
Member Author

@olivermrbl I have this CLI pipeline failing, I believe that you said something about it being fixed at some point is that correct?

data: FulfillmentTypes.CreateFulfillmentDTO,
@MedusaContext() sharedContext: Context = {}
): Promise<FulfillmentTypes.FulfillmentDTO> {
const { order, ...fulfillmentDataToCreate } = data
Copy link
Member

Choose a reason for hiding this comment

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

Why do we have an order passed to the fulfillment module? I checked the typings and it seems it's an empty object now, but I guess it's better to remove it altogether?

Copy link
Member Author

Choose a reason for hiding this comment

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

well I am not sure why we have that, it is also not used but it is required in the types and in the workflow for the fulfillment. I didn't want to do that in that pr until we know why we have that as I dont recall the need for it but I can still rm it everywhere once we are aware of why we added it in the first place. Also we have a link between order and fulfillment, so could it be for the provider?

cc @olivermrbl

Copy link
Contributor

Choose a reason for hiding this comment

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

v1 uses the order to pass some info to the providers.
we could rename that to something else in the future though

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, what @carlos-r-l-rodrigues said. This is just a naming issue. The order can hold details that are required for the provider to create the fulfillment

Copy link
Member

Choose a reason for hiding this comment

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

Ok got it 👍 Since a fulfillment is not necessarily tied to an order, let's try to rename it to something more meaningful (In payments we have data, which is very generic but it might be OK since each provider might require something different)

Copy link
Contributor

Choose a reason for hiding this comment

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

I can change that to data in my follow up PR where I already removed order_id from types.

Copy link
Member Author

@adrien2p adrien2p May 21, 2024

Choose a reason for hiding this comment

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

I believe The fulfillment already have a field data which is what is returned by the provider, we night need to think about something else that seems more meaningful ? extra_data?

Copy link
Member Author

Choose a reason for hiding this comment

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

Or something more specific like provider_data?

Copy link
Member

@sradevski sradevski left a comment

Choose a reason for hiding this comment

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

BTW we can do the change in a separate PR, I just noticed it now :)

@adrien2p
Copy link
Member Author

@olivermrbl can I merge even with this CI failing?

@olivermrbl
Copy link
Contributor

olivermrbl commented May 21, 2024

Yes, sure. This is related to the starter, so should be fine.

@adrien2p adrien2p merged commit c4fde7e into develop May 21, 2024
16 of 17 checks passed
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.

None yet

4 participants