Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves frontend ergonomics by adding explicit bill state and caller-specific payment_actions to bill responses, and by standardizing payment status representation (PastPaymentStatus → PaymentStatus) across core/API/WASM/persistence.
Changes:
- Add
BillState(mint/accept/payment) andpayment_actionstoBitcreditBillResultand propagate through persistence + WASM bindings. - Rename
PastPaymentStatustoPaymentStatusand include aRequestedvariant for a unified status model. - Update service/WASM API call signatures to pass caller public data + keys instead of only
NodeId.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/bcr-ebill-wasm/src/data/bill.rs | Exposes new state + payment_actions to TS/WASM and renames payment status web type. |
| crates/bcr-ebill-wasm/src/api/general.rs | Updates calls to pass signer public data + keys into services. |
| crates/bcr-ebill-wasm/src/api/bill.rs | Updates bill endpoints to pass signer public data + keys into bill service calls. |
| crates/bcr-ebill-persistence/src/tests/mod.rs | Adjusts persistence tests to include new state and payment_actions fields. |
| crates/bcr-ebill-persistence/src/db/bill.rs | Adds DB serialization for BillState and new payment-action types/status. |
| crates/bcr-ebill-core/src/protocol/blockchain/bill/mod.rs | Renames PastPaymentStatus to PaymentStatus and adds Requested. |
| crates/bcr-ebill-core/src/protocol/blockchain/bill/chain.rs | Updates chain helpers to return PaymentStatus instead of PastPaymentStatus. |
| crates/bcr-ebill-core/src/application/bill/mod.rs | Adds BillState + payment-action domain types; wires them into BitcreditBillResult. |
| crates/bcr-ebill-api/src/service/search_service.rs | Updates search API to accept caller public data + keys and validate network via caller participant. |
| crates/bcr-ebill-api/src/service/bill_service/tests.rs | Updates tests for new signatures/status types; adds additional chain steps for sell flows. |
| crates/bcr-ebill-api/src/service/bill_service/test_utils.rs | Updates cached bill fixtures to include new state and payment_actions. |
| crates/bcr-ebill-api/src/service/bill_service/service.rs | Changes bill service API signatures to use caller participant + keys; refactors past payments fetching. |
| crates/bcr-ebill-api/src/service/bill_service/mod.rs | Updates BillServiceApi trait signatures accordingly. |
| crates/bcr-ebill-api/src/service/bill_service/issue.rs | Passes drawer public data + keys into recalculation/caching paths. |
| crates/bcr-ebill-api/src/service/bill_service/data_fetching.rs | Computes new BillState and payment_actions; factors out fetch_past_payments. |
| crates/bcr-ebill-api/src/external/bitcoin.rs | Minor refactor from unwrap() to expect() in descriptor generation. |
| Cargo.toml | Bumps workspace version to 0.5.3. |
| CHANGELOG.md | Adds a 0.5.3 entry describing the API/DB changes. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #846 +/- ##
==========================================
- Coverage 70.48% 70.36% -0.12%
==========================================
Files 132 132
Lines 24821 25617 +796
==========================================
+ Hits 17494 18026 +532
- Misses 7327 7591 +264 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
📝 Description
This is an effort to improve the ergonomics of the E-Bill API for the frontend, so API users don't have to calculate on their own, which bill and payment actions there are, or in which state the bill is.
The implementation is mostly non-breaking, because bcr-common and ebill-service also depend on the data models, but unused/deprecated parts of the API will be phased out in a second step, once the new parts are used in the frontend and we know which parts are missing, or which are not used anymore.
payment_actionsPayfor the payers of pay/sell/recourseCheckPaymentfor receivers of pay/sell/recourse and for past paymentsbill_statefor payment and acceptance stateRelates to #682
✅ Checklist
Please ensure the following tasks are completed before requesting a review:
cargo fmt.cargo clippy.🚀 Changes Made
See above.
💡 How to Test
Please provide clear instructions on how reviewers can test your changes:
🤝 Related Issues
List any related issues, pull requests, or discussions:
📋 Review Guidelines
Please focus on the following while reviewing: