OBPIH-7322 change products inventoried to use items inventoried indic…#5399
Conversation
| transactionTypeIds : transactionTypeIds, | ||
| firstOfMonth : firstOfMonth, | ||
| startDate : startDate ?: DateUtil.EPOCH_DATE, | ||
| endDate : endDate ?: new Date(), |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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"
…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)