stack/getpaid 2 53 accounting updates - #221
Draft
BullishNode wants to merge 3 commits into
Draft
Conversation
…V export A payment has two exact facts and one estimate, never forced to sum: the fiat leg is exact (Bull Bitcoin's execution rate is the only real exchange rate; spread is baked in; the payer pays network fees), while the Bitcoin leg is exact in sats and approximate in fiat at the invoice-creation reference rate. Reference rates exist only for fiat-priced invoices. Rendering extends existing rows in place — no new sections: - "Rate at creation" row (payment details + invoice details), shown only when the server provides the rate AND its face currency (the invoice face currency can differ from a fiat leg's currency) - a muted ≈ sub-line under the L-BTC amount (sats × creation rate, face currency, banker's rounding — single derivation shared with the export) - the settled fiat amount's sub-line shows "executed at <rate>/BTC" in the leg currency, maturing the same slot the pending explainer uses Parser accepts the anticipated contract fields (creation_rate_minor_per_btc + creation_rate_currency on settlement_details and the invoice status; execution_rate_minor_per_btc per fiat leg) with the established discipline: absent means absent UI — bit-identical to today against current servers — and present-but-invalid fails the projection closed. The v3 fixture anticipates the server contract and is replaced byte-identical when the bullnym PR lands. CSV export (local, no server endpoint): a Get Paid export action pages the full history and writes the accounting columns with exactness carried in the column names (estimates suffixed _est, empty when no reference rate); private payer comments are never exported. Reuses the shared save path.
- export: fail closed with a non-retryable incompleteHistory failure on page-cap-with-cursor and repeated-cursor loops instead of silently truncating the CSV as if it were the complete history - export saver: move the shared TransactionExportSaver port + CSV impl to lib/core/export so Get Paid no longer imports a Transactions-internal port - export cubit: guard emits with isClosed after the history walk, the save dialog, and in the exception handler so leaving the route no longer throws - fixture: replace the anticipatory v3 fixture byte-for-byte with the bullnym SatoshiPortal#241 server fixture and drop the _comment - tests: cover the cap/loop-guard failures and the route-disposal cases Review finding #1 (render R2 on pending legs) intentionally not applied: pending legs carry no execution rate in the contract and can reprice, so the existing settled-gating is correct and would regress otherwise. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Stack created with GitHub Stacks CLI • Give Feedback 💬