Case study · Fintech · Collections

Debtor.io

A collections tool for a consumer-lending business. It reads the loan book and picks the next step for each overdue loan. Agents act on it. After a person approves, it can also send messages by itself.

role
Designed and built it
status
In production · internal
stack
Laravel 13 · PHP 8.4 · Filament 5 · Postgres
## what it does

What it does

  • strategies/

    Strategy editor

    The operations team sets the steps for each stage of arrears. They do not need a developer.

  • segments/

    Segments

    Loans are grouped by stage and risk. Each group gets its own treatment.

  • plans/

    Payment plans

    Agents set up repayment plans that fit what the borrower can pay.

  • queue/

    Call queue

    Agents see which call to make next and why.

  • sends/

    Email, SMS and send log

    Every message is recorded. Each one is sent only once.

  • auto/

    Automatic sendingnew · Oct 2026

    After a person approves a step, the system sends by itself. One switch stops all sending.

## a loan’s journey

How a loan moves through the system

  1. 01Loan bookRead-only, behind a guard.
  2. 02SegmentStage and risk decide the group.
  3. 03StrategyPicks the next step.
  4. 04ApprovalA person signs off.
  5. 05Send onceEmail, SMS or call.
  6. 06LogEvery action auditable.
## rules.md

Rules the system follows

Collections deal with people in financial difficulty and with their personal data. These rules are written at the top of the project's documentation.

  • 01
    The loan book is read-only.Every query passes a check that blocks changes.
  • 02
    Personal data stays in memory.It is never written to logs or caches.
  • 03
    A message is never resent.Each message is sent once and recorded.
  • 04
    No secrets in the code.Passwords and keys stay out of the repository.
## gate.sh

A change is finished when every check passes

This applies to code written by people and by AI agents. The limits can only become stricter over time.

$ bash dev/gate.sh --full
✓ larastanlevel 5
✓ complexity≤ 15 / method
✓ duplication≤ 1.2%
✓ coverage≥ 80% changed lines
✓ mutation≥ 70%