Skip to content

Conversation

AlexeyKasianenko
Copy link

@AlexeyKasianenko AlexeyKasianenko commented Aug 11, 2025

Resolves #5249

Description

Quantity in has donations, purchases, adjustments that increase the inventory.
Quantity out has distributions and adjustments that decrease the inventory

Kit allocations result in quantity in for the kit, and quantity out for the components

See the current Inventory In and Inventory Out tabs for details

Change is Quantity In minus Quantity Out. Negatives are presented in red.

Include anything else we should know about. -->

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

go to /storage_locations page

Screenshots

image

@cielf
Copy link
Collaborator

cielf commented Aug 11, 2025

notes for my functional testing (which won't be until at least tomorrow): beyond basic checks, check what happens if we try to go back before the first snapshot. Are we already constraining this / should we be and how are we communicating that otherwise. (this may require using prod data to test well) (Note: thinking about it - if we base this on eventables (which is probably the best bet ) we should constrain it to start no earlier than the first snapshot)

@cielf
Copy link
Collaborator

cielf commented Aug 12, 2025

@AlexeyKasianenko Thank you for this! I'm going to add things I notice here on-the-go while I test. I'm not looking at the code, just trying out the functionality.

@cielf
Copy link
Collaborator

cielf commented Aug 12, 2025

1/ First thing is that I'm afraid the performance is slow. I'm checking it with the production data for one of active bank. Using the production branch, the storage location view comes up in 4 seconds, on your current branch it takes 89 seconds.

@cielf
Copy link
Collaborator

cielf commented Aug 12, 2025

2/ You're showing items that aren't on the inventory in / out tabs (again, this is testing with production data). I'm about 90% sure that they don't show inactive items, if so you should do the same.

@cielf
Copy link
Collaborator

cielf commented Aug 12, 2025

3/ If I update the date range and click "filter", it's going back to the first tab. This is potentially confusion/annoying for our users. Let's have it stay on the same tab.

@cielf
Copy link
Collaborator

cielf commented Aug 12, 2025

4/ The current "all time" is not working properly (with all time, in plus out should equal inventory on the first page) with production data. However, I want to check with the senior team about whether we should just constrain the date range-- i suspect that's going to make sense.

@cielf
Copy link
Collaborator

cielf commented Aug 12, 2025

5/ When I did a "this year" in the date range, and filtered (with production data), when I returned to the page there was only one item. I know there are more. I'll try to recreate that with the seed data. (Edit: no immediate luck -- I'll need to poke further on this one)

@cielf cielf self-requested a review August 12, 2025 17:09
Copy link
Collaborator

@cielf cielf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @AlexeyKasianenko -- I'm at the end of working on this for today. Could you look at points 1, 2, and 3 above, please. I'll confirm number 4 with the senior team on Sunday, and number 5 is going to take some digging to figure out -- I'll probably wait and try to recreate it with production data once you've addressed 1, 2, and 3.

@awwaiid awwaiid self-assigned this Aug 17, 2025
Copy link
Collaborator

@awwaiid awwaiid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! This was a good first run at this, but unfortunately we need a different approach. The idea here is to base this off of Events instead of Items. Events form our improved transactional log, and we'd be able to get the per-storage-location Events to accurately capture the quantity ins and outs for an item over a period of time.

You MIGHT be able to update the queries you built to be Event centric, still joining off of Items to group them. Then you pass in the time range filter and limit to increases or decreases in the quantity depending on which column you're populating.

That also means, as an aside, that we want to hard-wire in a start-date for the filter to 2024-09-01, by which time every organization was using Events to track inventory changes.

Let me know if this makes sense and if you're up for it!

@cielf
Copy link
Collaborator

cielf commented Sep 10, 2025

@awwaiid I would counter that we want to hard-wire that the start date can be no earlier than 2024-09-01. I, for one, don't want to have to work more than a full year of data if I'm checking into something that happened 2 weeks ago.

@cielf
Copy link
Collaborator

cielf commented Sep 25, 2025

Hmmm.
To start testing this out, signed in as [email protected], I made a donation of 22 Adult Briefs (Medium/Large) to Bulk Storage Location.

Screenshot 2025-09-25 at 5 08 36 PM

I then went to the Inventory Flow tab, and selected the date range "Today".
I expected that there would be an entry for Adult Briefs (Medium/Large) with Quantity In of 22.
There was not.
Screenshot 2025-09-25 at 5 09 39 PM

Copy link
Collaborator

@cielf cielf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @AlexeyKasianenko -- Thank you -- I'm going to hold off on any further functional testing until the above is addressed, as I expect its fix will impact anything else I would try.

I looked very briefly at the code, and didn't see any reference to Events. Did you make that change as well?

@AlexeyKasianenko
Copy link
Author

Hey @cielf. Fixed that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inventory Coming In / Going out -- Rework to Inventory Flow, including date range.
3 participants