Booking rules dug out of legacy code, moved behind APIs
A golf booking platform had its booking and group-join rules buried in old code and SQL. We rebuilt it with AI finding those rules and carrying them over.
- Client
- Golf booking platform
- Work
- Booking and group-join operations · member services
- Type
- AI-Ready Platform · rebuild
- Status
- Completed
Problem
Changing one rule meant editing screens and queries together
- Booking and group-join rules were tangled across Java/JSP screens and SQL queries.
- Changing a single rule meant editing screens and queries at the same time.
- Adding a new service or AI first required pulling the rules out of the screens.
Approach
AI finds and moves the rules; people decide what moves
AI traced business rules through the old code and SQL, documented them and wrote the code that carried them into the new structure. People confirmed which rules to move and approved the architecture.
What AI did
- Finding and analysing business rules in old code and SQL
- Documenting rules (call path → SQL → rule)
- Writing the code that moves them to the new structure
What people did
- Confirming which rules to move
- Approving the architecture
- Defining AI working rules for each repository
New structure
- Customer web · admin (Next.js)
- API · services (NestJS)
- Shared contracts
Result
The rules are now visible in documents and APIs
- Booking rules that were buried in screens and SQL are now documented and exposed through APIs.
- Split into customer web, admin, API, services and shared contracts, the platform can be called by AI agents and other services.
- Every repository has working rules for AI agents to follow.
Lessons
Lessons
Extract before you migrate
Documenting the rules first gives you a checklist to confirm nothing went missing in the new structure.
Let AI read; let people choose
AI follows call paths through screens and SQL; people decide what's worth carrying over.
Rules behind APIs make the next step possible
Once rules sit behind APIs rather than screens, new services and AI agents use the same rules.
What carries over to the next client
Reusable assets
- Legacy rule extraction procedure (call path → SQL → rule document)
- Old-to-new menu mapping template
- Per-repository AI working rules (AGENTS.md) template
Useful if you are
- A booking or membership platform whose rules live in old code only a few people understand (leisure, lodging, education, medical booking)
- A team running a legacy system with no APIs that wants to add new services or AI
Would this work for us? Find out with a free two-week assessment
Pick one workflow and we'll assess how it changes when AI does the work, then hand you a report and a pilot proposal. No obligation to go further.