Corporate travel platform

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 tools
Client
None. Our own prototype
Sector
Corporate travel and expense
Status
Working prototype, fictional data
Role
Product design and full build by minidev.pro
Stack
Next.js 16, React 19, TypeScript, Tailwind CSS 4, Vitest
Platform
Web app, static export, state kept in the browser

About 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.

The problem, in the traveller's and finance team's world

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:

  • Travellers cannot tell whether an option is allowed until someone replies.
  • Managers are asked to approve trips without being told which rule, if any, is broken.
  • Finance cannot report compliance by rule, because the decisions live in email threads, or see what a policy change would do before making it.

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.

What the prototype does

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.

Search with the policy shown on every result

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.

Flight search for an individual contributor, London Heathrow to Paris. The cabin allowance chip reads Economy. The first result, a non-preferred airline at 684 pounds against a 570 pound benchmark, is marked Needs approval; the next two, from preferred airlines, are marked In policy.
Search as a traveller. The cheapest fare needs approval because a non-preferred airline is more than 5% above the benchmark; dearer fares from preferred airlines are in policy. Prototype, fictional data.

Review and confirm, with every breach in plain English

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.

Review and confirm screen for a business class flight from London Heathrow to New York JFK. Three breaches are listed: business exceeds the economy allowance for an individual contributor, the fare of 1,490 pounds exceeds the 1,200 pound international cap, and the trip is booked 3 days ahead when the policy requires 7. The cost summary shows the fare 121 pounds above benchmark and a Submit for approval button.
One booking, three broken rules, each stated in words a manager can act on. The note under the cost summary says travel is not blocked; it goes to the approval queue. Prototype, fictional data.

An approval queue that shows why

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.

Approval queue with one pending request: a business class trip from London Heathrow to New York JFK for a client meeting, 1,490 pounds, 121 pounds above benchmark. The three breaches are listed, followed by the traveller's note, route, cabin and purpose, a required decision reason box, and Approve and Reject buttons.
The manager sees the same breach list the traveller saw, the traveller's note, and must write a reason either way. Prototype, fictional data.

A policy editor with an impact preview

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.

Travel policy editor. Cabin class by seniority: economy for individual contributors, premium economy for managers, business for directors and executives. The international flight cap has been edited from 1,200 to 700 pounds. The impact preview for London to Paris shows 4 in-policy options now and 2 after saving, with sample breaches. An audit trail lists the initial policy configuration.
Lowering the international cap from £1,200 to £700 in the draft: the preview shows in-policy options for the current search falling from 4 to 2 before anything is saved. Prototype, fictional data.

Reports and a company dashboard built from the same records

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.

How the policy engine evaluates a trip

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.

The rules

RuleApplies toBreaks whenDemo default
Cabin allowanceFlightsThe 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 capFlightsThe 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 capHotelsThe nightly rate is above the cap£220 per night
Advance bookingFlights and hotelsThe days between today and departure or check-in are fewer than the minimum7 days
Preferred supplierFlightsThe airline is not preferred and the fare is more than 5% above the benchmarkBritish Airways, Virgin Atlantic, KLM
Preferred supplierHotelsThe chain is not preferred and the total is more than 8% above the benchmarkHilton, 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.

The outcomes: allow, allow with exception, block

  • Allow (in policy). No rule breaks. The trip is confirmed immediately, gets a booking reference and appears in My trips.
  • Allow with exception (needs approval). One or more rules break. The traveller can still submit, with a note. The trip is saved as pending and an approval request is created. When the manager approves with a reason, the trip is confirmed; when they reject with a reason, it is marked rejected.
  • Block. Not in the prototype, on purpose. Nothing is refused outright; every breach becomes an exception for a person to decide. A production policy usually needs a small set of hard stops, and the engine's verdict object has room for that third outcome.

Approval routing

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.

How the prototype's policy engine evaluates a trip and routes it A trip request and the travel policy feed the policy engine, which runs every rule and collects all breaches. If there are no breaches the trip is confirmed at once. If there are breaches, an approval request is sent to the traveller's manager, who must give a reason to approve or reject. A block outcome is shown dashed because it is not in the prototype. Trip request Travel policy Policy engine: every rule runs, every breach is collected Any breaches? Allow: in policy Exception: needs approval Manager decides Block Traveller and their seniority Flight or hotel offer, benchmark Departure or check-in date Cabin by seniority, price caps Preferred airlines and hotels Minimum days booked ahead Flights: cabin within allowance? Fare under domestic or international cap? Booked at least the minimum days ahead? Non-preferred airline within 5% of benchmark? Hotels: nightly rate under cap? Booked at least the minimum days ahead? Non-preferred chain within 8%? Packages: both checked, merged Trip confirmed at once Booking reference issued Verdict stored on the trip Trip saved as pending Request copies breaches, cost, benchmark gap and the note Sent to the traveller's manager Reason required either way Approve: confirmed. Reject: rejected Not in the prototype; production only No Yes
The evaluation and routing path as implemented in the prototype's code. The dashed block outcome is what a production version would add.

