Skip to content

feat: integrate frontend plans with live API - #1049

Merged
ONEONUORA merged 4 commits into
Fracverse:masterfrom
JoyLight00:feature/frontend-live-backend-api
Aug 23, 2026
Merged

feat: integrate frontend plans with live API#1049
ONEONUORA merged 4 commits into
Fracverse:masterfrom
JoyLight00:feature/frontend-live-backend-api

Conversation

@JoyLight00

Copy link
Copy Markdown
Contributor

Summary

Replaces direct localStorage mock-store usage in the frontend plan and KYC workflows with live backend API integration.

Changes

  • Added centralized mock/live data selection through NEXT_PUBLIC_USE_MOCK_DATA.
  • Live API mode is now the default.
  • Replaced direct mock-store reads in:
    • Asset-owner overview
    • Plans list
    • Plan detail
    • Plan editing
    • Plan creation
    • Claim search
    • KYC status handling
  • Added loading cancellation and user-facing API error states.
  • Added optional automatic revalidation support to useApiQuery.
  • Normalized raw Axum API responses for plan list and detail endpoints.
  • Added wallet-address support to GET /api/kyc/status.
  • Updated KYC submission payloads to match the backend’s snake_case DTO.
  • Added the missing backend GET /api/plans/{id} route.
  • Preserved local demo behavior when NEXT_PUBLIC_USE_MOCK_DATA=true.

Configuration

NEXT_PUBLIC_USE_MOCK_DATA=false
NEXT_PUBLIC_API_URL=http://localhost:8080

Set NEXT_PUBLIC_USE_MOCK_DATA=true to use the local demo store.

Validation

  • git diff --check passed.
  • Frontend tests and TypeScript validation were not runnable because frontend dependencies are not installed and the repository lockfile is missing the workspace entry.
  • Backend compilation was not runnable because cargo is unavailable in the container.

Closes #1032

@ONEONUORA

Copy link
Copy Markdown
Contributor

@JoyLight00
Pls make your implementation to pass CI checks

Comment thread frontend/app/asset-owner/plans/claim/page.tsx Fixed
@JoyLight00

Copy link
Copy Markdown
Contributor Author

@JoyLight00 Pls make your implementation to pass CI checks

Done Boss

@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 @JoyLight00

@ONEONUORA
ONEONUORA merged commit 7d850e6 into Fracverse:master Aug 23, 2026
4 checks passed
anonfedora added a commit to anonfedora/InheritX that referenced this pull request Aug 23, 2026
…ate plan update call

Rebased fix/beneficiary-allocation-validation-1031 onto upstream/master
to pick up Fracverse#1049 (wire frontend plans to the live API) and Fracverse#1052
(wallet-signed pings), which landed after this branch was created.

Fracverse#1049 changed EditPlanPage.handleSaved to persist the panel's callback
value via plansAPI.updatePlan(planId, updated) a second time, passing
the full Plan object as if it were an UpdatePlanRequest. That no longer
type-checks now that UpdatePlanRequest is a proper DTO, and it was
always redundant: EditInheritancePlanPanel already calls
plansAPI.updatePlan itself and hands the backend-confirmed plan back
via onSaved. The page now just syncs local state with that result.
ONEONUORA pushed a commit that referenced this pull request Aug 24, 2026
…alidation (#1053)

* fix(frontend): map full beneficiary list and enforce bps allocation validation

CreateInheritancePlanPanel and EditInheritancePlanPanel only transmitted
beneficiaries[0]?.name to the backend, silently dropping every other
beneficiary's wallet address, allocation, and fiat off-ramp config.
Separately, plansAPI.createPlan/updatePlan sent a request shape (title,
fee, net_amount, bank_account_number, two_fa_code, ...) that never
matched the real backend's Plan/UpdatePlanRequest contract at all.

- plans.ts / inheritance.ts: CreatePlanRequest/UpdatePlanRequest now
  mirror the backend's actual Plan/UpdatePlanRequest structs (owner,
  token, amount, beneficiaries: PlanBeneficiaryRequest[], grace_period,
  earn_yield, yield_rate_bps); added the missing updatePlan() to
  inheritance.ts.
- New BeneficiaryAllocationRow component centralizes beneficiary row UI,
  strict basis-point validation (must total exactly 10,000 bps), Stellar
  StrKey address validation, duplicate-address detection, and fiat
  anchor/daily-limit encoding shared by both panels.
- Both panels now build and submit the full beneficiary list, surface
  clear per-field and total-allocation error messages, and correctly
  round-trip the backend's PlanResponse back into the UI.
- Updated MSW mocks/tests to match the corrected contract.

Closes #1031

* fix(frontend): rebase onto upstream live-API integration, drop duplicate plan update call

Rebased fix/beneficiary-allocation-validation-1031 onto upstream/master
to pick up #1049 (wire frontend plans to the live API) and #1052
(wallet-signed pings), which landed after this branch was created.

#1049 changed EditPlanPage.handleSaved to persist the panel's callback
value via plansAPI.updatePlan(planId, updated) a second time, passing
the full Plan object as if it were an UpdatePlanRequest. That no longer
type-checks now that UpdatePlanRequest is a proper DTO, and it was
always redundant: EditInheritancePlanPanel already calls
plansAPI.updatePlan itself and hands the backend-confirmed plan back
via onSaved. The page now just syncs local state with that result.
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.

frontend: Replace LocalStorage Mock Store Fallbacks with Live Backend API Integration

3 participants