Skip to content

Refactor/some issues#86

Merged
JoelVR17 merged 14 commits intodevelopfrom
refactor/some-issues
Mar 13, 2026
Merged

Refactor/some issues#86
JoelVR17 merged 14 commits intodevelopfrom
refactor/some-issues

Conversation

@JoelVR17
Copy link
Contributor

@JoelVR17 JoelVR17 commented Mar 13, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Campaign cards now display loan milestones with status indicators (approved, released, pending).
    • Progress tracking updated to reflect completed loans rather than fundraising ratios.
    • Pool size information now prominently displayed in campaign details.
    • New transaction submission capability for Stellar transactions.
  • Improvements

    • Consolidated HTTP client configuration across applications for consistent API communication.
    • Navigation updated: "Open App" button now directs to campaigns dashboard.
    • Vault information removed from campaign footers; loan details emphasized instead.

@JoelVR17 JoelVR17 self-assigned this Mar 13, 2026
@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
backoffice-tokenization Ready Ready Preview, Comment Mar 13, 2026 8:36pm
investor Ready Ready Preview, Comment Mar 13, 2026 8:36pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 67f922e1-38ce-4202-bf5d-1a5dc903d3ac

📥 Commits

Reviewing files that changed from the base of the PR and between 6d22744 and ab6509d.

