← All articles
Data modeling·3 min read

One facility model for hotels, hospitals, and estates

How Djengo models physical space so a hospital ward, an estate unit, and a hotel room share one engine, and the modelling mistake I had to undo.

djengoproductdata-modelingarchitecture
On this page

Every operator Djengo serves eventually asks the same question: where is this? Which ward is the patient in. Which unit is the tenant leasing. Which room does housekeeping clean next. The answer has to work for a hospital, an estate, and a hotel without becoming three products.

Branch is not a facility#

ConceptWhat it answersExample
BranchWhich property or site?Sunrise Hospital, Ikeja
Facility nodeWhere inside that property?Block A → Ward 3 → Room 301

Branches already carry payroll scope, departments, and hotel links. Facility nodes are a tree that always lives under exactly one branch. Keeping them separate meant I never had to migrate the branch table to support a ward.

One tree, shaped by mode#

text
HOSPITAL                    ESTATE
Branch (campus)             Branch (estate phase)
└─ BLOCK                    └─ BLOCK
   └─ WARD                     └─ BUILDING
      └─ ROOM                     └─ UNIT
         └─ BED (optional)           └─ ROOM (optional)
facility_modeWhat the product expects
GENERALBranches and departments only
HOSPITALBlock → Ward → Room under each branch
ESTATEBlock → Building → Unit
HOSPITALITYRooms live in operations today; the tree is optional
A company setting decides which parent types the API accepts.

What hangs off a node#

DataLinks to
Patient admission or bedWARD or ROOM
Estate tenant or leaseUNIT
Housekeeping taskROOM, plus the assigned staff
Staff role at a propertyBranch, not a node

Clinical departments like radiology or pharmacy stay in departments, because they are functions, not places. That one distinction removed a week of confused UI.

The lesson I keep relearning: model the nouns the operator already uses, keep each one answering a single question, and let a mode setting change the shape instead of forking the product.

Key takeaways

What to remember

  • Branch answers which property; nodes answer where inside.
  • A mode setting shapes the tree instead of forking the product.
  • Roles belong to properties, not rooms.
Isaac Tubonibo

Written by

Isaac Tubonibo

Founder of Djengo · Software Engineer

Founder of Djengo, operations software for hotels, hospitals, estates, and restaurants. I build it end to end: architecture, delivery, and the human side of shipping under pressure.

More from the archive

Related articles