MJ Freeway/LeafData Batch Data Slop

This is perhaps one of the funniest bugs we've found in LeafData.

What is a Batch

These things called a Batch are a component of LeafData. Batches are logical data-containers for Plants and Inventory Lots. In some cases the Batch also attempts to contain some Harvest and Cure details (a failure we'll describe later).

Viewing the Slop

curl \
  --header 'x-mjf-mme-code: license' \
  --header 'x-mjf-key: license-key'
  https://traceability.lcb.wa.gov/api/v1/batches

And then, observe the items in the response, here's a relevant snippet of one (with data masked). The first group if fields is where MJF/LD shows us the integer based primary keys from their database -- LAME!!! The second group there shows some of the goofy time values these guys return -- LAME!!! And the third group shows where, on a Batch type object, they are handing back the names of users -- LAME! LAME! LAME!

{
    "id": "17777200",
    "mme_id": "1025",
    "user_id": "876",
    "area_id": "143968",
    "other_area_id": null,
    "flower_area_id": null,
    "created_by_mme_id": "0",
    "strain_id": "0",
    "mother_plant_id": null,
    "customer_id": null,
    ...
    "planted_at": "0000-00-00 00:00:00",
    "harvested_at": "0000-00-00 00:00:00",
    "est_harvest_at": "0000-00-00 00:00:00",
    "packaged_completed_at": "0000-00-00 00:00:00",
    ...
    "global_user_id": "WAWA1.XXXX",
    "first_name": "**Actual User**",
    "last_name": "**Actual Last Name**",
}

TL;DR

This is some raggeddy ass shit here boy. Very sloppy — omar