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

Modify DB amount/currency fields from 2 decimal point scale to 4 #949

Closed
20 of 22 tasks
elnyry-sam-k opened this issue Aug 26, 2019 · 0 comments
Closed
20 of 22 tasks
Assignees
Labels
Milestone

Comments

@elnyry-sam-k
Copy link
Member

elnyry-sam-k commented Aug 26, 2019

Goal:

As a Hub Operator
I want to support 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)

Tasks:

  • Analyze ISO 4217 against current currency.js seeds [@ggrg]
  • Modify DB amount/currency fields from 2 decimal point precision to 4 [@ggrg]
  • Modify central-ledger.currency table to store currency scale [@ggrg]
    • Add data migration script (non-optional) to populate data from ISO 4217 [@ggrg]
  • Ensure 4 scale amounts are propagated properly throughout the system for:
    • PrepareHandler (transfer, transferParticipant) [@ggrg]
    • PositionHandler (participantPosition, participantPositionChange) [@ggrg]
    • Limit adjustment (participantLimit) [@ggrg]
    • Create settlement, settlement transfer (settlementTransferParticipant, settlementParticipantCurrency) [@ggrg]
    • Verify FundsIn, FundsOut operations [@ggrg]
  • Fix issues with JavaScript math: parseFloat((a + b).toFixed(Config.AMOUNT.SCALE)) [@ggrg]
  • Fix issues with non-updated participantPosition.changedDate [@ggrg]
  • Fix unit tests according to the changes above [@ggrg] a1f5b39
  • Ensure no trailing zeros are returned with responses and callbacks
  • Implement & enforce currency decimal point precision validation in Prepare handler

Acceptance Criteria:

  • Unit Tests pass
  • Integration Tests pass
  • Changes made to config (default.json) are broadcast to team and follow-up tasks added to update helm charts and other deployment config.
  • The DB supports max precision of 4 digits as specified in the API Definition v1.0
  • Validation based on currency for precision is put in place (error callbacks)

Pull Requests:

Follow-up:

  • N/A

Dependencies:

  • N/A

Accountability:

  • Owner: TBC
  • QA/Review: TBC
@elnyry-sam-k elnyry-sam-k added this to the Sprint 7.4 milestone Aug 26, 2019
@ggrg ggrg self-assigned this Aug 26, 2019
@ggrg ggrg changed the title Modify DB amount/currency fields from 2 decimal point precision to 4 Modify DB amount/currency fields from 2 decimal point scale to 4 Aug 26, 2019
@ggrg ggrg closed this as completed Aug 30, 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

2 participants