fix(exports): drop misleading USD Equivalent column from donation CSVs#29
Merged
Alqku merged 1 commit intoJun 20, 2026
Conversation
The 'USD Equivalent' column was hardcoded to 0.00 (later renamed to N/A with a pending label) across three independent export paths. Downstream consumers — tax tools, accounting software, and partner integrations — could silently trust an incorrect value (issue OrbitChainLabs#15). Changes: - Add src/common/csv-export.helper.ts: shared buildDonationCsv() utility that owns the CSV schema; USD Equivalent column is intentionally absent until a price oracle is wired up. - Refactor all three export locations to use the shared helper: src/users/users.service.ts (sync export path) src/users/export.processor.ts (async Bull-queue path) src/donations/donations.service.ts (admin export path) - Add comprehensive unit tests (24 tests, all passing): src/common/csv-export.helper.spec.ts src/users/users.service.csv.spec.ts src/users/export.processor.spec.ts - Document the absent column and the path to reinstatement in README.md Closes OrbitChainLabs#15
Contributor
|
@iyanumajekodunmi756 please fix the CI. |
Contributor
|
Solid catch on the misleading USD Equivalent column, and pulling CSV building into a shared helper is a nice bonus. Thanks! |
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.
Summary
Closes #15
The
USD Equivalentcolumn in all donation CSV exports was hardcoded to0.00(later patched toN/Awith a pending label), but the fundamental risk remained: downstream consumers — tax tools, accounting software, and partner integrations — could silently trust an incorrect value.This PR fully resolves the issue with a production-quality fix.
Changes
src/common/csv-export.helper.ts(new)buildDonationCsv(rows)builds the CSV string from typedDonationCsvRowobjects.CSV_HEADERSconstant defines the 5-column schema — USD Equivalent is intentionally absent until a price oracle (Stellar Horizon order-book, CoinGecko, or self-hosted) is integrated.src/users/users.service.tsexportUserDonationsAsCSV— inline CSV builder replaced withbuildDonationCsv().src/users/export.processor.tshandleDonationExport— inline CSV builder replaced withbuildDonationCsv().src/donations/donations.service.tsexportUserDonationsAsCSV— inline CSV builder replaced withbuildDonationCsv().Unit tests (new, 24 tests — all passing)
src/common/csv-export.helper.spec.tssrc/users/users.service.csv.spec.ts0.00/N/A, empty exportsrc/users/export.processor.spec.tsREADME.mdVerification
npm run buildnpm run test(24 tests)Security note
The column is removed entirely rather than patched with a placeholder. Once a verified price oracle is integrated, it can be reinstated by adding it to
CSV_HEADERSandbuildDonationCsv()in the single shared helper — no hunting across three service files.