fix(claims): ensure resolvedAt is set on every resolve path (Closes #… - #267
Open
udeachudivine-spec wants to merge 2 commits into
Open
fix(claims): ensure resolvedAt is set on every resolve path (Closes #…#267udeachudivine-spec wants to merge 2 commits into
udeachudivine-spec wants to merge 2 commits into
Conversation
…igiNodes#219, BE-219) - Add resolvedAt nullable timestamp column to Claim entity - Add migration 1769600000000-AddClaimResolvedAt with backfill for existing resolved rows (resolvedAt = createdAt as conservative approx) - Add claim-resolution.invariant.ts with assertResolvedAtInvariant(), buildResolvedFields(), buildUnresolvedFields() helpers - Fix ClaimsService.resolveClaim(): set resolvedAt atomically with resolvedVerdict via buildResolvedFields(); add invariant guard before save; upgrade throw to NotFoundException - Fix ClaimResolutionService.resolveClaim(): same atomic set + guard - Fix JobsService.computeScores() (automated/oracle path): use buildResolvedFields() so resolvedAt is set on the job-driven path - Remove duplicate findOne() override in ClaimsService that shadowed the null-returning implementation with a throwing one - Update ClaimFactory: default resolvedAt to null; fix createClaimWithVerdict() to set resolvedAt alongside resolvedVerdict - Add claim-resolution.invariant.spec.ts: full invariant unit tests - Expand claim-resolution.service.spec.ts: resolveClaim resolvedAt tests (timestamp set, atomic write, finalized=true, verdict mapping) - Expand claims.service.spec.ts: resolvedAt timestamp tests, atomicity test, non-resolved null test, idempotency behaviour test Existing bad data note: rows where resolvedVerdict was already set before this migration receive resolvedAt = createdAt as a best-effort backfill. Exact resolution timestamps were not stored previously. Centralising all resolve paths into a single method is recommended as a follow-up (out of scope for medium-complexity budget).
Contributor
Author
|
hello maintainer please merge |
Contributor
|
resolve conflicts @udeachudivine-spec |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…219, BE-219)
Existing bad data note: rows where resolvedVerdict was already set before this migration receive resolvedAt = createdAt as a best-effort backfill. Exact resolution timestamps were not stored previously. Centralising all resolve paths into a single method is recommended as a follow-up (out of scope for medium-complexity budget).