Skip to content

OBPIH-7322 change products inventoried to use items inventoried indic…#5399

Merged
awalkowiak merged 1 commit intodevelopfrom
bug/OBPIH-7322-products-inventoried-fix
Jul 23, 2025
Merged

OBPIH-7322 change products inventoried to use items inventoried indic…#5399
awalkowiak merged 1 commit intodevelopfrom
bug/OBPIH-7322-products-inventoried-fix

Conversation

@ewaterman
Copy link
Member

…ator logic

✨ Description of Change

Link to GitHub issue or Jira ticket: https://pihemr.atlassian.net/browse/OBPIH-7322

Description: Change the logic for the "products inventoried" indicator to use the same logic as the "items inventoried" dashboard indicator (as was suggested by Manon). Kacper already refactored the dashboard indicator to account for the baseline + adjustment refactor so this seems safe to do. We want to display the same data in both indicators.


📷 Screenshots & Recordings (optional)

Screenshot from 2025-07-22 11-09-32

@ewaterman ewaterman self-assigned this Jul 22, 2025
@github-actions github-actions bot added type: bug Addresses unintended behaviours of the app domain: backend Changes or discussions relating to the backend server labels Jul 22, 2025
Copy link
Member

@jmiranda jmiranda left a comment

Choose a reason for hiding this comment

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

Looks good.

transactionTypeIds : transactionTypeIds,
firstOfMonth : firstOfMonth,
startDate : startDate ?: DateUtil.EPOCH_DATE,
endDate : endDate ?: new Date(),
Copy link
Member

Choose a reason for hiding this comment

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

I like the idea here (re: defaults) but we should confirm that these are good "expected" values for start and end dates. Regardless, we either need default values OR logic to handle NULLs.

I had been thinking about this when handling some of the reporting use cases. I don't love the excessive if/then/else conditions for when start date and/or end date are NULL, so I'd be very happy if we could always use BETWEEN for these queries as long as we can come up with sensible defaults.

])

return new NumberData(itemsInventoried[0])
return new NumberData(itemsInventoried[0] as Double)
Copy link
Member

Choose a reason for hiding this comment

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

I've been mindlessly using BigDecimal for any floating-point numbers. Do you have a justification for using Double over BigDecimal? Or are we just picking our favorite floating-point class at this point?

/**
* A Date representing the epoch instant, which is January 1, 1970, 00:00:00 GMT.
*/
static final Date EPOCH_DATE = new Date(0)
Copy link
Member

Choose a reason for hiding this comment

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

Wow, after all of that ZonedDateTime and LocalDateTime discovery work ... you're just going to new Date(0) us?

I'm kidding. I have no opinion or even concept of what could/should be used here. And given the meaninglessness of timezones re: the epoch date, this seems like a fine approach.

Side note: Seeing new Date(0) reminded me of the line from the SNL Papyrus skit (https://www.youtube.com/watch?v=jVhlJNJopOQ)
"like a thoughtless child wandering by a garden, yanking leaves along the way"

@awalkowiak awalkowiak merged commit 3811962 into develop Jul 23, 2025
6 checks passed
@awalkowiak awalkowiak deleted the bug/OBPIH-7322-products-inventoried-fix branch July 23, 2025 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: backend Changes or discussions relating to the backend server type: bug Addresses unintended behaviours of the app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants