Repository navigation
fix(revenue): persist issuer_id and reported_by in submitReport - #1354
Open
innocentharuna wants to merge 1 commit into
Open
innocentharuna wants to merge 1 commit into
innocentharuna wants to merge 1 commit into
Conversation
submitReport built the insert payload without issuer_id and reported_by, both NOT NULL in migration 016, so every real submission failed with a not-null violation. Populate both columns; the handler now threads the authenticated user through as reportedBy. Also add the missing isPositiveDecimalAmount import in revenueService.ts, which was failing the existing revenue tests on master. Closes RevoraOrg#1257 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 #1257
Replaces #1306, which I closed because it included unrelated files that shouldn't have been there.
Changes
RevenueService.submitReportnow setsissuer_id(fromissuerId) andreported_byin the insert payload. A new optionalreportedByinput defaults toissuerId.RevenueHandlerpasses the authenticated user (req.user.id) asreportedByon both submit routes.createcall still gets the transactionclient.Separately,
revenueService.tsusedisPositiveDecimalAmountwithout importing it, so 12 revenue tests were already failing onmaster. I added the one-line import so CI can go green.Tests
revenueService.test.ts:issuer_idandreported_byreportedByis used when providedissuer_id/reported_bymasterand pass here.revenueHandler.test.ts: the expected service args now includereportedBy.npx jest src/services/revenueService.test.ts src/handlers/revenueHandler.test.ts: 42/42 passing.tsc --noEmitandeslintreport nothing for the changed files.