⚖️

# P2P Dispute Resolution

Manage peer-to-peer trading disputes

## 🎯 Dispute Overview

The P2P dispute system handles conflicts between trading parties when trades encounter issues. Each dispute includes basic information about the trade, involved parties, reason for dispute, priority level, and resolution tracking. The system provides a structured approach to conflict resolution with evidence collection and administrative oversight.

## 🏗️ Dispute Structure

### Core Dispute Information

#### Dispute Identifiers

Dispute ID UUID primary key for the dispute
Trade ID Link to the disputed P2P trade
Amount Disputed amount (string field)

#### Involved Parties

Reported By ID UUID of user who filed the dispute
Against ID UUID of user the dispute is against
Filed On Date when dispute was created

### Dispute Details

#### Issue Description

Reason Primary reason for the dispute (text field, required)
Details Additional details about the issue (text field, optional)

#### Classification

Priority HIGH, MEDIUM, or LOW priority level
Status PENDING, IN_PROGRESS, or RESOLVED

### Resolution and Evidence Management

#### Resolution Tracking

Resolution JSON object with resolution details (optional)
Resolved On Timestamp of dispute resolution (optional)

#### Evidence and Communication

Messages JSON array of dispute communications (optional)
Evidence JSON object storing evidence files and data (optional)

## 📊 Dispute Status System

### Available Status Types

⏳

#### PENDING

Dispute filed, awaiting initial review

🔄

#### IN_PROGRESS

Under active investigation and mediation

✅

#### RESOLVED

Dispute concluded with final resolution

## 🚨 Priority Levels

### Dispute Priority Classification

🔴

#### HIGH

Urgent issues requiring immediate attention

Large amounts, fraud suspicion, urgent timeouts
🟡

#### MEDIUM

Standard disputes with moderate complexity

Payment delays, communication issues, minor disputes
🟢

#### LOW

Minor issues with simple resolution

Information requests, clarifications, minor concerns

## 🔄 Dispute Lifecycle

### Typical Resolution Process

1

#### Dispute Filing (PENDING)

User files a dispute with reason, details, and priority assignment. The dispute is linked to the specific trade and parties involved.

Dispute created with PENDING status, awaiting admin review
2

#### Investigation Phase (IN_PROGRESS)

Admin reviews the dispute, collects evidence, and facilitates communication between parties through the messages system.

Status updated to IN_PROGRESS with evidence collection and messaging
3

#### Resolution (RESOLVED)

Final decision made and recorded in resolution field, with timestamp marking completion of the dispute process.

Status set to RESOLVED with resolution details and completion timestamp

## 📋 Evidence and Communication

### Messages (JSON)

The messages field stores communication history during dispute resolution:

[
{
"timestamp": "2024-01-15T10:30:00Z",
"from": "admin",
"message": "Please provide payment proof",
"type": "request"
}
]

- • Chronological message tracking
- • Multi-party communication support
- • Message type categorization
- • Audit trail for resolution process

### Evidence (JSON)

The evidence field stores supporting documentation and files:

{
"files": [
{
"name": "payment_receipt.jpg",
"url": "/uploads/evidence/...",
"type": "image"
}
],
"notes": "Additional context..."
}

- • File attachment support
- • Evidence categorization
- • Admin notes and context
- • Structured evidence organization

## 🎯 Resolution Management

### Resolution Structure (JSON)

The resolution field stores the final decision and outcome details:

{
"decision": "favor_buyer",
"reasoning": "Payment proof confirmed, seller failed to release",
"actions": [
"release_funds_to_buyer",
"warning_to_seller"
],
"compensation": {
"amount": "0.1",
"currency": "BTC",
"recipient": "buyer"
}
}

#### Resolution Components

- • Decision: Final ruling on the dispute
- • Reasoning: Explanation of the decision
- • Actions: Steps taken to resolve the issue
- • Compensation: Financial adjustments if applicable

#### Resolution Tracking

- • Resolved timestamp recording
- • Decision audit trail
- • Action item completion
- • Outcome validation

## ⚙️ Administrative Management

### Admin Operations

#### Dispute Management

- • View all active and resolved disputes
- • Filter by status, priority, date range
- • Review dispute details and evidence
- • Monitor dispute progression timelines
- • Track resolution outcomes and patterns

#### Resolution Actions

- • Review and update dispute status
- • Facilitate communication between parties
- • Collect and organize evidence
- • Make resolution decisions
- • Document outcomes and reasoning

## 🔗 Database Associations

### Dispute Relationships

#### Core Relationships

- • Trade: One-to-one relationship with P2P trade
- • Reporter: User who filed the dispute
- • Against: User the dispute is filed against
- • Cascading: Delete on trade/user removal

#### Data Integrity

- • UUID validation for all foreign keys
- • Required fields enforced at database level
- • Enum validation for status and priority
- • Automatic timestamp management

## 💡 Best Practices

### Dispute Handling

- • Prioritize high-priority disputes for immediate review
- • Collect comprehensive evidence before making decisions
- • Maintain clear communication with all parties
- • Document reasoning for all resolution decisions
- • Follow consistent resolution procedures

### Administrative Guidelines

- • Update dispute status promptly as cases progress
- • Use structured JSON for evidence and messages
- • Maintain detailed resolution records
- • Monitor dispute trends and patterns
- • Ensure fair and impartial resolution process