Add additional transitions for "paid" & "paid_partially" status in th…#1
Open
Add additional transitions for "paid" & "paid_partially" status in th…#1
Conversation
…e Order Transaction State Machine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…e Order Transaction State Machine
1. Why is this change necessary?
There is an inconsistency in the Order Transaction State Machine. According to the documentation, the action "paid" should be used to transition an order to a fully paid state. However, in practice the action "paid" is not available—instead, only the legacy action "pay" is present. This discrepancy likely originates from older releases and creates confusion for developers and integrators relying on the documentation.
2. What does this change do, exactly?
This PR extends the Order Transaction State Machine by adding additional transitions that use the documented action names while keeping the legacy "pay" transition intact. Specifically, it introduces the following new transitions:
Case 1: Transition from "reminded" to "paid_partially" using the action "paid_partially".
Case 2: Transition from "reminded" to "paid" using the action "paid".
Case 3: Transition from "paid_partially" to "paid" using the action "paid".
By adding these transitions, the PR ensures that the documented action "paid" is available for reaching the fully paid state. The existing "pay" transition remains unchanged for backward compatibility.
3. Describe each step to reproduce the issue or behaviour.
1- Create an order transaction that is either in the "reminded" or "paid_partially" state.
2- Attempt to transition the order transaction to the fully paid state.
3-Notice that, despite the documentation stating that the action "paid" should be used, only the legacy action "pay" is available.
4- With this PR applied, the new transitions using the action "paid" are inserted, resolving the inconsistency and allowing the documented behavior to be achieved.
4. Please link to the relevant issues (if any).
none
5. Checklist