Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

move cached value computation into triggers #4045

Closed
wants to merge 12 commits into from

Conversation

chadwhitacre
Copy link
Contributor

@chadwhitacre chadwhitacre commented Jun 2, 2016

#3994

#4037#4023

Punchlist

@chadwhitacre
Copy link
Contributor Author

Here are the four given values:

i name property of description
1 payment instruction participant amount of money the participant intends to pay a given team, weekly
2 ownership participant a team owned by the participant

All the other numbers we care about can be computed from those four:

i name property of function
1 giving participant sum of payment instructions from the given participant
2 ngiving_to participant number of payment instructions from the given participant
3 receiving team sum of payment instructions to the given team
4 nreceiving_from team number of payment instructions to the given team
5 distributing team receiving
6 ndistributing_to team 1
7 taking participant sum of receiving for all ownerships
8 ntaking_from participant count of ownerships

given values are bold
computed values are in italics

@chadwhitacre
Copy link
Contributor Author

payment_instruction
    giving
    ngiving_to
    receiving
    nreceiving_from
receiving
    distributing
    taking
ownership
    taking
    ntaking_from

giving              payment_instruction
ngiving_to          payment_instruction
receiving           payment_instruction
nreceiving_from     payment_instruction
distributing        receiving
ndistributing_to
taking              receiving           ownership
ntaking_from        ownership

Key: #4023 (comment).

@chadwhitacre
Copy link
Contributor Author

screen shot 2016-06-02 at 1 10 10 pm

digraph G {
    "giving" -> "payment_instruction" [dir=back]
    "ngiving_to" -> "payment_instruction" [dir=back]
    "receiving" -> "payment_instruction" [dir=back]
    "nreceiving_from" -> "payment_instruction" [dir=back]
    "distributing" -> "receiving" [dir=back]
    "taking" -> "receiving" [dir=back]
    "taking" -> "ownership" [dir=back]
    "ntaking_from" -> "ownership" [dir=back]
}

http://www.webgraphviz.com/

@aandis
Copy link
Contributor

aandis commented Jun 3, 2016

How does this relate to #3727? Does it?

For example -

i name property of function
1 giving participant sum of payment instructions from the given participant not including broken payments.

@aandis
Copy link
Contributor

aandis commented Jun 3, 2016

#3727 (comment) for reference.

@chadwhitacre
Copy link
Contributor Author

Hmm ... good question.

@chadwhitacre
Copy link
Contributor Author

@aandis Over here @kaguillera and I are thinking that we should only tackle migration of existing cached values functionality in this PR. Then when we get to #3727 we would approach it by modifying the triggers that we introduce on this PR. Sound right to you?

@aandis
Copy link
Contributor

aandis commented Jun 11, 2016

👍

@chadwhitacre
Copy link
Contributor Author

Hmm ... the present reality is already a bit more complicated:

screen shot 2016-06-13 at 10 18 04 am

digraph G {
    "is_funded" -> "last_bill_result" [dir=back]
    "funded payment instruction" -> "is_funded" [dir=back]
    "funded payment instruction" -> "amount" [dir=back]
    "giving" -> "funded payment instruction" [dir=back]
    "ngiving_to" -> "funded payment instruction" [dir=back]
    "receiving" -> "funded payment instruction" [dir=back]
    "nreceiving_from" -> "funded payment instruction" [dir=back]
    "distributing" -> "receiving" [dir=back]
    "taking" -> "receiving" [dir=back]
    "taking" -> "ownership" [dir=back]
    "ntaking_from" -> "ownership" [dir=back]
}

@chadwhitacre
Copy link
Contributor Author

Closing in favor of a new PR against master, since we want this code before team preliminaries (#4037).

@chadwhitacre
Copy link
Contributor Author

New PR is #4063.

@chadwhitacre chadwhitacre mentioned this pull request Jun 16, 2016
1 task
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants