amin norollah.
Loading portfolio
Leading the move of stock management out of a larger service into its own: the plan, the architecture and the safeguards

Back endWebFocalPay

FocalPay Inventory Service

Leading the move of stock management out of a larger service into its own: the plan, the architecture and the safeguards

Year
Aug 2026
Type
Back end
Technologies
12
Track
Web

Details

Stock management at FocalPay lived inside a larger service that had outgrown it, and correctness problems had started to show. I led the work to move it into a dedicated inventory service: I wrote the migration plan, designed the new service and built it, so it could take over step by step instead of in one risky switch.

The key decisions were mine, and I recorded each one in an architecture decision record. The cut-over is staged and reversible, following the strangler pattern, with a rehearsed rollback for every step. Stock is derived from an append-only movement ledger, so every change can be explained and audited. Stock counts change through atomic updates, so concurrent sales can never overwrite each other. Events leave through a transactional outbox to idempotent consumers, so nothing is lost or applied twice. And the service is hexagonal, with its architecture rules checked in the build, so the domain stays independent of frameworks and infrastructure.

Functionally it covers stock levels, supplier purchase orders with spreadsheet export, goods receipt with batch numbers and expiry dates, expiry alerts, stock counts, weighed goods, reporting, and reconciliation of deliveries against orders.

I treated confidence as part of the deliverable: more than a thousand automated tests, many of them integration tests against real databases and brokers running in containers, plus end-to-end tests across services, load tests, and deliberately breaking each safeguard to prove the build goes red. I also wrote the runbooks, troubleshooting guides and roadmap the team needs to operate it. The service is complete and tested, and ready for its staged cut-over.

Technologies

  • Java
  • Spring Boot
  • MongoDB
  • Kafka
  • Event-Driven Architecture
  • Transactional Outbox
  • Hexagonal Architecture
  • DDD
  • ArchUnit
  • Testcontainers
  • k6
  • ADR

Experience

Projects

No public link - commercial or internal project