⛔ Files ignored due to path filters (3)
  • apps/investor-tokenization/services/wasm/soroban_token_contract.wasm is excluded by !**/*.wasm
  • apps/investor-tokenization/services/wasm/token_sale.wasm is excluded by !**/*.wasm
  • apps/investor-tokenization/services/wasm/vault_contract.wasm is excluded by !**/*.wasm
📒 Files selected for processing (38)
  • apps/backoffice-tokenization/src/components/shared/campaign-card.tsx
  • apps/backoffice-tokenization/src/features/campaigns/components/loans/manage-loans-view.tsx
  • apps/backoffice-tokenization/src/features/campaigns/hooks/use-create-campaign.ts
  • apps/backoffice-tokenization/src/features/campaigns/hooks/useToggleVault.ts
  • apps/backoffice-tokenization/src/features/campaigns/services/campaigns.api.ts
  • apps/backoffice-tokenization/src/features/home/HeroSection.tsx
  • apps/backoffice-tokenization/src/features/tokens/services/token.service.ts
  • apps/backoffice-tokenization/src/features/vaults/deploy/dialog/useEnableVault.ts
  • apps/backoffice-tokenization/src/features/vaults/services/vault.service.ts
  • apps/backoffice-tokenization/src/lib/httpClient.ts
  • apps/core/src/app.module.ts
  • apps/core/src/campaigns/campaigns.controller.ts
  • apps/core/src/campaigns/campaigns.service.ts
  • apps/core/src/helper/dto/send-transaction.dto.ts
  • apps/core/src/helper/helper.controller.ts
  • apps/core/src/helper/helper.module.ts
  • apps/core/src/helper/helper.service.ts
  • apps/core/src/token-sale/token-sale.service.ts
  • apps/core/src/vault/vault.service.ts
  • apps/investor-tokenization/src/app/api/deploy/route.ts
  • apps/investor-tokenization/src/app/api/deploy/vault-contract/route.ts
  • apps/investor-tokenization/src/app/api/helper/send-transaction/route.ts
  • apps/investor-tokenization/src/app/api/token-balance/route.ts
  • apps/investor-tokenization/src/app/api/token-metadata/route.ts
  • apps/investor-tokenization/src/app/api/token-sale/buy/route.ts
  • apps/investor-tokenization/src/app/api/trustline/add/route.ts
  • apps/investor-tokenization/src/app/api/vault-contract/availability-for-exchange/route.ts
  • apps/investor-tokenization/src/app/api/vault-contract/claim/route.ts
  • apps/investor-tokenization/src/app/my-investments/page.tsx
  • apps/investor-tokenization/src/features/investments/services/investment.service.ts
  • apps/investor-tokenization/src/features/roi/components/campaign-card.tsx
  • apps/investor-tokenization/src/features/roi/data/mock-campaigns.ts
  • apps/investor-tokenization/src/features/roi/types/campaign.types.ts
  • apps/investor-tokenization/src/features/tokens/components/InvestDialog.tsx
  • apps/investor-tokenization/src/features/transparency/ProjectCard.tsx
  • apps/investor-tokenization/src/lib/httpClient.ts
  • packages/shared/src/lib/sendTransactionService.ts
  • packages/ui/src/app-sidebar.tsx

📝 Walkthrough

Walkthrough

Migrates HTTP clients to a centralized httpClient, refactors campaign UI to show milestone-based loans (visibleMilestones), adds a Stellar transaction helper module and endpoint, extends campaign status-by-vault flows, removes many investor API routes, and updates Soroban contract call argument usage.

Changes

Cohort / File(s) Summary
Campaign UI & Loans
apps/backoffice-tokenization/src/components/shared/campaign-card.tsx, apps/backoffice-tokenization/src/features/campaigns/components/loans/manage-loans-view.tsx, apps/investor-tokenization/src/features/roi/components/campaign-card.tsx, apps/investor-tokenization/src/features/transparency/ProjectCard.tsx
Reworked milestone handling: compute totals over allMilestones, derive visibleMilestones (slice(1)), compute progress from loansCompleted/totalLoans, add Loans list with status icons, change progress label to "Loans Completed", adjust Pool Size/footer rendering.
HTTP Client Migration & sendTransaction
apps/backoffice-tokenization/src/features/campaigns/services/campaigns.api.ts, apps/backoffice-tokenization/src/features/tokens/services/token.service.ts, apps/backoffice-tokenization/src/features/vaults/services/vault.service.ts, apps/backoffice-tokenization/src/lib/httpClient.ts, apps/investor-tokenization/src/lib/httpClient.ts, packages/shared/src/lib/sendTransactionService.ts, apps/investor-tokenization/src/features/tokens/components/InvestDialog.tsx
Replaced local axios instances with centralized httpClient; baseURL now from NEXT_PUBLIC_CORE_API_URL fallback; SendTransactionService adds optional apiKey option and header assembly.
Campaign Status, Queries & Vault Flows
apps/backoffice-tokenization/src/features/campaigns/hooks/use-create-campaign.ts, apps/backoffice-tokenization/src/features/campaigns/hooks/useToggleVault.ts, apps/backoffice-tokenization/src/features/vaults/deploy/dialog/useEnableVault.ts, apps/core/src/campaigns/campaigns.controller.ts, apps/core/src/campaigns/campaigns.service.ts
Added useQueryClient invalidations for "campaigns"; new PATCH endpoint by-vault/:vaultId/status; added findOneByVaultId and updateStatusByVaultId; expanded CLAIMABLE transitions to include FUNDRAISING; vault enable flows perform best-effort campaign status updates.
Stellar Helper Module (core)
apps/core/src/helper/helper.module.ts, apps/core/src/helper/helper.controller.ts, apps/core/src/helper/helper.service.ts, apps/core/src/helper/dto/send-transaction.dto.ts, apps/core/src/app.module.ts
New HelperModule with POST /helper/send-transaction accepting signedXdr; HelperService.submitTransaction sends XDR to Horizon and returns standardized status/message/hash; module registered in AppModule.
Investor API Route Removals
apps/investor-tokenization/src/app/api/deploy/route.ts, apps/investor-tokenization/src/app/api/deploy/vault-contract/route.ts, apps/investor-tokenization/src/app/api/helper/send-transaction/route.ts, apps/investor-tokenization/src/app/api/token-balance/route.ts, apps/investor-tokenization/src/app/api/token-metadata/route.ts, apps/investor-tokenization/src/app/api/token-sale/buy/route.ts, apps/investor-tokenization/src/app/api/trustline/add/route.ts, apps/investor-tokenization/src/app/api/vault-contract/availability-for-exchange/route.ts, apps/investor-tokenization/src/app/api/vault-contract/claim/route.ts
Deleted numerous Next.js API route handlers related to token/vault deployment, transaction submission, token metadata, token-sale buy, trustline, and vault contract calls.
Data Types & Aggregation
apps/investor-tokenization/src/features/roi/types/campaign.types.ts, apps/investor-tokenization/src/features/investments/services/investment.service.ts, apps/investor-tokenization/src/app/my-investments/page.tsx
Added escrowId: string and poolSize: number to Campaign and API models; toCampaign populates these fields.
Soroban Contract Call Adjustments
apps/core/src/token-sale/token-sale.service.ts, apps/core/src/vault/vault.service.ts
Removed explicit public-contract role string arguments (e.g., 'token-sale', 'vault') from buildContractCallTransaction/readContractState helper calls.
UI / Misc
apps/backoffice-tokenization/src/features/home/HeroSection.tsx, packages/ui/src/app-sidebar.tsx, apps/investor-tokenization/src/features/roi/data/mock-campaigns.ts
HeroSection route changed to /campaigns; Sidebar active-state uses startsWith for non-root paths; removed mockCampaigns fixture.

Sequence Diagram

sequenceDiagram
    participant Client as Client(UI)
    participant VaultUI as Vault Enable UI
    participant Backoffice as Backoffice Service<br/>(httpClient)
    participant CoreAPI as Core API<br/>(HelperController / CampaignsController)
    participant CampaignSvc as CampaignsService
    participant Stellar as Horizon Network

    Client->>VaultUI: trigger enable vault
    VaultUI->>Backoffice: POST /vaults/enable (httpClient)
    Backoffice->>CoreAPI: forward submit /helper/send-transaction (signedXdr)
    CoreAPI->>Stellar: submit transaction XDR
    Stellar-->>CoreAPI: TX hash + status
    CoreAPI-->>Backoffice: response (status/hash)
    Backoffice->>CoreAPI: PATCH /campaigns/by-vault/:vaultId/status (CLAIMABLE)
    CoreAPI->>CampaignSvc: updateStatusByVaultId(vaultId, CLAIMABLE)
    CampaignSvc-->>CoreAPI: updated campaign
    CoreAPI-->>VaultUI: 200 OK
    VaultUI->>Client: show success toast + invalidate "campaigns" cache
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly Related PRs

Suggested Reviewers

  • armandocodecr
  • zkCaleb-dev

Poem

🐰 Hopping through commits with a curious nose,

Loans bloom from milestones where the data flows,
Central clients hum and Stellar sends the night,
Vaults whisper statuses, queries bounce back light,
I nibble a carrot and celebrate the code's new pose.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/some-issues
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

miguelnietoa and others added 2 commits March 13, 2026 15:34
refactor: remove trustline module and USDC trustline setup from investment flow
@JoelVR17 JoelVR17 merged commit 9961728 into develop Mar 13, 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.

2 participants