Allan Vargas Torres
ENES

All projects

Modular ERP

Accounting rules built test-first, and a gap analysis of 311 requirements against an international accounting standard.

In short

  • 311 requirements checked against the code and the running system
  • AI agents I designed cross-checked every verdict
  • Accounting rules built test-first; top contributor on a team of five
Role
Software development intern (backend)
Period
Aug 2026 – Nov 2026
Team
Team of five; top contributor
Status
Internship
Stack
TypeScript, NestJS, Drizzle ORM, PostgreSQL, Redis, MongoDB, pnpm + Turborepo, Vitest

The code is private, so this case study describes the work instead of linking to it.

The problem

The ERP is a core with cross-cutting services and a set of business modules: accounting, treasury, budgeting, inventory and more. The modules worked, but nobody could say with evidence which parts of the accounting standard the system met and which it did not. Without that, there was no way to plan the work or to answer the accountants’ questions.

What I did

The gap analysis

  • I turned the accounting standard into 311 verifiable requirements, each citing the page and paragraph it comes from.
  • I checked every requirement against the system in two ways: reading the code, file by file, and running the system, carrying out real operations and inspecting what ended up in the database.
  • I delivered a report for the accounting team and a remediation plan organized into work packages.

For the first time, the system’s compliance was measured requirement by requirement, with a plan to close the gaps.

AI agents as cross-checkers

A single reviewer reading 311 requirements will miss things, so I designed and supervised AI agents with adversarial instructions:

  • one agent verified each requirement against the text of the standard;
  • another tried to disprove every “missing” or “incorrect” verdict before it was accepted.

I integrated their results and validated every conclusion myself. The agents made the analysis more thorough; the verdicts are still mine.

Building what was missing, test-first

Each rule started as a test that stated it, written before the code. The main pieces:

  • Chart of accounts and the mapping of every business concept to its account.
  • Accruals on the right date, and an allowance for doubtful accounts by age at each close.
  • Fixed assets: depreciation, impairment tests and disposals that reach the general ledger, plus finance leases and subleases.
  • Financial statements: consolidation of controlled entities with eliminations, segment reporting, and reclassification of the current portion of debt and provisions.
  • Disclosures: related parties, contingent liabilities and assets, discounted provisions, and changes in accounting policy.
  • Budget close-out, where the unrestricted surplus covers any deficit first.

Decisions that needed an accountant

Several questions were for an accountant: when to recognize a type of income, which account a movement belongs to, how to treat a payment made in advance. Waiting would have stopped the work, so I decided each one from the official sources, wrote it down with its source and how confident I was, and marked it to confirm with an accountant later. The accounts live in configuration, so if the answer changes, nobody has to touch the code.

The architecture I worked in

These decisions were already in place when I joined; my work was to build inside them, and they are a big part of why the rules could be tested in isolation.

  • A shared core provides numbering, the audit trail, permissions and atomic operations across modules, and every module inherits them.
  • One database schema per module. No module imports another module’s tables; they talk through commands and events, delivered with a transactional outbox so an event is published only if the change that caused it was committed.
  • Nothing is deleted; it is sealed. Financial records keep a full trail, and money is always stored in cents.
  • Tests run against real infrastructure: PostgreSQL, Redis and MongoDB, not mocks.
  • Accounting
  • Treasury
  • Budgeting
  • Inventory
  • More modules
Shared coreNumbering, audit trail, permissions and atomic operations across modules
Each module owns its schema and never imports another module’s tables.

Result

  • The system’s compliance with the standard was measured with evidence for the first time, with a plan to close the gaps.
  • I was the top contributor on a team of five, mostly in accounting, fixed assets, budgeting and treasury.
  • 3,528 tests in the project and 321 interface tests, all green in the last full run before my internship ended.
  • Much of what the analysis had marked as missing was built in the weeks after it, so it needs a second pass against today’s system.
  • Documentation of the accounting domain that the team uses as a reference.

What I took from it

Reading the code was not enough. I confirmed each finding by running the operation and looking at the rows it wrote. Since then, “verified” means I have seen it happen in a running system.