How it is built

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.

  • Domain layer. Plain TypeScript with no React in it: the types, the policy engine, and the analytics behind the dashboard, reports and CSV export. This is the part that moves to a server.
  • State. A single reducer holds employees, policy, audit entries, trips, approvals and the activity log. Every change is a named action, such as submit booking, approve, reject, cancel or update policy. State is saved to browser storage under a versioned key; a damaged save is merged with fresh seed data instead of crashing the app.
  • Data model. An employee has a department, seniority and manager. A trip holds the offer, cost, cost centre, purpose, status (confirmed, pending approval, rejected, cancelled) and the verdict it was booked under. An approval request links to a trip and stores the approver, breaches, cost and benchmark gap, then the decision, its time and its reason.
  • Generated inventory. Fares and rates are computed from a hash of the search inputs, so the same search always returns the same offers, which keeps demos and tests repeatable.
  • Roles. Navigation and page access are filtered by role. In the prototype the role is chosen from a switcher, so this is a demonstration of the permission model, not security.

Hard problems and the decisions behind them

1. One engine, called from everywhere

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.

2. Route exceptions instead of blocking them

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.

3. Collect every breach, in words a manager can act on

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.

4. Freeze the verdict at booking time

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.

5. The booking date is an input, not "today"

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.

Testing and quality

The prototype has one test file with 5 unit tests in three groups, run with Vitest:

  • Policy engine (2 tests): a business class fare for an individual contributor is out of policy, needs approval and returns at least one breach; an economy fare within the cap, from a preferred airline or near the benchmark, booked 14 days ahead, is in policy.
  • Analytics (2 tests): dashboard spend, trip count and department spend are derived from the trip records; report rows are built for a date range and carry an amount.
  • Workflow seed (1 test): the seed contains pending approvals, at least 48 trips and at least 36 employees.

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.

What it proves, and what production needs

What the prototype proves

  • A written travel policy can be expressed as a small set of rules that a non-technical admin can edit, with a preview of the effect before saving.
  • Every offer can be checked before booking, with reasons a traveller and a manager can both read.
  • Exceptions can be routed to the right person with the context they need, and every decision can carry a reason and a timestamp.
  • Spend and compliance reports can be built from the same records the booking flow writes, with no separate spreadsheet.

What a production version would need

  • Real inventory and booking. Live fares and rooms from a GDS, a travel booking API or the company's travel management company, including ticketing, changes, cancellations and refunds. Prices move between search and purchase, so the price and the policy should be checked again at the moment of booking, on the server.
  • A server and a database. Trips, approvals and an append-only audit log stored centrally, not in one browser.
  • Single sign-on and a directory sync. Staff sign in with the company's identity provider, and seniority, department and reporting lines come from the HR system rather than a seed file. Roles are then enforced on the server.
  • Stricter approval rules. Nobody approves their own trip (the prototype's generated org chart allows it in some cases), deputies cover absent managers, requests escalate after a set time, and thresholds or cost-centre owners can add a second approver for large amounts.
  • Expense and finance integration. Confirmed trips flow into the expense or accounting system with a validated cost centre. In the prototype any cost centre can be picked.
  • Versioned policies and a block outcome. Each verdict records the policy version it was judged against, and a short list of hard stops sits alongside the exception path.
  • Notifications and currencies. Email or chat alerts for approvers, a real travel disruption feed, and multi-currency support, since the prototype prices everything in pounds.

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.

Questions about this project

Is this corporate travel platform a live product or a client project?

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.

How does the policy engine decide whether a trip is in policy?

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.

What happens when a booking breaks the travel policy?

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.

Can the system block a booking outright?

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.

Does it book real flights and hotels?

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.

What would it take to turn this into a production system?

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.

Policy PDF and a messy inbox?

We will say which rules can be evaluated and which are still human judgement.

→ Book a strategy call

Estimate your build →