Skip to content

feat: implement pdf report generation - #1023

Merged
ONEONUORA merged 2 commits into
Fracverse:masterfrom
Stanley-Owoh:implement-pdf-report-generation-941
Jul 31, 2026
Merged

feat: implement pdf report generation#1023
ONEONUORA merged 2 commits into
Fracverse:masterfrom
Stanley-Owoh:implement-pdf-report-generation-941

Conversation

@Stanley-Owoh

Copy link
Copy Markdown
Contributor

Summary

Completes the PDF report generation logic for GET /api/plans/{id}/report. The report now includes dedicated Assets, Yield Details, and Beneficiaries sections with real-time projected yield computation.

Changes

backend/src/pdf.rs

  • Added projected_accrued_yield field to PlanReportData
  • Restructured the report into four clear sections:
    • Plan Details — plan ID, owner, status, grace period, created date
    • Assets — token address and locked amount
    • Yield Details — earn yield flag, yield rate (bps + APY%), snapshotted accrued yield, and real-time projected yield
    • Beneficiaries — wallet address, allocation (bps + %), fiat anchor info
  • Moved token_address and amount from Plan Details into the new Assets section
  • Moved yield fields from Plan Details into the new Yield Details section

backend/src/api.rs

  • Added compute_projected_accrued_yield(&plan) call before building the PDF data to calculate real-time accrued yield since the last ping
  • Passes the projected yield as projected_accrued_yield into PlanReportData
  • Renumbered handler step comments for clarity

Testing

  • cargo check passes with no warnings
  • PDF generation runs on a blocking thread via tokio::task::spawn_blocking as before

Closes #941

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@Stanley-Owoh Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@ONEONUORA

Copy link
Copy Markdown
Contributor

@Stanley-Owoh
Run cargo fmt --all -- --check and clippy

@ONEONUORA

Copy link
Copy Markdown
Contributor

@Stanley-Owoh
Update on this PR

@Stanley-Owoh
Stanley-Owoh force-pushed the implement-pdf-report-generation-941 branch from 4791e20 to 9fa1bf0 Compare July 30, 2026 22:08
@Stanley-Owoh
Stanley-Owoh force-pushed the implement-pdf-report-generation-941 branch from 8559de7 to 824f226 Compare July 30, 2026 22:18
@Stanley-Owoh

Copy link
Copy Markdown
Contributor Author

@ONEONUORA Good day maintainer, please review my pr, All checks has passed. Thank you

@ONEONUORA ONEONUORA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great job @Stanley-Owoh

@ONEONUORA
ONEONUORA merged commit 269322d into Fracverse:master Jul 31, 2026
4 checks passed
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.

[Backend] Issue #32: Implement PDF Report Generation in pdf.rs

2 participants