Repository navigation
Task/hets 1366 pdt - #2249
Task/hets 1366 pdt#2249ionwyn wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates date handling for permanent Pacific time while preserving UTC storage semantics.
Changes:
- Adds permanent UTC−7 conversion logic and tests.
- Applies Pacific business dates across API, data, and import workflows.
- Pins the OpenShift .NET 8 build image.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
Server/HetsImport/Import/ImportUtility.cs |
Uses UTC audit timestamps. |
Server/HetsImport/Import/ImportServiceArea.cs |
Uses Pacific fiscal dates. |
Server/HetsImport/Import/ImportRotationDoc.cs |
Uses Pacific fiscal dates. |
Server/HetsImport/Import/ImportOwner.cs |
Uses Pacific year in generated keys. |
Server/HetsImport/Import/ImportEquipUsage.cs |
Uses Pacific fiscal dates. |
Server/HetsImport/Import/ImportBlock.cs |
Normalizes imported request timestamps. |
Server/HetsData/Repositories/OwnerRepository.cs |
Uses Pacific report dates. |
Server/HetsData/Helpers/RentalAgreementHelper.cs |
Uses Pacific fiscal-year calculations. |
Server/HetsData/Helpers/EquipmentHelper.cs |
Uses Pacific current year. |
Server/HetsCommon/FiscalHelper.cs |
Calculates fiscal years in Pacific time. |
Server/HetsCommon/DateUtils.cs |
Adds permanent UTC−7 handling and Pacific-now helper. |
Server/HetsCommon.Tests/HetsCommon.Tests.csproj |
Adds the common-library test project. |
Server/HetsCommon.Tests/DateUtilsTests.cs |
Tests permanent Pacific conversions. |
Server/HetsApi/Controllers/RentalRequestController.cs |
Uses Pacific document dates. |
Server/HetsApi/Controllers/OwnerController.cs |
Uses Pacific dates and key years. |
Server/HetsApi/Controllers/EquipmentController.cs |
Uses Pacific fiscal and document dates. |
Server/HetsApi/Controllers/DistrictController.cs |
Uses Pacific local and fiscal dates. |
Server/HetsApi.sln |
Registers the new test project. |
openshift/api-build-config.yaml |
Pins the .NET 8 builder image. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Server/HetsCommon/DateUtils.cs:66
- The XML summary now contradicts this branch: after the cutoff, the method returns fixed UTC−7 even when neither system time zone is available, rather than returning UTC. Update the public documentation so callers understand the cutoff and historical fallback behavior.
if (utcDate >= PermanentPacificTimeEffectiveUtc)
| RentalRequestStatusTypeId = (int) statusIdComplete, | ||
| ExpectedStartDate = DateTime.Now, | ||
| ExpectedEndDate = DateTime.Now, | ||
| ExpectedStartDate = DateUtils.AsUTC(DateUtils.GetPacificNow().Date), |
There was a problem hiding this comment.
This is a bit odd. Should we use something like this (similar to DistrictController.cs:95):
ExpectedStartDate = DateUtils.ConvertPacificToUtcTime( new DateTime(now.Year, now.Month, now.Day, 0, 0, 0, DateTimeKind.Unspecified));
There was a problem hiding this comment.
DistrictController isn't the same as this functionally.
-
ExpectedStartDateandExpectedEndDateare date-only values. Rental-request CRUD endpoints preserve calendar fields withDateUtils.AsUTC. Converting Pacific midnight like that would instead store07:00Zunder permanent UTC−7. It will triggerExpectedStartDate <= endDtUtcfilter which will exclude the record. -
AsUTC(GetPacificNow().Date)deliberately takes today’s Pacific calendar date and stores it as the established UTC date-only representation, so I think the current code is fine.
306a1df to
5117930
Compare
Signed-off-by: Ionwyn Sean <ionwynsean@gmail.com>
Signed-off-by: Ionwyn Sean <ionwynsean@gmail.com>
Replace local DateTime.Now/DateTime.UtcNow calls with the new Pacific-aware DateUtils.GetPacificNow() helper across controllers, helpers, and import jobs so fiscal-year, report-date, and key-generation logic stays correct under Permanent Daylight Time. Signed-off-by: Ionwyn Sean <ionwynsean@gmail.com> asd Signed-off-by: Ionwyn Sean <ionwynsean@gmail.com>
Signed-off-by: Ionwyn Sean <ionwynsean@gmail.com>
Signed-off-by: Ionwyn Sean <ionwynsean@gmail.com>
Image Source: https://catalog.redhat.com/en/software/containers/ubi8/dotnet-80/6541575dad480ee2461f4268#overview TZDATA: https://access.redhat.com/articles/1187353 Signed-off-by: Ionwyn Sean <ionwynsean@gmail.com>
Signed-off-by: Ionwyn Sean <ionwynsean@gmail.com>
5117930 to
e3f853a
Compare
Signed-off-by: Ionwyn Sean <ionwynsean@gmail.com>
Summary
This PR updates HETS server-side date handling so Pacific business dates and UTC/Pacific conversions continue to use UTC−7 after that change.
Changes
DateUtils:America/Vancouver/ Windows Pacific timezone rules.DateUtils.GetPacificNow()and replaces server-local/current-time use where HETS needs a Pacific calendar date.registry.redhat.io/rhel8/dotnet-80:8.0.129-1786585358(amd64 digestsha256:37066d6a49a1eb97958fe2ecef672f8d992c7fc81215b6dca62c0b5ea7a1ad7b).:latestis pointing to April 2025 image...???HETS features affected
Essentially everything that uses dates
Verification
DateUtils test6 passed, 0 failed.rpm -q tzdata→tzdata-2026c-1.el8_10.noarchTZ=America/Vancouver date -d "2026-12-15 12:00:00 UTC"→05:00 MST(still UTC−7).What would happen if someone outside Pacific Time visits:
The builder is intentionally pinned for reproducibility. Future RHEL image updates should be tested for
tzdataversion and the December-2026 conversion before changing the pinned tag.Image tkaen