INTRALOT (opens in a new tab) · Operator platform
Moving shipping documents to the backend.
Designed and built a refactor of the shipping manifests and labels for five operators: processing moved from the browser to the Node.js backend, service and database access unified, and each operator’s layout and accounting data separated. It halves response time in QA (~167 ms to ~80 ms).
The context
Shipping manifests and labels existed for one operator and had to be extended to new ones. Most of the work ran in the browser: gathering the data, validating and normalising it, with the server mainly rendering the PDF. Data came through a mix of microservice calls and scattered query functions, and every operator-specific rule sat in one feature file. Each new operator would have meant more branches in that file, and more logic running in the browser on the operators’ own machines.
My contribution
I designed and built the refactor, from the browser to the Node.js backend and the data access behind it. I also own the accounting data on the manifests, which has to follow each jurisdiction’s own financial rules and tax presentation.
Key decisions
Do the work on the server
I moved the processing to the Node.js backend. The browser now only gathers and validates the identifiers; the server fetches, normalises and renders. That gives one place to extend per operator, and the work no longer runs on the operators’ own PCs, so results don’t depend on the client.
One route for every source of data
A single route and handler orchestrates all fetching, from the microservices and from the tables, replacing scattered calls with one canonical read of the order. Failures are handled in one place, and the flow can be tested as a whole. Finalising a document and reprinting it go through the same service, so the two cannot drift apart.
A module per operator
Each operator’s layout (headers, logos, origin and destination, operator details and tax-related presentation) and its accounting fields (game price, quantity per pack, packs, gross and net amounts) sit in their own module. Adding an operator means adding a module, not editing shared logic. Business and tax rules are verified by a separate service: the documents present the data; they don’t reimplement the rules.
The outcome
The refactor halves response time in QA (~167 ms to ~80 ms). In the refactored code, manifests and labels for all five operators come from one backend flow, and a new operator is a new module rather than another branch in shared code.