-
Notifications
You must be signed in to change notification settings - Fork 308
Conversation
I'm thinking about this. |
I'm thinking that Gratipay should be more normal accounting-wise. Double entry. |
I want to avoid a rabbit hole, but can we move in that direction? |
Properly speaking, every ~user, team, and |
We should probably have an http://blog.balancedpayments.com/the-ledger/ |
Though I believe http://www.accountingcoach.com/blog/general-ledger-general-journal. |
https://en.wikipedia.org/wiki/Ledger
|
|
Let's say we make an http://stackoverflow.com/questions/7844460/foreign-key-to-multiple-tables |
http://www.accountingcoach.com/debits-and-credits/explanation/4 |
"Basics of Escrow Accounting" |
That's talking about regulated real estate escrow businesses. For our purposes the most relevant information is:
|
I am thinking about re-modeling Gratipay using proper double-entry accounting. We would fold both Gratipay's escrow would be fundamentally represented by an
We would implement Gratipay's business rules as triggers acting on the
Though I'm not sure why we can't represent that like this:
|
I'm staring at this, btw: https://en.wikipedia.org/wiki/Debits_and_credits#Aspects_of_transactions Also leaning heavily on: http://www.accountingcoach.com/debits-and-credits/explanation/4 |
How about this for a fuller schema?
Let's have notes in a separate |
How would we handle exchange status with this schema? |
Exchange statuses would be computable from the
Here's what a successful payout would look like:
Here's what a failed payout would look like:
In other words, we'd need to query for child entries in order to compute transaction state. We could cache this computation in an additional |
Moving over to #3618. |
848f975
to
f5c4c8b
Compare
d1b145a
to
62c0095
Compare
I had some trouble getting it behave like a payday, so I brought it into line with our main payday test (though I updated that to use the mock + context manager pattern from the iter_payday test).
Ready for review @rohitpaulk @rorepo @kzisme et al. |
I left the ones in test_history because #3616 takes care of those. Note that I also left `balanced-ba` in the schema and the database, because we still want a record of those routes in the db. We just don't want to do anything with them anymore.
Alright, forging ahead with self-merge ... |
Fixes #3455.