Skip to content

fix: normalize XP event timestamps to UTC - #1052

Merged
MaryammAli merged 2 commits into
BlockDash-Studios:mainfrom
Yungmon22:fix/issue-1001-ba-088-keep-xp-event-timestamps-in-utc
Oct 17, 2026
Merged

MaryammAli merged 2 commits into
BlockDash-Studios:mainfrom
Yungmon22:fix/issue-1001-ba-088-keep-xp-event-timestamps-in-utc

Conversation

@Yungmon22

Copy link
Copy Markdown
Contributor

Overview

This PR normalizes accepted XP event timestamps to UTC in the gamification XP service, so event times are stored consistently regardless of the offset supplied by the caller. It also adds tests covering offset inputs and default (missing) timestamp inputs.

Related Issue

Changes

🕒 XP Event Timestamp Normalization

  • [MODIFY] BackendAcademy/src/gamification/xp.service.ts

    • Normalize accepted event times to UTC before they are recorded, so offset-bearing inputs are converted to a consistent UTC instant.
    • Apply a default timestamp when no event time is supplied.
  • [MODIFY] BackendAcademy/src/gamification/xp.types.ts

    • Update the XP event types to reflect the normalized UTC timestamp handling.
  • [MODIFY] BackendAcademy/src/gamification/xp.service.spec.ts

    • Add tests for offset timestamp inputs and default timestamp inputs.

Verification Results

npm test -- BackendAcademy/src/gamification/xp.service.spec.ts
✅ XP service spec passed (offset + default timestamp cases)
Acceptance Criteria Status
Normalize accepted event times to UTC ✅ Offset inputs converted to UTC in xp.service.ts
Test offset timestamp inputs ✅ Covered in xp.service.spec.ts
Test default timestamp inputs ✅ Covered in xp.service.spec.ts

Closes #1001

@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@Yungmon22 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@MaryammAli
MaryammAli merged commit bb41121 into BlockDash-Studios:main Oct 17, 2026
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.

BA-088 — Keep XP event timestamps in UTC

2 participants