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

Implement BigNumber library to do all numerical processing wrapped in a Mojaloop Number Library #952

Closed
23 tasks done
elnyry-sam-k opened this issue Aug 28, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@elnyry-sam-k
Copy link
Member

elnyry-sam-k commented Aug 28, 2019

Goal:

As a Hub Operator
I want to support processing of amounts as decimals during internal processing while supporting the maximum precision as specified in the API Definition along with enforcing precision based on currency
so that requests with input values for amounts that only conform to the conditions based on currency are accepted and the others are rejected (via error callbacks) and the 'zero sum' of the system is maintained

This specific story is for the Mojaloop Decimal Library

Tasks:

  • Present options for the library after investigation, for review
    • bignumbers.js library selected as number library
    • create basic functionality as a POC i.e (add, subtract, multiply, divide)
    • review POC and validate that the selected library fulfils requirements
  • Mojaloop Numbers Library implementation that uses decimal processing of amounts/ numbers
    • Refactor to MLNumber [@ggrg]
  • Add to applicable APIs for implementation and testing
    • central-ledger [@ggrg]
    • central-settlements [@ggrg]
    • quoting-service [@ggrg]
    • Optionally CEP* [@ggrg]
  • Validation for Golden path tests
  • Documentation for usage

Acceptance Criteria:

  • Unit Tests pass
  • The DB supports max precision of 4 digits as specified in the API Definition v1.0
  • The Mojaloop Decimal Library is made available to be used by central services for numbers (amount) processing internally

Pull Requests:

Follow-up:

Future Roadmap:
We should consider using this library to include ISO Currency enums, validation, and also config for MLNumbers based on currency config

Dependencies:

  • N/A

Accountability:

@elnyry-sam-k elnyry-sam-k added this to the Sprint 7.5 - Packaging milestone Sep 4, 2019
@rmothilal rmothilal changed the title Implement BigNumber library to do all numerical processing wrapped in a Mojaloop Decimal Library Implement BigNumber library to do all numerical processing wrapped in a Mojaloop Number Library Sep 5, 2019
@mdebarros mdebarros added blocked and removed blocked labels Sep 19, 2019
@rmothilal rmothilal assigned rmothilal and ggrg and unassigned rmothilal Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants