danalexilewis / nanox

Budgeting and Financial Transparency Tool
Apache License 2.0
1 stars 0 forks source link

data structures, or what events can happen? #11

Open ahdinosaur opened 7 years ago

ahdinosaur commented 7 years ago

this is really great @agentlewis, thanks for starting this.

i'm keen to start a discussion about data structures, or what events happen in the system.

obviously i'm keen to for us to leverage the Value Flows vocabulary, since it's already based around events and i think nanox is a great example of a "cash flow" app.

some references:

to get started i'm interested in focusing on only accounting for what just happened. so no plans, projections, events we know are recurring, etc.

or in Value Flows terms:

so, what are some examples of incoming (https://github.com/enspiral-root-systems/nanox/issues/1) and outgoing (https://github.com/enspiral-root-systems/nanox/issues/2) events do we want to track? then i'd be keen to model them in Value Flows.

ahdinosaur commented 7 years ago

first example, being paid!

type: event
provider: client
receiver: Team
affectedQuantity:
  value: 100
  unit: NZD
actions:
  receive:
    affects: Team bank account
  provide:
    affects: Client bank account

i used this example for help.

or maybe

type: event
quantity:
  value: 100
  unit: NZD
receive:
  agent: Team
  resource: Team bank account
provide:
  agent: Client
  resource: Client  bank account

or

version: 1
agent: Team
type: flow
action: 
  - agent: Client
    type: give
    resource: Client bank account
    quantity: -100
    unit: NZD
  - agent: Team
    type: take
    resource: Team bank account
    quantity: 100
    unit: NZD
ahdinosaur commented 7 years ago

tracking hours!

type: event
resource: client's project
work:
  - agent: Alice
    quantity:
      value: 15
      unit: hour
  - agent: Bob
    quantity:
      value: 25
      unit: hour
  - agent: Carol
    quantity:
      value: 10
      unit: hour

or

version: 1
agent: Team
type: flow
action:
  - agent: Alice
    type: consume
    resource: Alice time
    quantity: -15
    unit: hour
  - agent: Bob
    type: consume
    resource: Bob time
    quantity: -25
    unit: hour
  - agent: Carol
    type: consume
    resource: Carol time
    quantity: -10
    unit: hour
  - agent: Team
    type: produce
    resource: Team time
    quantity: 50
    unit: hour
ahdinosaur commented 7 years ago

other example from back in the day: here.

ahdinosaur commented 7 years ago

invoicing clients!

version: 1
id: 1
agent: Team
type: plan
action:
  - agent: Team
    type: consume
    resource: Team time
    quantity: -50
    unit: hour
  - agent: Client
    type: produce
    resource: Client time
    quantity: 50
    unit: hour
 - agent: Client
    type: give
    resource: Client bank account
    quantity: -100
    unit: NZD
  - agent: Team
    type: take
    resource: Team bank account
    quantity: 100
    unit: NZD

confirmation:

version: 1
id: 2
agent: Client
type: plan
plan: 1

or more negotiation:

version: 1
id: 3
agent: Client
type: plan
action:
  - agent: Team
    type: consume
    resource: Team time
    quantity: -25
    unit: hour
  - agent: Client
    type: produce
    resource: Client time
    quantity: 25
    unit: hour
 - agent: Client
    type: give
    resource: Client bank account
    quantity: -50
    unit: NZD
  - agent: Team
    type: take
    resource: Team bank account
    quantity: 50
    unit: NZD

then confirmation:

version: 1
id: 4
agent: Team
type: plan
plan: 3