Repository navigation
fix(reconciliation): select runs by run_at and validate tx_batch_id - #1355
Open
innocentharuna wants to merge 1 commit into
Open
innocentharuna wants to merge 1 commit into
innocentharuna wants to merge 1 commit into
Conversation
RevenueReconciliationService filtered distribution runs on distribution_date and read stellar_transaction_hash, neither of which exists on DistributionRun. Every run was dropped, so reconciliation always reported zero payouts. Filter on run_at and use tx_batch_id as the chain transaction reference. Also drop a duplicate Decimal import that tsc flagged in the same file. Closes RevoraOrg#1256 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
@thlpkee20-wq please merge |
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.
Closes #1256
Replaces #1307, which I closed because it included unrelated files that shouldn't have been there.
Changes
reconcileandquickBalanceChecknow filter distribution runs onrun_at(inclusive of both ends) instead of the non-existentdistribution_date.validateChainEventConsistencyreads the transaction reference fromtx_batch_idinstead ofstellar_transaction_hash. Runs without one are still reported asSTELLAR_TX_NOT_FOUND.Decimalimport.tsc --noEmitnow reports no errors forrevenueReconciliationService.ts.I kept the in-memory filter rather than adding a new repository query, to keep the diff focused.
Tests
DistributionRunfields (run_at,tx_batch_id).distribution run period filtering (run_at)block:periodEndis countedmaster.tx_batch_idis not flaggedSTELLAR_TX_NOT_FOUND. The existing "missing transaction hash" test still covers the flagged case.npx jest src/services/revenueReconciliationService.test.ts: 39 passing, 4 failing. The same 4 tests fail onmasterand are unrelated to this issue: decimal-scale formatting (0.00vs0.0000000000), a missingfindByOfferingmock, and the verifier-disabled path. This file isn't part of the CI job.🤖 Generated with Claude Code