feat(log): admin endpoint to bulk-set FinancialDataLog validity#3919
Open
TaprootFreak wants to merge 2 commits into
Open
feat(log): admin endpoint to bulk-set FinancialDataLog validity#3919TaprootFreak wants to merge 2 commits into
TaprootFreak wants to merge 2 commits into
Conversation
…y date range and balance
…w in financial validity update
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.
Why
FinancialDataLogentries occasionally get a transient, implausibly hightotalBalanceChf(booking-order race:plusBalanceChfjumps ahead of the correspondingminusBalanceChf). Until now each occurrence required a hand-written one-shot migration to flipvalid(e.g. #3884, #3889, #3892, #3903, #3916). This adds a reusable admin endpoint so the same correction can be applied (and reverted) without a migration per day.Endpoint
PUT /log/financial/validity— ADMIN only.Bulk-sets the
validflag onFinancialDataLogentries (system=LogService,subsystem=FinancialDataLog,severity=Info) matched by an optionalcreatedrange and/ortotalBalanceChfbounds.Body (
SetFinancialLogValidityDto):fromcreated >= from(inclusive)tocreated <= to(inclusive)mintotalBalanceChf > minmaxtotalBalanceChf < maxvalidReturns
{ affected: <rowCount> }.Guard rails
from/to/min/max) is required — prevents touching the whole table.frommust not be afterto;minmust be smaller thanmax.Example
…replaces the daily migration that invalidated 2026-06-18 entries with
totalBalanceChf > 60000.Tests
Service spec covers the validation branches and repository delegation (5 tests). Locally green:
format:check,lint,type-check,jest.