basisproject / tracker

A meta repo that tracks bugs, features, discussions, and progress in a centralized location for the entire Basis project.
14 stars 1 forks source link

Define product/order data models #2

Closed orthecreedence closed 4 years ago

orthecreedence commented 4 years ago

Products

Orders

Orders are not just the intent, but also the event that triggers the attachment of the disaggregate "costs" of inputs, labor, etc onto the products as a function of that order. In other words, I order 10 widgets, once those widgets are complete, the order doesn't just describe the 10 widgets, but also the inputs, labor, and other costs associated with those widgets attached to each widget such that each widget will have 1/10 of all the data attached to it.

This way, orders are a "freeze frame" of those products and memorialize the data making up their production.

Shipping

Moved to issue #19 (and punting until after v0.1)


Models should reflect the anarcho-communist principles of this project, not the Basis <--> market interfacing (in other words, we are building this assuming the entire economy is using it and markets are no more).

orthecreedence commented 4 years ago

unassigned @orthecreedence

orthecreedence commented 4 years ago

assigned to @orthecreedence

orthecreedence commented 4 years ago

mentioned in commit basis@ff9267aa4474dc895aa3627863213332dfcb57a4

orthecreedence commented 4 years ago

changed weight to 10

orthecreedence commented 4 years ago

changed weight to 5

orthecreedence commented 4 years ago

mentioned in commit basis@a482a7be256a727471be62ba96428893c5db7ddd

orthecreedence commented 4 years ago

mentioned in commit basis@3c055e5ffb8ea6960f50975394b47a2b31924e5f

orthecreedence commented 4 years ago

As I'm building this out I'm realizing just how complicated the cost tracking might be, so I'm going to probably prototype this in JS and move to rust once I'm happy. I've redefined this model like 10x already. I'm fairly satisfied with the product model, but orders and shipping really need some clear thought. Mainly orders, because they are the vehicle for cost tracking and I'm not sure how that looks yet.

orthecreedence commented 4 years ago

removed the weight

orthecreedence commented 4 years ago

I'm waffling back and forth on not even modeling in cost tracking in the products themselves

Attaching cost information directly to products

Pros:

Cons:

Calculating costs after the fact (either on-demand or via some kind of graph database)

Pros:

Cons:


Ok, thanks, pros and cons list. Calculating costs after the fact seems much more like kicking the can down the road than it does "Aha! I've solved it!" In fact, calculating after the fact would necessitate some kind of caching layer anyway if it was to be practical, so no matter what you'll have the possibility of stale data.

Also, the more I think about it, the more I'm realizing that the algorithm can be updated, and will adjust over a much shorter period of time than the "years" I quoted above.

It's seeming more and more like, yes, you should definitely store the costs of products and services directly with them (or as some form of linked cost-attachment object).

orthecreedence commented 4 years ago

Happy day: just merged the cik branch into `master on https://gitlab.com/basis-/product-costs.

Now it's a matter of adapting the algorithm to encompass real orders instead of fake test data! This is a great step forward for the project.

orthecreedence commented 4 years ago

ok, so every time there is an order or clock in/out, we're going to readjust the product costs. however, this doesn't mean it's easy to get the product prices for each order. there are two options.

  1. store the product prices in the order itself.
  2. store the log of product price changes with the company, indexed by date.

the first option is the easiest, but takes a lot more storage. really, since orders are going to be the most numerous object, i want to keep them as lean as possible.

the second option keeps orders leaner, but is a bit more query time when creating the order.

???

might start off putting the costs into the order itself because this is a proof of concept, then switch it to something more efficient later.

orthecreedence commented 4 years ago

Closing this in favor of #23 since we've broken the pieces out a bit more. This was mostly a discussion issue and it has served that purpose quite well, even if I was the only one engaging in discussion. Now we have a more solid plan, so we'll leave the talk to the politicians.

orthecreedence commented 4 years ago

closed