Skip to content

Back portfolio and disputes endpoints with indexed reads#1812

Open
220nightmore-spec wants to merge 1 commit into
QuickLendX:mainfrom
220nightmore-spec:feature/portfolio-disputes-persistence-1712
Open

Back portfolio and disputes endpoints with indexed reads#1812
220nightmore-spec wants to merge 1 commit into
QuickLendX:mainfrom
220nightmore-spec:feature/portfolio-disputes-persistence-1712

Conversation

@220nightmore-spec

Copy link
Copy Markdown

Closes #1712.

Summary

  • remove the hard-coded MOCK_PORTFOLIO and MOCK_DISPUTES controller arrays
  • derive portfolio entries from indexed bids for the requested investor, joined with indexed/persisted invoices for status mapping
  • read disputes from the derived-table store and keep invoice-id filtering plus cursor pagination
  • add listBids() and listDisputes() to the derived-table store API for in-memory and file-backed stores
  • keep existing response wrappers: { data, next_cursor, has_more }
  • add focused Jest coverage for persistence-backed portfolio derivation, empty investor portfolios, pagination, and dispute filtering

Validation

  • node .\node_modules\jest\bin\jest.js src\tests\portfolio-disputes-persistence.test.ts --runInBand --forceExit
  • git diff --check
  • rg "MOCK_PORTFOLIO|MOCK_DISPUTES" backend/src backend/tests backend/openapi.yaml returned no matches

Notes

  • src/tests/cache-headers.endpoints.test.ts currently fails before assertions because importing app reaches the existing NotificationService / CircuitBreaker is not defined issue.
  • Full tsc --noEmit --pretty false is currently blocked by an existing syntax error in src/index.ts (TS1005 ')' expected / '}' expected).

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: replace MOCK_PORTFOLIO and MOCK_DISPUTES controllers with persistence-backed reads

1 participant