A working prototype of a corporate travel platform, built on a fictional company and generated fares: no client has used it. It moves the travel policy out of a PDF and into the booking flow. Every flight and hotel is checked against the written policy before it is booked, in-policy trips confirm at once, and the rest go to the traveller's manager with every broken rule listed, then show up in reports by rule. Built with Next.js, React and TypeScript, tested with Vitest.
Prototype · demo data · Internal toolsAbout this page: this is a working prototype we built to prove an approach, not a client project. The demo company, its people, trips, fares and hotel rates are fictional or generated. Every screenshot shows fictional data, and no number here is a result from real use.
Most companies that send staff on business trips have a travel policy, usually a PDF. It says which cabin each level of staff may fly, what a flight or hotel night may cost, which suppliers are preferred, and how far ahead to book.
The booking process is usually an inbox. The traveller finds a flight, emails a manager and waits. The manager approves without seeing the policy. Finance sees the trip on an expense report, after the money is spent. Three groups lose in that loop:
The hard part is not the booking screen. It is turning prose into rules a computer can check, deciding what happens when a rule is broken, and keeping a record of every decision that finance can trust later.
The prototype has seven screens and three roles, chosen from a switcher in the header: Traveller (search, book, my trips), Approver or manager (approval queue, reports) and Travel admin (company dashboard, policy editor, reports). The demo company has 36 fictional employees across seven departments and four seniority levels, and 60 seeded historical trips: 48 flights and 12 hotel stays.
A traveller searches flights between 12 airports, or hotels in the same cities, and gets 14 flight or 12 hotel offers. Their cabin allowance is shown above the results, and the cabin filter only lists cabins their seniority allows. Every result carries a badge, In policy or Needs approval, next to its benchmark fare, and an "In policy only" switch hides the rest.
Choosing an offer opens a review screen. It lists each broken rule as a sentence, shows the gap to the benchmark, and asks for a trip purpose (required), a cost centre and an optional note for the approver. The button reads Confirm booking or Submit for approval depending on the verdict. A flight and a hotel can be booked as one package, checked separately with their breaches merged.
Someone can book on behalf of a colleague. Changing the traveller re-runs the engine for that person's seniority, so the policy is checked for the traveller, not the arranger.
The approver sees pending requests from their direct reports: traveller, trip, cost, gap to benchmark, every breach, the traveller's note, and route, cabin and purpose. Approve and Reject both require a written reason. Approving confirms the trip and issues a booking reference; rejecting marks it rejected. Both are logged with the approver's name and the time.
The travel admin edits cabin class for each seniority level, three price caps, preferred airlines and hotel chains, and the advance booking window. Before saving, an impact preview runs the engine over the current search results with the live policy and with the draft, and shows how many options are in policy before and after. Saving writes an audit entry with who changed it and when.
Reports filter trips by date, department and status, and show spend, bookings and compliance rate, with a CSV export that includes each trip's breaches. The admin dashboard adds pending approvals, average decision time, spend by department, top routes and a duty-of-care list of upcoming travellers.
The demo also has travel notices, notifications, a quick-find palette, five guided demo scenarios and a Reset demo control.
The engine is one TypeScript file of 154 lines with no interface code in it. It takes an offer, the traveller and the policy, and returns a verdict: in policy or not, the breaches as sentences, and whether approval is needed. The search badges, the in-policy filter, the review screen, the impact preview and the seed data all call the same functions.
| Rule | Applies to | Breaks when | Demo default |
|---|---|---|---|
| Cabin allowance | Flights | The offered cabin ranks above the traveller's allowance (economy, premium economy, business, first) | Economy for individual contributors, premium economy for managers, business for directors and executives |
| Fare cap | Flights | The fare is above the cap for the route type. A route is domestic only when both airports are in the UK | £450 domestic, £1,200 international |
| Nightly cap | Hotels | The nightly rate is above the cap | £220 per night |
| Advance booking | Flights and hotels | The days between today and departure or check-in are fewer than the minimum | 7 days |
| Preferred supplier | Flights | The airline is not preferred and the fare is more than 5% above the benchmark | British Airways, Virgin Atlantic, KLM |
| Preferred supplier | Hotels | The chain is not preferred and the total is more than 8% above the benchmark | Hilton, Marriott, Premier Inn |
Every rule runs on every offer. The engine does not stop at the first failure, so a trip that breaks three rules shows three reasons. For a flight plus hotel package, the two verdicts are merged and duplicate sentences removed.
Each employee record carries a manager, and the approval request is addressed to the traveller's manager. With no manager on record it falls back to the first director in the directory. A manager's queue shows pending requests from direct reports and any addressed to them by name. The request copies the breaches, cost, benchmark gap and the traveller's note, so the approver sees what the traveller saw. The booking records a cost centre, but the prototype reports on it rather than routing by it.
The prototype is a Next.js 16 app in strict TypeScript with Tailwind CSS 4, exported as a static site. There is no server, database or API key, deliberately: the goal was to prove the rules, the flow and the reporting, not the infrastructure.
The problem: a travel tool checks policy in many places. If each screen has its own if-else checks, they disagree sooner or later. What we chose: the rules live in one module that returns a structured verdict, and the interface only displays it. Why: when finance asks why a trip was flagged, there is exactly one place to look.
The problem: a policy engine can refuse anything that breaks a rule, or let people ask. Options: hard block, silent warning, or exception with approval. What we chose: exception with approval. The review screen says so in plain words: travel is not blocked, it goes through the approval queue. Why: real trips have real reasons, like the only flight that fits a client's diary. A hard block pushes people to book outside the system, and then the company has no record at all. The trade-off: no hard stops yet.
The problem: a red "out of policy" label tells a manager nothing. What we chose: every breach is returned as a sentence with the numbers in it, for example "Fare £1,490 exceeds international cap of £1,200", and the same list appears on the review screen, in the approval request and in the CSV export. Why: the approver can weigh the reasons, and finance can count exceptions by rule rather than by trip.
The problem: policies change. If compliance were recalculated from today's policy, last quarter's report would change every time the admin edits a cap. What we chose: each trip stores the verdict it was booked under, and each approval request stores its own copy of the breaches. Reports read those stored verdicts. Why: a trip approved under last month's rules stays explainable. The prototype does not yet store a policy version number with each verdict; a production version should.
The problem: the advance booking rule compares the departure date with the date the trip was booked. If an engine reads the current date itself, re-running the rules on history gives different answers on different days. What production does: pass the booking date into the engine as an argument, so the same rules always give the same answer for the same trip, and reports built from history stay stable.
The prototype has one test file with 5 unit tests in three groups, run with Vitest:
That is a thin suite, and we say so. It does not yet cover the hotel rules, the boundaries of the advance booking rule, package merging, approval routing or the reducer's state changes. A production build would start by adding table-driven tests for each rule at its exact threshold, and a test that a stored verdict does not change when the policy does. The code also runs under TypeScript strict mode and ESLint, and saved state is checked and repaired on load.
This is the shape of most internal tools we build: a written policy turned into rules, a check before the action instead of after, a decision record for every exception, and reports by rule so the policy itself can improve. The same pattern fits purchase orders, discounts, refunds and access requests.
Neither. It is a working prototype we built to prove an approach. The company, the employees, the trips and the fares are all fictional, and no client has used it or paid for it. We adapt the pattern into a build around a real company's policy, people and booking provider.
It runs every rule against the offer and the traveller. For flights: is the cabin within the traveller's seniority allowance, is the fare under the domestic or international cap, is the trip booked far enough ahead, and is a non-preferred airline within 5% of the benchmark fare. Hotels have three similar rules. If no rule breaks, the trip is in policy. Otherwise every broken rule is listed in plain English.
The traveller can still submit it, with an optional note for the approver. The trip is saved as pending, and an approval request goes to the traveller's line manager with the list of breaches, the cost and the gap to the benchmark fare. The manager must write a reason to approve or reject, and that reason is kept with the decision.
Not in the prototype. We chose to route exceptions rather than block them, because a blocked traveller tends to book outside the system and then the company sees nothing. A production version would usually add a third outcome, block, for the few rules no manager should be able to override.
No. Fares and rooms are generated from the search inputs, so the same search always returns the same fictional offers. A production version connects to real inventory through a GDS, a travel booking API or the company's travel management company, and re-checks the price and the policy at the moment of booking.
A server and database instead of browser storage, single sign-on, a directory sync for seniority and reporting lines, a real booking provider, an expense or finance integration, versioned policies, and stricter approval rules such as no self-approval and deputies for absent managers. The policy engine itself carries over largely as it is.
We will say which rules can be evaluated and which are still human judgement.
→ Book a strategy call