Skip to content

feat: add Bill of Exchange template and update dependencies - #9

Closed
manishdex25 wants to merge 7 commits into
masterfrom
feature/boe-v2
Closed

feat: add Bill of Exchange template and update dependencies#9
manishdex25 wants to merge 7 commits into
masterfrom
feature/boe-v2

Conversation

@manishdex25

@manishdex25 manishdex25 commented Aug 3, 2026

Copy link
Copy Markdown
  • Introduced a new Bill of Exchange template in the decentralized renderer.
  • Updated the @trustvc/trustvc package to version 2.16.0-beta.1.
  • Added new dependencies and updated existing ones in package-lock.json.
  • Enhanced the document template resolution to include the new Bill of Exchange template.

Summary

What is the background of this pull request?

Changes

  • What are the changes made in this pull request?
  • Change this and that, etc...

Issues

What are the related issues or stories?

Summary by CodeRabbit

  • New Features

    • Added a bill-of-exchange document template with formatted dates, amounts, party details, signatures, and credential information.
    • Added signature validation and support for displaying modern W3C Data Integrity Proof credentials.
    • Registered the template for documents identified as BILL_OF_EXCHANGE.
  • Bug Fixes

    • Fixed transcript sections appearing when no transcript data was available.
  • Tests

    • Added coverage confirming eligible credentials use the correct bill-of-exchange template.

* Introduced a new Bill of Exchange template in the decentralized renderer.
* Updated the @trustvc/trustvc package to version 2.16.0-beta.1.
* Added new dependencies and updated existing ones in package-lock.json.
* Enhanced the document template resolution to include the new Bill of Exchange template.
@manishdex25 manishdex25 self-assigned this Aug 3, 2026
@manishdex25
manishdex25 requested a review from RishabhS7 August 3, 2026 09:35
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@manishdex25, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 32c595f6-0733-4eb3-b89a-947a65680104

📥 Commits

Reviewing files that changed from the base of the PR and between fe87ea9 and 79fea14.

📒 Files selected for processing (1)
  • example/decentralized-renderer/templates/billOfExchange/template.tsx
📝 Walkthrough

Walkthrough

The pull request adds a typed bill-of-exchange React template, registers it under BILL_OF_EXCHANGE, updates the TrustVC dependency, fixes empty transcript rendering, and tests credential-based template resolution.

Changes

Bill of Exchange Template

Layer / File(s) Summary
Bill-of-exchange template rendering
example/decentralized-renderer/templates/billOfExchange/template.tsx
Adds typed document and party models, normalization, formatting helpers, reusable cells, signature validation, and the styled document layout.
Template registry integration
example/decentralized-renderer/templates/billOfExchange/index.tsx, example/decentralized-renderer/templates/index.tsx, package.json
Exports and registers the bill-of-exchange template under BILL_OF_EXCHANGE and fixes @trustvc/trustvc at 2.16.0-beta.1.
Template resolution validation
src/utils.test.tsx
Tests resolution of a modern W3C Data Integrity Proof credential to the registered custom template.
Transcript rendering condition
example/decentralized-renderer/templates/govtechDemoCert/transcript.tsx
Renders the transcript section only when transcriptData contains items.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant VC as W3C Data Integrity Proof VC
  participant Resolver as documentTemplates
  participant Registry as Template registry
  participant Template as Bill-of-exchange Template

  VC->>Resolver: Provide BILL_OF_EXCHANGE render method
  Resolver->>Registry: Find registered template
  Registry-->>Resolver: Return BillOfExchange template
  Resolver->>Template: Resolve custom template
  Template-->>Resolver: Return rendered bill of exchange
Loading

Possibly related PRs

Suggested reviewers: rongquan1

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description lists the main changes but leaves the required Summary, Changes, and Issues sections as template placeholders. Replace the placeholder text with the pull request background, a detailed change list, and related issue or story references.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the new Bill of Exchange template and dependency update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/boe-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@manishdex25
manishdex25 requested review from rongquan1 and removed request for RishabhS7 August 3, 2026 09:35

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@example/decentralized-renderer/templates/billOfExchange/template.tsx`:
- Around line 139-144: Update the signature rendering in the bill-of-exchange
template so the credential-controlled signature value is never used directly as
an image URL. Render only validated inline image data, or pass approved remote
images through the existing trusted proxy/allow-list mechanism before assigning
the result to the img src.
- Around line 39-44: Update formatAmountInFigures so invalid or non-finite
amountInFigures values are not converted to zero; format only finite canonical
numeric values, and otherwise preserve the supplied value or use the template’s
validation-error behavior. Keep currency-only and valid amount formatting
unchanged.

In `@src/utils.test.tsx`:
- Around line 203-206: The test currently validates a duplicated local fixture
instead of the production template registry. Update the test around
templateRegistry to import and exercise the registry from the production
templates index, then assert that BILL_OF_EXCHANGE resolves to its registered
Bill of Exchange component; remove the duplicate local mapping.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d8650fa-f4b0-43cb-b2a0-096453df5219

📥 Commits

Reviewing files that changed from the base of the PR and between 5ae6d2d and c3a6a92.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • example/decentralized-renderer/templates/billOfExchange/index.tsx
  • example/decentralized-renderer/templates/billOfExchange/template.tsx
  • example/decentralized-renderer/templates/index.tsx
  • package.json
  • src/utils.test.tsx

Comment thread example/decentralized-renderer/templates/billOfExchange/template.tsx Outdated
Comment thread src/utils.test.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@example/decentralized-renderer/templates/billOfExchange/template.tsx`:
- Around line 41-46: Update the amount formatting logic near numericAmount so it
preserves the exact supplied decimal string without converting through Number or
IEEE 754 floating point. Format integer grouping and fractional digits directly,
or use an arbitrary-precision decimal formatter, while retaining the existing
fallback for invalid or empty values and the currencyCode/amount output
contract.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f1ad817d-a65a-40c9-a8e4-7a43e3e18869

📥 Commits

Reviewing files that changed from the base of the PR and between c3a6a92 and 20c96cf.

📒 Files selected for processing (2)
  • example/decentralized-renderer/templates/billOfExchange/template.tsx
  • src/utils.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/utils.test.tsx

Comment thread example/decentralized-renderer/templates/billOfExchange/template.tsx Outdated
manishdex25 and others added 2 commits August 3, 2026 18:01
…te.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@manishdex25 manishdex25 closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant