openboxes icon indicating copy to clipboard operation
openboxes copied to clipboard

OBPIH-7610 restructure date formatter and parser classes away from DateUtil

Open ewaterman opened this issue 1 month ago • 2 comments

:sparkles: Description of Change

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

Description: Sorry once again for a long PR. 95% of it is just moving classes into new places so I'm going to go over it in tech huddle because a full review wouldn't be worth the time IMO.

I got fed up with the structure of all these asX methods being in DateUtil so I moved them into individual XParser classes. That does a better job of encapsulating the logic and allows us to do the Date -> Instant/LocalDate refactor easier (see my comments in the individual files for details)

ewaterman avatar Dec 09 '25 23:12 ewaterman

Codecov Report

:x: Patch coverage is 38.16794% with 162 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 9.81%. Comparing base (1bb7314) to head (8f0caf6). :warning: Report is 122 commits behind head on develop.

Files with missing lines Patch % Lines
...y/org/pih/warehouse/core/date/InstantParser.groovy 51.66% 19 Missing and 10 partials :warning:
...pih/warehouse/core/date/ZonedDateTimeParser.groovy 46.80% 16 Missing and 9 partials :warning:
...y/org/pih/warehouse/core/date/DateFormatter.groovy 45.94% 15 Missing and 5 partials :warning:
.../pih/warehouse/core/date/JavaUtilDateParser.groovy 34.48% 9 Missing and 10 partials :warning:
...org/pih/warehouse/core/date/LocalDateParser.groovy 36.84% 7 Missing and 5 partials :warning:
...oovy/org/pih/warehouse/core/date/DateParser.groovy 11.11% 8 Missing :warning:
...ih/warehouse/core/date/DateFormatterContext.groovy 0.00% 3 Missing and 4 partials :warning:
...h/warehouse/core/date/JavaUtilDateFormatter.groovy 50.00% 6 Missing and 1 partial :warning:
...ices/org/pih/warehouse/report/ReportService.groovy 0.00% 6 Missing :warning:
...ces/org/pih/warehouse/core/DashboardService.groovy 0.00% 4 Missing :warning:
... and 14 more
Additional details and impacted files
@@             Coverage Diff              @@
##             develop   #5661      +/-   ##
============================================
+ Coverage       9.12%   9.81%   +0.69%     
- Complexity      1170    1352     +182     
============================================
  Files            701     725      +24     
  Lines          45281   45942     +661     
  Branches       10851   10973     +122     
============================================
+ Hits            4131    4510     +379     
- Misses         40497   40725     +228     
- Partials         653     707      +54     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Dec 09 '25 23:12 codecov[bot]

@ewaterman Does this PR have a ticket?

alannadolny avatar Dec 10 '25 10:12 alannadolny

I'm merging this PR to unblock my other work that I'm trying to wrap up before the break but as usual please feel free to leave review comments and I can address in a new PR.

ewaterman avatar Dec 15 '25 21:12 ewaterman