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

Add scenario in test to not settle a batch in dispute #3289

Closed
koekiebox opened this issue Apr 20, 2023 · 5 comments
Closed

Add scenario in test to not settle a batch in dispute #3289

koekiebox opened this issue Apr 20, 2023 · 5 comments
Assignees
Labels
vNext vNext Platform Development (inline with RefArch) vNext-Settlement Stories and tasks related to the new Mojaloop Settlement component.

Comments

@koekiebox
Copy link

koekiebox commented Apr 20, 2023

Add a domain unit test to ensure a batch that is in DISPUTED state cannot be settled.

Scenario

  1. Create transfer (which will be allocated to batch A)
  2. Create a transfer under another model which will create batch B
  3. Create settlement matrix A that includes batches A and B
  4. Dispute batch A
  5. Settle settlement matrix A
  6. Test to ensure only batch B was settled and not batch A

Location

https://github.com/mojaloop/settlements-bc/blob/main/packages/domain-lib/test/unit/index.test.ts

@koekiebox koekiebox added vNext vNext Platform Development (inline with RefArch) vNext-Settlement Stories and tasks related to the new Mojaloop Settlement component. labels Apr 20, 2023
@myo-min-htet myo-min-htet self-assigned this May 29, 2023
@myo-min-htet
Copy link

myo-min-htet commented Jun 5, 2023

Hi @koekiebox

  1. According to the above scenario, in the requirement Number 3
    I got two batches in a Matrix, and it asked me to dispute a batch in that Matrix.
    It is not possible according to the design in Admin UI because the batches are not able to select.
    So, I want to know about the real logic that Is it possible to Dispute or Close or settle specific batch in a matrix?
    And also, there is no function to dispute Batch. I found only disputeMatrix function.

  2. Is it possible to create multiple matrixes for same batches because currently we can create multiple matrixes for same batches?

@koekiebox
Copy link
Author

@myo-min-htet

  1. Ok. I would work from the domain tests that reside in https://github.com/mojaloop/settlements-bc/blob/main/packages/domain-lib/test/unit/index.test.ts
    Step 3 is possible for both DYNAMIC and STATIC matrixes.
    You are only able to execute actions (close/settle/dispute) via a matrix, not through the batches directly.
    You are able to close/dispute batches (via a matrix) as long as the batch is not settled. Once a batch is settled, it is final.

There is however a new status being introduced (AWAITING_SETTLEMENT) which is currently wip.
Please have a look at the following document for background and explanation:
mojaloop/mojaloop-specification#117 (comment)

  1. Yes, but only a single matrix may settle a batch. Please also read about AWAITING_SETTLEMENT

@myo-min-htet
Copy link

@koekiebox , I have created a PR for this. Could you please check and guide me if you see something.
Please see the following for the PR.
mojaloop/settlements-bc#9

@koekiebox
Copy link
Author

@myo-min-htet I had a look. Thank you, it is looking good!
I added some comments and explanations in the following commit:
mojaloop/settlements-bc@69c08f7

Please do a pull on the branch

@myo-min-htet
Copy link

@koekiebox ,
Hi Jason, please let me close this item since the PR already merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vNext vNext Platform Development (inline with RefArch) vNext-Settlement Stories and tasks related to the new Mojaloop Settlement component.
Projects
None yet
Development

No branches or pull requests

2 participants