-
Notifications
You must be signed in to change notification settings - Fork 103
accounts: Add CreditAccount
& DebitAccount
sql queries
#982
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
accounts: Add CreditAccount
& DebitAccount
sql queries
#982
Conversation
This commit adds a separate `CreditAccount` query to the sql db, to incentivize not setting the balance directly, but rather instead increase and decrease the balance by a specific amount. We also update the sql store to use the new query function, instead of setting the balance directly.
44ae7e0
to
e20bf18
Compare
CreditAccount
sql queryCreditAccount
& DebitAccount
sql queries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, have just some comments 👍
This commit adds a separate `DebitAccount` query to the sql db, to incentivize not setting the balance directly, but rather instead increase and decrease the balance by a specific amount. We also update the sql store to use the new query function, instead of setting the balance directly.
e20bf18
to
46bc3c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
I think I dont quite follow the motivation for this change? in my mind the DB CRUD layer should be just that and then any business logic should be on a code layer above. Having the addition/subtraction on the code layer also allows us to do extra validation etc (more business logic) before performing any DB commits. |
@ellemouton: review reminder |
We decided offline to not proceed with this PR. |
This PR introduces separate
CreditAccount
andDebitAccount
queries for the SQL database. The change encourages increasing the balance by a specific amount rather than setting it directly.