Skip to content

Dashboard APIs: seller and investor aggregates #12

@Jayrodri088

Description

@Jayrodri088

Context

Sellers need visibility into listings and cash timing; investors need portfolio and exposure views. Dashboard endpoints aggregate Postgres data efficiently for the app UI.

Contributor workflow

  • Apply on Drips before opening a PR: Claim this issue through the Drips platform before you open a pull request. Unsolicited PRs from unassigned contributors may be closed without review.
  • ETA required: Your application must include an ETA for when you will open the first draft PR.
  • Draft PR within 24 hours: If a draft PR is not linked on this issue within 24 hours of assignment, maintainers may unassign you so someone else can take the issue.

Goals

  • GET /api/v1/dashboard/seller — aggregates for the authenticated seller, e.g. counts by invoice status, total funded volume, upcoming due dates (define exact metrics in PR).
  • GET /api/v1/dashboard/investor — aggregates for the authenticated investor, e.g. active investments, expected return sums, upcoming maturities.
  • Use QueryBuilder or SQL with proper indexing awareness; avoid N+1 queries.
  • Respect soft deletes and tenant scoping (user can only see their own data).

Out of scope

  • Real-time websockets (future).
  • On-chain portfolio valuation (future).

Acceptance criteria

  • Both endpoints require auth and never leak other users’ aggregates.
  • Responses use the standard API envelope.
  • Tests with seeded fixtures validate at least one metric calculation.
  • npm run type-check passes; tests pass.

PR submission requirements

  • CI: All GitHub Actions workflow runs for this PR must pass (green) before merge; failing checks block merge.
  • PR description must include: Closes #12.
  • PR lists each returned metric with a one-line definition (how computed).
  • Note any intentional v1 limitations.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementExtends existing product behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions