question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Record structure and inventory

See original GitHub issue

I must say I don’t like the way BeerXML 2.0.1 defines the ingredient records by including the inventory in the record and the amount inside the inventory. Beerjson is currently following this format. (BeerXML 1.0 had “amount” separately, and “inventory” was an extension).

In the hop record, for instance, the inventory is further divided into the fields “leaf”, “pellet”, and “plug”, each of them with their own dictionary (object in JS) with the keys (names) “units” and “mass”. My first complaint is that, a given hop variety, even from the same season and vendor, will have different alpha-acid contents depending on whether being a leaf, a pellet, or a plug. So it makes no sense to allow for more than one type in the same record. Besides, there are many other forms of hops, nowadays.

Thus, even with just one type/form of hop it would make more sense to have

        "use" : "aroma",
        "type":  "leaf",
        "amount" : {
            "units": "oz",
            "mass": 2.0
          }
        }

instead of

        "type" : "aroma",
        "inventory": {
          "leaf": {
            "units": "oz",
            "mass": 2.0
          }
        }

If you prefer to keep the key/name “type” for “aroma”, etc; we can use {“form” : "leaf}, for instance. That is not the main point, although I prefer “use” for “aroma”/“flavor”/etc. And “type” is usually reserved for something more significant than that, which are not well defined characteristics of a hop addition. So, on a second thought, maybe { “use” : “aroma”, “form” : “pellet”} might be best.

From a practical point of view, it makes it easier to write a software if all “amounts” have the same key “amount”, instead of varying according to the type.

My other complain, again from the point of view of developing a software, at least this is the way I see it, is that we would have an “Inventory” object and a “Recipe” object, containing all hops, fermentables, etc., and each record will say the amount in the inventory or in the recipe. Not the other way around.

So, my suggestion is to drop the field “inventory” from all the records, create an “amount” field for the amount, creat a “form” field when appropriate, and change “type” to “use” regarding “aroma”, “flavor”, etc… And then “Inventory” could be a Record Set.

I wish I could implement this, if you agree, and submit a PR, but JS is not my thing at all. I hope you don’t mind me making suggestions I find relevant.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
mikfirecommented, Feb 28, 2018

I think not including inventory is a good idea. It doesn’t really make much sense if we are (say) copying recipes about. What’s in my inventory certainly isn’t in yours. And I think that should apply to almost any thing.

One small suggestion. Consider having just one “amount” object, and then having a “type” of “mass”, “volume” or “unit” (for use with whirfloc tablets or a vial of clarityfirm). If you decide against it, then consider having a “amount_as_mass” and “amount_as_volume”. I really prefer explicit declarations over inferences.

0reactions
krutilincommented, Apr 3, 2018

Inventory schema and the possibility to validate it is good for software where you store lists of your ingredients, but there is no place for it in data interchange format. Will close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Records Inventory - Introduction | National Archives
In records management, an inventory is a descriptive listing of each record series or system, together with an indication of location and other ......
Read more >
Records Inventory 101 - ARMA Magazine
In records administration, an inventory is a detailed listing of each record/record series or system, along with a location indicator, and other ...
Read more >
RECORD STRUCTURES FOR INVENTORY RECEIPT ...
Assume that a purchase order file exists and will be updated through information collected via a receiving report, which is the transaction record....
Read more >
Records Inventory
The records inventory is used to collect information about your records including type, date range, format, volume, storage location, and applicable records ......
Read more >
The Importance of a Records Inventory
A records inventory is an organizing system for tracking files, both hard copy and digital. If you need to lay your hands on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found