# Dispute Desk

**dispute-desk.infinity-sdg.com** — card dispute and chargeback management for issuers, where AI assembles the evidence and drafts the response, and analysts make the calls.

```
account → charge → dispute (received, respond-by deadline)
  → triage: analyst sets the network reason code
  → evidence: cardholder statement, receipts, tracking, device data — verified by an analyst
  → AI drafts the chargeback narrative → analyst accepts, edits or rejects it
  → file chargeback (before the deadline)   ·   or deny, with the reason the cardholder is told
  → merchant accepts → won
    merchant represents → accept (lost) or pre-arbitration → won / lost
  → lost: rebill the cardholder, or write off — approved by a second lead
nightly: open disputes past their respond-by date expire, visibly
```

## What it enforces

| Rule | Why |
|---|---|
| No chargeback after the respond-by date | A late filing loses before it starts, so the system refuses it |
| Every chargeback rests on verified evidence | Analysts sign off on what the AI gathered |
| No filing while an AI draft is unreviewed, and none without an accepted or edited draft | The AI writes; a person decides what goes to the network |
| Fraud chargebacks need the cardholder's own statement | The core document for a fraud claim |
| Only lost disputes can be written off, and whoever requests a write-off can't approve it | Four-eyes control on absorbed losses |
| A dispute is written off only under an approved write-off | Every absorbed loss traces to an approval |
| Denials, lost outcomes and rejected write-offs all carry a written reason | Cardholders and auditors can see why |
| Open disputes that miss their deadline expire nightly | A missed deadline shows up on a report, not in a write-off later |

Every resource is audited. Disputes keep a readable history from intake to resolution. Only the last four digits of a card are stored.

## Resources, views, roles

- **Resources:** merchant, account, charge, dispute, evidence, draft (AI), writeoff
- **Views:**
  - `deadlineBoard`, with a due-within-7-days flag
  - `aiDraftsToReview`
  - `writeoffApprovals`
- **Roles:**
  - `agent`: intake, withdrawals
  - `analyst`: triage, evidence, reviewing AI drafts, filing, denials
  - `lead`: pre-arbitration, write-off approvals
  - `admin`

## Demo data

The demo has 12 merchants, 14 cardholder accounts and 27 disputes, using real Visa reason codes: 10.4 fraud (card absent), 13.1 not received, 13.3 not as described, 12.6 duplicate, 13.2 cancelled recurring, 12.5 incorrect amount. Every state is covered:

- 7 won, 2 of them at pre-arbitration
- 6 lost and written off under a second lead's approval
- 2 lost and rebilled after a lead refused the write-off
- 2 lost with write-offs awaiting approval
- 2 denied, one because the merchant had already refunded
- 2 filed and waiting on the merchant
- 2 with AI drafts waiting for an analyst
- 2 newly received
- 1 withdrawn
- 1 expired past its deadline

Of 26 AI drafts, analysts accepted 13, edited 6 and rejected 5. Two drafts are still waiting.

Every human decision in the seed is made by the demo user who would make it (`analyst1`, `analyst2`, `lead1`, `lead2`), with that user's own roles. That needs Kalos seeder 1.2.0 or later (`privileges: user`).

All merchants and cardholders are invented. To regenerate the data, run `python3 seeds/gen_seed.py`.

## Run it

```bash
scripts/kalos.sh validate    # static checks
scripts/kalos.sh start       # kalosd on :9217
scripts/kalos.sh verify      # live checks
```

By default, `KALOS_REPO` is `../kalos`.

Sign in with `admin` / `Admin123!`. The other users are `agent1`, `analyst1`, `analyst2`, `lead1` and `lead2`, all with password `Demo123!`.

## Reselling

This is an original ISDG product for card issuers, fintechs and banking-as-a-service programs. It has no cardholder data and no third-party branding. Network rules and timeframes vary by network and dispute type; a real deployment configures them per program.
