Skip to content

Implement Dispute Management with Evidence Upload and Admin Resolution #334

@llinsss

Description

@llinsss

Problem

Users have no way to dispute transactions or report issues. Need formal dispute system with evidence submission and admin resolution workflow.

Proposed Solution

Build dispute management system with status tracking, evidence upload, and admin dashboard for resolution.

Technical Implementation

New Files:

  • backend/services/DisputeService.js - Dispute service
  • backend/models/Dispute.js - Dispute model
  • backend/models/DisputeEvidence.js - Evidence model
  • backend/models/DisputeMessage.js - Dispute messages
  • backend/controllers/disputeController.js - Dispute endpoints
  • backend/routes/disputes.js - Dispute routes
  • backend/migrations/20260327000020_create_disputes.js - Migration
  • backend/migrations/20260327000021_create_dispute_evidence.js - Migration
  • backend/migrations/20260327000022_create_dispute_messages.js - Migration
  • backend/workers/disputeNotification.js - Notification worker
  • backend/tests/dispute.test.js - Test suite

Modify:

  • backend/models/Transaction.js - Add dispute_id field
  • backend/services/NotificationService.js - Add dispute notifications
  • backend/controllers/adminController.js - Add dispute management

Dispute Types

const DISPUTE_TYPES = {
  UNAUTHORIZED: 'Unauthorized transaction',
  WRONG_AMOUNT: 'Wrong amount received',
  NOT_RECEIVED: 'Payment not received',
  DUPLICATE: 'Duplicate transaction',
  FRAUD: 'Fraudulent activity',
  OTHER: 'Other issue'
};

const DISPUTE_STATUS = {
  OPEN: 'open',
  UNDER_REVIEW: 'under_review',
  AWAITING_RESPONSE: 'awaiting_response',
  RESOLVED: 'resolved',
  CLOSED: 'closed'
};

API Endpoints

POST /api/disputes
Body: {
  transactionId: "txn_123",
  type: "NOT_RECEIVED",
  description: "Payment not received after 24 hours",
  evidence: ["file1.jpg", "file2.pdf"]
}

GET /api/disputes/:id
POST /api/disputes/:id/messages
POST /api/disputes/:id/evidence
PATCH /api/disputes/:id/resolve

Acceptance Criteria

  • Dispute creation with transaction linking
  • Evidence upload (images, PDFs, up to 10MB)
  • Message thread between user and admin
  • Status tracking and notifications
  • Admin resolution workflow
  • Automatic closure after 30 days of inactivity
  • Dispute analytics dashboard
  • Test coverage > 85%

Priority

High - Important for user trust and support


Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions