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
Priority
High - Important for user trust and support
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 servicebackend/models/Dispute.js- Dispute modelbackend/models/DisputeEvidence.js- Evidence modelbackend/models/DisputeMessage.js- Dispute messagesbackend/controllers/disputeController.js- Dispute endpointsbackend/routes/disputes.js- Dispute routesbackend/migrations/20260327000020_create_disputes.js- Migrationbackend/migrations/20260327000021_create_dispute_evidence.js- Migrationbackend/migrations/20260327000022_create_dispute_messages.js- Migrationbackend/workers/disputeNotification.js- Notification workerbackend/tests/dispute.test.js- Test suiteModify:
backend/models/Transaction.js- Add dispute_id fieldbackend/services/NotificationService.js- Add dispute notificationsbackend/controllers/adminController.js- Add dispute managementDispute Types
API Endpoints
Acceptance Criteria
Priority
High - Important for user trust and support