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(order, types): Add Credit Line to order module #10636

Merged
merged 3 commits into from
Dec 19, 2024
Merged

Conversation

riqwan
Copy link
Contributor

@riqwan riqwan commented Dec 17, 2024

what:

  • adds credit line model
  • adds credit line change order
  • adds credit line summary total

Copy link

vercel bot commented Dec 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 Dec 17, 2024 6:25pm
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Dec 17, 2024 6:25pm
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Dec 17, 2024 6:25pm
docs-ui ⬜️ Ignored (Inspect) Visit Preview Dec 17, 2024 6:25pm
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Dec 17, 2024 6:25pm
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Dec 17, 2024 6:25pm
resources-docs ⬜️ Ignored (Inspect) Visit Preview Dec 17, 2024 6:25pm

Copy link

changeset-bot bot commented Dec 17, 2024

⚠️ No Changeset found

Latest commit: 5e16844

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

Comment on lines +54 to +55
Upon adding a credit line, the order total and the pending difference will increase making it possible for the merchant
to request the customer for a payment for an arbitrary reason, or prepare the order balance sheet to then allow
Copy link
Contributor

Choose a reason for hiding this comment

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

question: I wouldn't have expected credit lines to be used for additional payments, only refunds–can you expand on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, this was incorrectly written - I had changed this in my current branch. Will port over the changes in a bit.

pending_difference is what the customer needs to pay to settle the difference. If a credit line has been issued, the credit_line_total needs to be subtracted from pending_difference to accurately depict what should happen, which is not happening in this branch.

Copy link
Contributor

Choose a reason for hiding this comment

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

That sounds right yeah

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to update this branch or do it in a follow up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can do either. Making good progress rn, so focusing on not hindering that flow. 😄

Comment on lines +56 to +66
@Property({
columnType: "text",
nullable: true,
})
reference: string | null = null

@Property({
columnType: "text",
nullable: true,
})
reference_id: string | null = null
Copy link
Contributor

Choose a reason for hiding this comment

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

question: How will these references be used in practise?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its the resource that will be the enabler of this operation, in this case payment-collection and its id.

We can scope it down to payments or refunds, but that would require creating multiple credit lines, which I can't see a benefit for.

@riqwan riqwan merged commit 3f4d574 into develop Dec 19, 2024
23 checks passed
@riqwan riqwan deleted the feat/credit-line branch December 19, 2024 09:37
noubase pushed a commit to noubase/medusa that referenced this pull request Jan 22, 2025
* feat(order, types): Add Credit Line to order module

* chore: add action to inject credit lines
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.

2 participants