Problem Description
Several key API handlers in backend/src/api.rs contain placeholder comments indicating missing database logic:
- Line 517:
// Contributors: Implement saving plan to database, set default fields, and run in a transaction
- Line 737:
// Contributors: Implement plan update with beneficiary allocation_bps validation
- Line 970:
// Contributors: Implement plan retrieval, filtering by owner, and apply on-the-fly yield accumulation
- Line 1169:
// Contributors: Implement resetting last_ping timestamp and calculating accrued yield up to the ping time
- Line 1270:
// Contributors: Implement calculating final payout with yield, parsing fiat payout details, submitting fiat payouts to AnchorRegistry...
Missing Functionality & Specs
- create_plan: Complete atomic DB insertion for
plans and associated beneficiaries rows inside a SQL transaction.
- update_plan: Add strict validation checking that
allocation_bps across updated beneficiaries equals 10,000 bps before updating DB.
- get_plans: Calculate dynamic, on-the-fly yield accumulation using
yield_calculator and join beneficiary records.
- ping_plan: Update
last_ping timestamp, recalculate inactivity_deadline_at, update accrued yield, and log ping audit record.
- trigger_payout: Submit off-ramp requests to
AnchorRegistry for fiat payouts, emit webhooks, and transition plan status to SETTLED.
Affected Files
Problem Description
Several key API handlers in
backend/src/api.rscontain placeholder comments indicating missing database logic:// Contributors: Implement saving plan to database, set default fields, and run in a transaction// Contributors: Implement plan update with beneficiary allocation_bps validation// Contributors: Implement plan retrieval, filtering by owner, and apply on-the-fly yield accumulation// Contributors: Implement resetting last_ping timestamp and calculating accrued yield up to the ping time// Contributors: Implement calculating final payout with yield, parsing fiat payout details, submitting fiat payouts to AnchorRegistry...Missing Functionality & Specs
plansand associatedbeneficiariesrows inside a SQL transaction.allocation_bpsacross updated beneficiaries equals 10,000 bps before updating DB.yield_calculatorand join beneficiary records.last_pingtimestamp, recalculateinactivity_deadline_at, update accrued yield, and log ping audit record.AnchorRegistryfor fiat payouts, emit webhooks, and transition plan status toSETTLED.Affected Files
backend/src/api.rs