Skip to content

Add additional transitions for "paid" & "paid_partially" status in th…#1

Open
leitge wants to merge 4 commits intotrunkfrom
feature/add-additional-paid-transition
Open

Add additional transitions for "paid" & "paid_partially" status in th…#1
leitge wants to merge 4 commits intotrunkfrom
feature/add-additional-paid-transition

Conversation

@leitge
Copy link
Owner

@leitge leitge commented Feb 7, 2025

…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

  • I have written tests and verified that they fail without my change
  • I have created a changelog file with all necessary information about my changes
  • I have written or adjusted the documentation according to my changes
  • This change has comments for package types, values, functions, and non-obvious lines of code
  • I have read the contribution requirements and fulfill them.

@leitge leitge added the enhancement New feature or request label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant