Skip to content

fix: ensure resolvedAt is updated for legacy claims on transition - #334

Open
Abyy8 wants to merge 1 commit into
DigiNodes:mainfrom
Abyy8:fix-claim-resolvedAt
Open

fix: ensure resolvedAt is updated for legacy claims on transition#334
Abyy8 wants to merge 1 commit into
DigiNodes:mainfrom
Abyy8:fix-claim-resolvedAt

Conversation

@Abyy8

@Abyy8 Abyy8 commented Aug 26, 2026

Copy link
Copy Markdown

Closes #219

Description

This PR fixes an audit invariant failure regarding resolvedAt timestamps. Legacy claims that were resolved prior to the database migration (and therefore have resolvedAt = null) were failing to generate a timestamp during subsequent state transitions because the entity assumed the timestamp was already set.

Changes Made

  • Added a fallback null check in claim.entity.ts for the RESOLVED -> RESOLVED and RESOLVED -> FINALIZED transition paths. This ensures legacy claims receive a resolvedAt timestamp while preserving the original timestamp for newer claims.
  • Added two explicit unit tests to claim.entity.spec.ts to validate this invariant against legacy data.
  • Ensured all existing BE-219 tests continue to pass with zero regressions.

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.

Claim resolvedAt null check

1 participant