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

multiple types of transactions #3

Open
YtvwlD opened this issue Sep 27, 2017 · 1 comment
Open

multiple types of transactions #3

YtvwlD opened this issue Sep 27, 2017 · 1 comment

Comments

@YtvwlD
Copy link
Contributor

YtvwlD commented Sep 27, 2017

We currently have a single type of transaction which appears under /audits:

{

    "id": 0,
    "created_at": "2017-09-27T18:45:15Z",
    "difference": 5,
    "product": 0

}

But there are actually at least two different types of transactions here:

  • buying a product (product specifies what was bought; difference is negative)
  • depositing money (product is None; difference is positive)
  • paying money ( product is None; difference is positive)

We distinguish these via the product and via the difference field.

But there can probably be more types:

I just wanted to hear your opinions about changing the data model of a transaction and how we could achieve transferring money.

@mikafinja
Copy link
Contributor

Transactions in version 3 have a field called action which can either be spend or deposit. A transfer between to users creates two transactions. One on the senders account with the action spend and one on the receivers account with the action deposit, but they are not linked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants