Confidential client · Under NDA

Energy · ETL · Data quality

Contract data reconciliation for an energy retail sales platform

How I traced years of contract imports to the causes of their errors, fixed attribution without losing a record, and explained it to people who are not engineers.

Project facts

My role
Development owner, technical and client-facing
Users
Back office, client management and the development team
Deliverables
Import pipeline fixes, a log analysis workbook, a client report
Stack
Python, SQL, batch ETL, Excel reporting

What this page shares

  • The sector, scale and the type of users involved
  • My role, the stack and why it was chosen
  • A conceptual architecture drawn by me
  • The decisions I made and the alternatives I rejected
  • Results as ranges, directions or mechanisms

What stays private

  • The client's name, brand and country list
  • Screens, UI, internal system names and URLs
  • Any personal data about users, customers or patients
  • Internal documents, exact volumes and revenue figures
  • Source code, schemas and configuration

Context and problem

The platform imports contract data from an energy supplier as CSV files. Over time some contracts were credited to the wrong agent, because the same agent appeared under duplicate codes. Import failures were spread across years of logs with no single view.

Attribution decides which agent gets credit for a contract, so the fix had to be exact, and the explanation had to make sense to managers who are not technical.

Constraints

Supplier file format
Semicolon-delimited CSV with a UTF-8 byte order mark, which default parsers misread.
No data loss
Re-attribution had to keep every contract and its history.
Two audiences
Developers needed task-level detail. The client needed plain English with numbers that agree.

Architecture, conceptual

Drawn by me from the design. Component names are generic on purpose. This is not the client's documentation.

Key decisions and what I rejected

Key decisions and what I rejected
DecisionAlternative rejectedWhy
Handle encoding and delimiter explicitly at importDefault CSV parsingA byte order mark and semicolons break default parsers quietly. Explicit handling turns the format into a checked rule.
Re-attribute duplicate agent codes through a mappingDeleting or merging duplicate recordsA mapping moves contracts to the right agent and keeps every record and its history.
Analyse the full log history before changing the pipelineFixing the latest failures one by onePatterns that repeat over years only show when the whole history is read.
Separate outputs for developers and for the clientOne combined reportEach audience gets what it acts on: tasks for developers, plain explanations for managers.

Results

Exact figures are confidential under the client agreement, so the results below are directions and mechanisms rather than numbers.

  • Zero contracts lost

    in re-attribution

    Duplicate codes resolved with every record kept.

  • Years of logs

    in one view

    Valid and invalid import pipelines summarised in one workbook.

  • Two reports

    for two audiences

    Task documentation for developers, a plain-English report for the client.

What I would do differently

I would add a duplicate code check to the import itself. Catching a duplicate at the door is cheaper than re-attributing contracts later.

Not published on this page

  • The supplier and the client's names
  • Contract volumes and agent identities
  • The log workbook and the client report
  • Database schemas and queries

Written from my own knowledge of the design. No client documents, screens or data were used.

Walk through this project on a call

30 minutes. I walk through how the duplicate codes were found, how re-attribution kept every record, and how I report data problems to non-technical clients. The call covers my engineering reasoning, not client data.