🚖Taxi Driver
Technical Dive into a
flexible & international Tax Engine Microservice
🤔 Product Requirements
- Calculate VAT taxes in Cirrus ERP/HIS
- Initially: 🇲🇽Mexico, 🇸🇦Saudi Arabia, 🇦🇷Argentina
- Integrate with current Tax implementation for 🇲🇽MX
-
Configurable rules: Exotic tax regulation often changing
- Ex. Monthly in ARG, due to currency inflation
📐Constraints
- Easy enough for non-programmers (a.k.a. Accountants) to use
- Existing technical debt in financial module of big/old Java monolith
- Time sensitive: Tax season in MX in <3 months
As-is Architecture
Pros | Cons | |
---|---|---|
Option A: Refactor Java Module |
- Existing dedicated team & know-how |
- Time frame too tight (3-4mos) - Big scope due to tech debt & MX law - Scalability: Non-SaaS economies of scale |
Option B: Tax Engine Microservice |
- Cheap to prototype - Easy to integrate to - Independent lifecycle |
- Risk of resource waste |
🚧 Revised Tech Specs
- Arch: SOA/Bounded-Context => Microservice/ Lambda
- Simple DSL JSON-based configuration
- In-memory/Hardcoded data store for config
- Memoization
- TDD/BDD for fast iteration
🚫 Non-goals (for MVP)
- Avoid refactoring Java module, stick to HTTP interface
- Configurable interface/UI (*PoC)
- Full blown DB
- No cache
- No pre-defined rules format
To-be Architecture
🛠Technical Dive
-
Zeit Micro framework / monorepo
- Flexibility between MS or ƛs
- LowDB: NoSQL-like lightweight ORM
- Jest: For Unit Testing
- CI/CD server for continuous adjustements
- Don't re-invent the wheel:
- Currency.js: Decimals & rounding
- hot-formula-parser: Excel-like formulas
- moment.js: Dealing with Time(zones)
- Standard.js: Syntax not worth discussing
- lodash: For everything else
Lessons learned
- Out-of-the-box thinking is great way to move forward both culturally and technically
- Working under constraints is always good to get the best out of your team.
- There's always fun and interesting ways to make legacy and newer tech work together.
- It's all about empowering people, not the technology itself.
taxi-driver
By Benjamin Orozco (benoror)
taxi-driver
- 1,764