Skip to content
Henrique Vieira
All projects

Multi-tenant school management, in production

School platform

On a school platform in production, I own the finance system, the hosting, the security and the approval of what reaches production.

Role
Finance system, hosting, security and final approval of changes
Period
Jul 2026 - present
Status
In production
Technologies
NestJS 11PrismaPostgreSQLRedisBullMQNext.js 15React NativeDocker

The problem

A school platform in production bills tuition through Multicaixa references. When a payment is not recognised, a family that has paid shows up as owing.

My job is to keep payments right, the platform up and its security in line with the data it holds, without stopping the service.

The approach

  1. 01

    Reconciliation that reads every charge

    The reconciliation job walks every page of the gateway's listing, with two guards: it detects repeated pages and has a maximum page count. If the response format changes, it logs the reason and stops, instead of finishing with an incomplete read.

  2. 02

    Retrying when the number is already used

    When the gateway rejects a transaction number as already used, the system moves to the next one and tries again, up to 15 times, logging each rejection. No one has to repeat the request by hand.

  3. 03

    Hosting and backups

    Containers with versioned images, controlled releases and backups with tested restores: a backup only counts if it can be restored.

  4. 04

    Final approval

    Everything comes in through a pull request, and I approve it. I check the tests and the automated rules, what happens if the change fails in production, and how to roll it back.

The results

100%
of the charges in the window reconciled, with pagination and stagnation guards
In production
with every change reviewed and approved before it goes in
15
automatic retries when a transaction number is already used, with no manual intervention

What I learned

A verification job that finishes incomplete without saying so is worse than one that fails. I design these jobs to log the reason and stop when they cannot do the whole job.

Next case

AutoPropina

Multi-tenant billing API for Multicaixa payment references

Read the case