Chart RS-26 · FN-07 2026-11-23 · 3 min read
Chart lighting

Field note FN-07

Fix it once, at the boundary: hotel system integrations in practice

A long tail of partner failures usually comes from a handful of causes. Why I stopped patching integrations one at a time and put the fixes where data comes in.

A conversational assistant for hotels has to know what the hotel’s own systems know: who is staying, when they arrive, what room they booked. That data comes from many systems, each with its own model of a hotel or a message.

When those integrations fail, the failures look endlessly varied: a guest’s name in strange characters, an arrival date a day off, a booking the assistant can’t find, a phone number that won’t match a contact. Each looks like a one-off. Fixed one at a time, they never end.

The long tail has a short list of causes

The turning point was sorting failures by cause instead of by partner. Grouped by cause, the same few kept coming back:

  • Dates and time zones. The most common, so it gets its own section below.
  • Encodings. Names arrive garbled, double-encoded or in the wrong character set.
  • Phone numbers. With or without a country code, in many formats. A conversation can only be matched to a booking if both sides end up in the same format.
  • Empty versus missing. Several different values can all mean “no value”, and sometimes zero is a real value.
  • Vocabularies and identifiers. Each system has its own names for statuses and room types, and its own IDs for the same reservation.

Dates are not timestamps

A hotel stay is two dates, not two instants. A guest arriving on 14 March arrives on 14 March wherever the server is. Some systems send stay dates as midnight timestamps, and the moment code converts that to the hotel’s time zone, a hotel west of UTC sees the guest arriving on the 13th.

The rule I’d write on the wall: stay dates stay dates. They are never converted. Only real instants, like when a message was sent, are converted, using the hotel’s named time zone rather than a fixed offset, so daylight saving is handled for free.

One canonical model, many thin adapters

The design that came out of this is simple to describe:

  1. One internal model of a reservation, guest and message, with strict types.
  2. One adapter per partner, whose only job is to map that partner’s fields onto the internal model. Adapters don’t fix data. They rename it.
  3. Shared normalisers between the two, one per cause from the list above. Each is written and tested once.

The payoff is in the third step. When a new partner sends a phone number in a format nobody has sent before, it’s fixed in one place, and every integration gets the fix. Before, it would have been a patch in one adapter, and the bug would come back from another partner.

Fail loudly at the boundary

Normalising doesn’t mean accepting everything. When a value can’t be made valid, the worst option is to let it through and fail three services later, where the error no longer says where it came from.

So validation happens right after normalisation, and a rejection names the source, the field, the raw value and the rule it broke. Grouped by rule, those rejections are the list of causes, updated live.

What goes wrong at scale

Some problems only show up across thousands of properties, and none of them is any one system’s fault. Two hotels on the same system can be configured quite differently, so an adapter has to tolerate each property’s setup. Credentials change without notice, and that’s an error retrying won’t fix: alert, pause that property, and tell the hotel. Rate limits shape the sync design more than any other constraint. And APIs change, which strict parsing at the boundary turns from a silent wrong value into a visible rejection.

What I’d tell someone starting out

  • Group failures by cause, not by partner. The partner list hides the pattern.
  • Keep adapters thin. Mapping belongs in the adapter; fixing belongs in shared code.
  • Treat stay dates as dates.
  • Validate at the boundary, and make the rejection say exactly where the value came from.
  • Expect each property to differ from the documentation, and from the next property.

The integrations I’m proudest of are the boring ones. A new partner goes live, the odd data it sends is already handled, and nobody has to think about it again.

Request
clearance