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

Use int64 for field.Numeric #292

Closed
alovak opened this issue Oct 6, 2023 · 4 comments
Closed

Use int64 for field.Numeric #292

alovak opened this issue Oct 6, 2023 · 4 comments
Assignees

Comments

@alovak
Copy link
Contributor

alovak commented Oct 6, 2023

In most of the iso8583 specs, amount fields are 12 digits. Currently, field.Numerc is storing value as int, which is max 2147483647 (and it's 10 digits). We should use int64 instead of int.

There are some options for fixing this:

  1. change type for field.Numeric from int to int64 - a breaking change
  2. add new field.BigNumeric 😂 which will accept int64 - looks like an extra complexity

I believe that option 1 is the right one as currently using int for amount fields is a bug and should be fixed. While it's not a backward-compatible change, it fixes the issue and requires a simple upgrade.

P.S. this change should also support int64 (and *int64) in Marshal/Unmarshal in the field.String and field.Numeric.

@GalihFajar
Copy link
Contributor

Hi @alovak kindly assign this one to me, much appreciated!

@wadearnold
Copy link
Member

What is "Option 3" @alovak? Do you mean option 1?
Thanks for the help @GalihFajar!

@alovak
Copy link
Contributor Author

alovak commented Oct 6, 2023

@GalihFajar, please join Moov's community Slack here: https://slack.moov.io/ and we can discuss any questions you have in #iso8583 channel as well.

@alovak
Copy link
Contributor Author

alovak commented Oct 12, 2023

closed by @GalihFajar in #294

@alovak alovak closed this as completed Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants