Case · Insurance

HDI modernizes its collections on fifteen years of legacy

Emerald took over a project that would not get off the ground, held it up for fifteen months and then rebuilt it from scratch.

  • From 2 hours to seconds

    reconciling a special account

  • 80,000 receipts

    posted in 20 minutes, without blocking the operation

  • 29 special accounts

    configured in production, each with its own file format

The starting point

The core of HDI's receipt query was written in 2008. Between 2009 and 2016 it collected 36 modifications signed by eight different in-house developers. By 2016 their own developers were adding indexes to keep it standing.

A replacement was built on top of that foundation and never made it into operation. That is the project we took over in February 2024.

The mission

Give HDI's collections operation a system that holds up at its own scale.

Fifteen months holding up the unsustainable

The brief was to stabilize. The handover was a set of presentations; the repositories arrived a week later and would not run. Database objects were missing and the code called tables that did not exist.

For the first months there was almost no new code: it was reverse engineering, chasing access permissions and sessions where HDI walked us through modules that were not even visible in the system. What broke the deadlock was dropping the full scope and building the minimum, so we could put the state of the project in front of everyone.

Then came the war room: three months working on site at HDI headquarters. It was the most productive stretch of the project.

Fifteen months in, the heaviest modules — special accounts and payroll deduction — still had not reached a user test.

Stop reinventing

The legacy receipt query was 1,118 lines of SQL assembled at run time: the filter was serialized to XML, travelled to the server, was taken apart there and concatenated into text variables. Impossible to index, because the query did not exist until it ran.

HDI had solved that back in 2008, in the stored procedure their own developers had spent fifteen years tuning.

We didn't build a faster query. We stopped reinventing the one that already existed.

Twelve months to rebuild it

Rebuilding was proposed in the first months. The proposal was dropped then and came back to the table a year later, once it was clear that stabilizing led nowhere.

In June 2025 we started over, with something we did not have at the beginning: the infrastructure already deployed, the domain knowledge and the list of what not to repeat. First a base template with what we knew would be needed — data access, email, notifications, errors with traceability — then the modules, starting with the ones carrying the least business logic.

Fifteen months of rescue were not enough to test the most complex modules. Twelve months of rebuilding put them in production, across five deliverables.

What changed in the operation

  • Reconciling a special account

    The analyst received the client's file and checked it receipt by receipt, adding up by hand. In user testing, one analyst spent two hours on a single account. Today she uploads the file and the system returns it in seconds, with the discrepancies flagged and the totals calculated.

  • Posting receipts in bulk

    Posting some 80,000 receipts took over an hour and locked the table: the rest of the operation waited. Today it takes 10 to 20 minutes and nobody stops.

  • Collecting a premium with no reference

    The agent would call or email a photo of the payment slip, and control lived in email inboxes; resolving it took anywhere from hours to two days. Today the agent files the request from the portal with the slip attached and it is resolved the same day.

  • The scale

    29 special accounts configured in production, each with its own file structure. A portal open to a roster of 33,720 agents. Around 50 analysts and coordinators working inside the system every day.

How we worked

Three months of on-site war room at headquarters. A database standard written down and codified, with 339 versioned stored procedures and the execution plan of each one captured and kept.

And tools nobody asked for: we built an internal utility that checks every delivery against HDI's standard before it ships, and that rebuilds the test environment in minutes where it used to cost two days.

Today

Cobranza 360 runs at HDI with their own team. We built it, stabilized it and handed over a system their people keep running.

Let's talk — 30 minutes