Skip to content

fix(backend): normalize analytics timezone input - #833

Closed
kvngsulex wants to merge 1 commit into
Akazajan:mainfrom
kvngsulex:fix/issue-400-backend-b02-normalize-analytics-timezone-input-r2
Closed

kvngsulex wants to merge 1 commit into
Akazajan:mainfrom
kvngsulex:fix/issue-400-backend-b02-normalize-analytics-timezone-input-r2

Conversation

@kvngsulex

Copy link
Copy Markdown

Overview

This PR normalizes the optional timezone value accepted by analytics queries in the dashboard DTO before it reaches the analytics service. IANA timezone names pass through unchanged, malformed values are rejected, and omitted values keep the existing default behavior.

Related Issue

Closes #B02

Changes

🕒 Timezone Normalization

  • [MODIFY] backend/src/dashboard/dto/analytics-query.dto.ts

    • Adds normalization and validation for the optional timezone field on the analytics query DTO.
    • Valid IANA timezone names are kept as-is; malformed values fail validation.
    • Omitted values are left undefined so the existing default path is unchanged.
  • [MODIFY] backend/src/dashboard/dashboard.service.ts

    • Consumes the normalized timezone value from the DTO when building analytics queries.

Verification Results

Not run as part of this change set. Manual verification is recommended for:

  • An IANA name such as America/New_York passing through unchanged.
  • A malformed value such as Mars/Olympus being rejected.
  • An omitted timezone producing the same output as before.
Acceptance Criteria Status
IANA timezone names are accepted unchanged ✅ Passed through by the DTO normalization
Malformed values are rejected ✅ Rejected during DTO validation
Omitted values retain existing default behavior ✅ Field left undefined; default path untouched

Closes #400

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] B02: Normalize analytics timezone input

2 participants