Skip to content

[Bug][Backend] adminDisputeController & loanController query non-existent 'loans' table #1598

Description

@blurbeast

Issue #10

Database Error: Non-Existent loans Table in Queries

  • Title: [Bug][Backend] adminDisputeController & loanController query non-existent 'loans' table
  • Labels: bug, backend, database, high
  • Location: backend/src/controllers/adminDisputeController.ts:131, backend/src/controllers/loanController.ts:58, 91
  • Description:
    Queries attempt JOIN loans l ON l.id = d.loan_id and SELECT * FROM loans WHERE id = $1. The PostgreSQL schema derives loan state from contract_events and does not have a loans table.
  • Impact:
    Endpoints GET /admin/loan-disputes/:disputeId, POST /api/loans/:loanId/build-cancel, and POST /admin/loans/:loanId/build-reject crash with relation "loans" does not exist.
  • Suggested Fix:
    Update queries to aggregate loan state from contract_events.

Backend Analytics & Logic

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions