Skip to content

Standardize report date and timezone handling #595

Description

@StuartFerguson

Problem

The service mixes DateTime.Today, DateTime.Now, and client-provided DateTime values across handlers and reporting queries. This can produce inconsistent results around midnight, daylight-saving transitions, and estates in different timezones.

Relevant areas:

  • EstateReportingAPI/Handlers/CalenderHandler.cs
  • EstateReportingAPI.BusinessLogic/ReportingManager.cs
  • Transaction and settlement request DTOs

Scope

Introduce a documented date/time policy:

  • Define whether API timestamps are UTC or offset-aware.
  • Define inclusive/exclusive report range semantics.
  • Resolve an estate business timezone consistently.
  • Replace direct system-clock calls with an injectable clock abstraction.

Acceptance criteria

  • All report endpoints follow the same date-range semantics.
  • The estate timezone is applied consistently to day-based reports.
  • Clock-dependent logic can be tested deterministically.
  • Tests cover midnight and daylight-saving boundary cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions