After discussing this extensively at the conference, here's the current Barcoding paradigm that I think we're going to use going forward:
Global Barcode Items
"Local" Barcode items
Querying Barcodes
User Interface for Organizations (opining a bit here)
User Interface for Admins
these are being moved over to #326 since they don't yet exist
- Default view for
Admin::BarcodeItems#index is global only (we will likely need to add will_paginate)
- Filter on canonical item
- Filter on "global?"
- Filter on barcode value
- Filter on organization
- Add New Barcode for adding new Global barcodes (mapping to canonical items only)
- Create a new action / view that creates a report of commonly used barcode values across multiple organizations
For "Clean up" we just need to audit these files to ensure they are in-line with the above behaviors:
/app/models/barcode_item.rb
/app/controllers/admin/barcode_items_controller.rb
/app/controllers/barcode_items_controller.rb
/app/views/admin/barcode_items/*
/app/views/barcode_items/*
/spec/controllers/admin/barcode_items_controller.rb
/spec/controllers/barcode_items_controller.rb
/spec/factories/barcode_items.rb
/spec/features/admin/barcode_items_spec.rb
/spec/features/barcode_items_spec.rb
/spec/models/barcode_item_spec.rb
/spec/support/barcode_helper.rb
Some of them may already be OK but we'll need to assess all of them to be sure.
After discussing this extensively at the conference, here's the current Barcoding paradigm that I think we're going to use going forward:
Global Barcode Items
BarcodeItemfor whichbarcode_item.global? == trueCanonicalItemrecords (via the:barcodeablepolymorphic association)CanonicalItemmay have multiple globalBarcodeItems pointing to it ("Huggies 4T, 30ct", "Pampers 4T 30ct" and "Luvs 4T 30ct" would all point to the "4T" `)"Local" Barcode items
BarcodeItemfor whichbarcode_item.global? == falseItemrecords (via the:barcodeablepolymorphic association)Itemcan also have multipleBarcodeItems pointing to it, but the composite of:barcode_value+:organization_idmust be unique (ie. a single organization cannot use the same barcode to point to multiple types)Querying Barcodes
CanonicalItem), it will need to do a followup query to locate the oldestItemthat the organization has that matches thatCanonicalItemtype (older results are more likely to be generic).RecordNotFoundand the controller should return a:404status.User Interface for Organizations (opining a bit here)
Item/CanonicalItemassociation to use thepartner_keytrait instead of the integer key #588 first)Have "Add Another Barcode" display the barcode modal, if possible, and then refresh the tableBarcodeItems#indexview -- boop a barcode and it filters to only show that result (Create a:by_valuescope and then add it to the filters section)User Interface for Admins
these are being moved over to #326 since they don't yet exist
Admin::BarcodeItems#indexis global only (we will likely need to addwill_paginate)For "Clean up" we just need to audit these files to ensure they are in-line with the above behaviors:
Some of them may already be OK but we'll need to assess all of them to be sure.