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 missing fields to the Account model #295

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ankitsridhar16
Copy link
Contributor

resolves #288

  • Account model is missing fields returned by the API

Copy link
Contributor

@gcatlin gcatlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for doing this!

Some potential changes to consider, depending on @gnvk's preferences:

  • change BalanceAsof to BalanceAsOf (capital "O") -- this reads better, but might be considered inconsistent with the JSON field name
  • keep the Options* fields grouped together and the Pending* fields

@ankitsridhar16
Copy link
Contributor Author

  • Options*

I have added the suggested changes to the PR @gcatlin can you review ?

@gcatlin
Copy link
Contributor

gcatlin commented Jul 4, 2024

@ankitsridhar16 Looks good. Thanks!

@gnvk gnvk changed the title added missing fields to Account model Add missing fields to the Account model Jul 9, 2024
PendingTransferIn string `json:"pending_transfer_in"`
PendingTransferOut string `json:"pending_transfer_out"`
IntradayAdjustments string `json:"intraday_adjustments"`
BalanceAsOf string `json:"balance_asof"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a date, so I'd recommend to use civil.Date instead of a string.

Copy link
Collaborator

@gnvk gnvk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add / extend a unit test. If you do so, you will realise that the newly added fields are always empty, even when the server returns non-empty values for them. To fix that you'll need to regenerate the easyjson code with make generate.

@ankitsridhar16
Copy link
Contributor Author

Please add / extend a unit test. If you do so, you will realise that the newly added fields are always empty, even when the server returns non-empty values for them. To fix that you'll need to regenerate the easyjson code with make generate.

I will check and ask if I have more doubts

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

Successfully merging this pull request may close these issues.

Account model is missing fields returned by the API
3 participants