B2B Order Entry API (v3 Migration)

Architected the migration of a .NET order pipeline to Bun/Hono with Postgres, live DB2 inventory, and UPS warehouse ranking.

Built at a private employer. Details are sanitized; architecture and outcomes are described without proprietary identifiers.

Role
Lead Full Stack Developer
Year
2026
Category
software-dev

About This Project

Led planning for replacing a legacy .NET and PHP order intake stack with a Bun and Hono B2B API in the v3 monorepo. The target POST /orders endpoint will validate SKUs, rank 14 warehouses via UPS and geocoding, allocate stock with consolidation and will-call rules, persist to Postgres, and return structured responses for AS400 finalization. Produced a 976-line team reference, phased Azure DevOps work breakdown, and parity strategy against 57 existing .NET tests while Postgres schema and data-sync work is underway.

Technologies Used

JavaScriptBunHonoPostgreSQLIBM DB2RedisZodUPS API

Engineering Challenges

Strangler Cutover: Planned a single-release swap from email-only v2 intake to full v3 order placement without dual-path feature flags or legacy aliases.

Hybrid Inventory Model: Mapped synced validation rules to Postgres while keeping live DB2 quantity reads at request time so warehouse stock stays authoritative without stale cache.

Cross-Language Parity: Defined side-by-side JSON diff validation against .NET BypassTester output for roughly 1,000 lines of orchestrator logic and 57 regression tests.

Stored Procedure Elimination: Documented replacements for 10+ SQL Server stored procedures with Postgres tables, data-sync types, and runtime JavaScript actions.

Technical Highlights

Eight-Step Orchestrator Port: Mapped idempotency, customer prefs, promo validation, warehouse ranking, parallel SKU checks, allocation, persistence, and status handling into Hono route actions.

UPS Ranking Resilience: Specified parallel rating calls with cache TTL, Haversine fallback, and graceful degradation when third-party rating fails.

Token-Scoped Security: Resolved customer identity from B2B API credentials only, never from client-supplied customer numbers in request bodies.

Agent-Ready Documentation: Authored Cursor rules, error catalogs, and phased implementation order to support AI-assisted development across the migration epic.

Business Logic

B2B Channel Enablement: API integrators gain programmatic order placement instead of manual intake email workflows.

Platform Modernization: Moves order logic off SQL Server stored procedures into a testable Bun service aligned with the broader v3 stack.

AS400 Alignment: Preserves ERP ownership of pricing and final confirmation while the API owns sourcing and structured responses.

Release Risk Reduction: Phased user stories, parity harness, and hybrid inventory design de-risk cutover before production deployment.