fjborquez / azula

0 stars 0 forks source link

A inventory item appears in the inventory table and it shouldn't #43

Closed Norbbs closed 5 days ago

Norbbs commented 3 weeks ago

As a Data Owner I want to see the inventory items which are valid So that I can ensure its integrity and it is consistent

Definition Of Ready (DoR)

Definition Observations
  • - [ ]
Story where the issue was identified or an easy way to reproduce #11
  • - [ ]
Environment prod
  • - [ ]
Priority high

Bug Description

In the inventory table there is a inventory item which is not valid because it is not bound to any status in the product_status_transition table.

Look at the SQL script:

SELECT CONCAT(i.quantity, ' ', i.uom_abbreviation) AS qty,
       i.brand_name AS brand,
       i.catalog_description,
       i.purchase_date,
       i.expiration_date,
       ps.id,
       ps.description
FROM inventories i
INNER JOIN product_status_transitions pst ON pst.inventory_id = i.id
INNER JOIN product_status ps ON pst.product_status_id = ps.id
WHERE i.house_id = ? AND pst.is_active = 1 AND ps.is_final_phase IS FALSE

Steps to Reproduce

  1. Go to houses section
  2. Select anyone and click on 'inventory' link
  3. View the inventory

Expected Behavior

Image

Actual Behavior

Image

Impact

Only inventory items which has a valid and active status (not final phase) will be displayed in the inventory table.