feat(order,dashboard): version order credit lines#13766
Conversation
🦋 Changeset detectedLatest commit: e4531e0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 74 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
7 Skipped Deployments
|
olivermrbl
left a comment
There was a problem hiding this comment.
LGTM, I guess we could add a test for this, but since we are following an existing pattern, it's not critical. Will let you decide
Will take a look |
| amount: model.bigNumber(), | ||
| raw_amount: model.json(), | ||
| metadata: model.json().nullable(), | ||
| order: model.belongsTo<() => typeof Order>(() => Order, { |
There was a problem hiding this comment.
nit: isn't the type inferred here?
There was a problem hiding this comment.
Yes, you are absolutely right. That's what happens when you let Claude do too much haha
Summary
What — What changes are introduced in this PR?
Added
versionto the already credit line entityWhy — Why are these changes relevant or necessary?
When issuing an Ad Hoc refund, we systematically create a credit line of the same value to balance out the order total. However, if something goes wrong in the workflow, there was no way to really revert the edits to the order because credit lines did not have version.
Testing — How have these changes been tested, or how can the reviewer test the feature?
The revert flow is pretty thoroughly tested I noticed so I mostly tested manually. I confirmed that before, the credit lines were not reverted in case of an error and now it does.
Checklist
Please ensure the following before requesting a review:
yarn changesetand follow the promptsCLOSES CORE-1248