patients-io / frameinventory

0 stars 0 forks source link

Insert Product into DB when scanning code that's wasn't in MIMs #5

Closed michael-martin-al closed 6 years ago

michael-martin-al commented 6 years ago

Frames that are not found are not coming up in the list. The only data we have on those frames is the barcode and quantity but that all that needed to update MIM.

@stark1119 Should we prompt or auto-insert?

michael-martin-al commented 6 years ago

I'm working on a solution to auto-insert on scan. It's a multi-step process where we must:

  1. Check for the UPC in the inventory_count table
  2. If it's present, return the data
  3. If it's not present, we have to check for UPC in product table
  4. If there's no product with that UPC, insert it into the product table leaving all fields blank except UPC
  5. Then, insert into inventory_count table using the id just inserted into product table and a report_qty of 0 and manual_qty of 1.
  6. Finally, return the new data to the calling function