All projects

Freight Routing

Consolidating vehicle shipments into routes under Brazil's minimum freight rate

When Brazil's transport agency (ANTT) changed the minimum freight rate, shipping one vehicle at a time between cities became expensive and non-compliant. I built a Fluig panel where the logistics team groups several requests into a single route, sees distance and tolls calculated on the spot, gets carriers sorted from cheapest to most expensive and, in one click, sends every request in the route to finance already filled in. More than 2,300 requests went through routing in the first two months in production.

The Challenge

Intercity freight requests moved on their own, with no consolidation at all. Under the new ANTT rule, every route had to be built, priced and validated before payment within 48 hours, without taking the team out of Fluig or retyping data across dozens of requests.

The Solution

I added an "Awaiting Routing" step to the process, which same-city shipments skip automatically. In the panel, the router picks pending requests and builds the route: distance, tolls and freight table come from the NDD Cargo API, and carrier quotes come from a .NET endpoint, already sorted by price and checked against the minimum rate. The route is stored in a .NET microservice backed by MongoDB, and an integration with the Fluig API moves every request at once, writing the route data into each form. The code is covered by 99 automated tests that run in about 330 ms and became the team's reference.

Key Deliverables

  • More than 2,300 requests routed in the first two months in production
  • Routing step with a 48h SLA and automatic bypass for same-city shipments
  • Distance, tolls and freight table calculated by the NDD Cargo API
  • Carriers listed from cheapest to most expensive
  • Freight value validated against the ANTT minimum rate
  • One click moves every request in the route, already filled in
  • Route history, comments, attachments and cancellation locked once finance takes over
  • .NET microservice with MongoDB, pagination and search by route or request
  • 99 automated tests, XSS protection and automatic token renewal