← All write-ups

Designing a Multi-Country Vehicle Trading, Container/RoRo Shipping & Polymorphic Payment ERP in Laravel

Enterprise ERP & Global Logistics2 min read·Case study: Trans Auto Hub

International vehicle exporters buy cars at Japanese auctions, allocate stock across regional branches in Sri Lanka, Dubai, and India, group vehicles into ocean containers or RoRo vessels, and track payments across multiple currencies. Traditional accounting packages are too rigid for chassis-level logistics, while spreadsheets break down across branches. Here is how I designed Trans Auto Hub in Laravel to manage the entire 8-stage vehicle lifecycle.

11. The 8-Stage Chassis Lifecycle & Multi-Branch Isolation

Every vehicle in the system is uniquely indexed by its chassis number and moves through a strict 8-stage pipeline: Draft -> Purchased -> Allocated -> Reserved -> Shipped -> Arrived -> Released -> Completed.

Using UUID primary keys, global SoftDeletes, and 7 granular RBAC roles (Super Admin, Owner Finance, Owner Logistics, Branch Manager, Branch Sales, Branch Finance, Viewer), headquarters in Japan maintains global control while regional branches only see their allocated inventory and local customer bookings.

22. Transactional Container vs. RoRo Ocean Shipment Manifests

Exporters ship vehicles either via Roll-on/Roll-off (RoRo) vessels or packed inside multi-vehicle shipping containers with individual container numbers, seal numbers, notify parties, and port charges. Before a vessel departs, vehicles are frequently swapped in or out of a shipment.

I built a transactional ShipmentService that diffs submitted vehicle IDs against existing manifest details on every update—automatically reverting removed vehicles to their prior Booking or Branch Allocation state so no chassis is ever lost in transit.

  • Supports both multi-container manifests (with per-container seal numbers and charges) and direct RoRo vehicle lists
  • Automatically links each shipped chassis to its destination branch and flags Head-Office direct sales
  • Cascades shipment arrival events to update all contained vehicle statuses atomically

33. Three-Tier Polymorphic Multi-Currency Payment Tracking

A single vehicle trade involves three separate money flows: Japan HQ paying the auction supplier, the regional branch paying HQ for the allocation, and the end buyer paying advance and balance installments to the branch—often across USD, JPY, AED, and LKR.

Instead of building three separate ledger systems, I designed a polymorphic Payment model (paymentable_type / paymentable_id) that attaches cleanly to Purchases, Branch Allocations, and Multi-Vehicle Direct Sale Bookings.

44. Event-Driven Email & SMS Milestone Automation

Cross-border buyers want immediate confirmation when their vehicle is reserved, when advance payment is recorded, and when the ship departs or arrives at port. Laravel Events and Redis-queued Notifications automatically dispatch Email and SMS alerts at 8 key lifecycle triggers while recording every delivery in a centralized notification audit log.

Need something similar built?

I build and ship platforms like this for startups and retailers. Tell me what you are trying to launch and I will reply with how I would approach it.