All Docs
FeaturesDepositClearUpdated March 6, 2026

Tenancy & Property Data Model

Tenancy & Property Data Model

Introduced in v0.1.16

Overview

The Tenancy & Property Data Model is the foundational layer of the platform. It defines the core domain entities — properties, tenancies, tenancy periods, landlords, tenants, and letting agents — and the relationships between them. All deposit management, dispute resolution, and compliance workflows are built on top of these models.


Core Entities

Property

A Property represents a single rentable unit (e.g. a flat, house, or room). It is the physical asset at the centre of every tenancy.

FieldDescription
idUnique identifier
addressFull address of the property
landlord_idReference to the owning Landlord
agent_idOptional reference to a managing Letting Agent

Tenancy

A Tenancy represents the formal agreement between one or more tenants and a landlord (or their agent) for occupation of a property.

FieldDescription
idUnique identifier
property_idReference to the associated Property
landlord_idReference to the Landlord
agent_idOptional reference to a Letting Agent
statusCurrent state of the tenancy (e.g. active, ended)

Tenancy Period

A Tenancy Period represents a discrete, date-bounded interval within a tenancy — for example, a fixed-term period followed by a statutory periodic tenancy.

FieldDescription
idUnique identifier
tenancy_idReference to the parent Tenancy
start_datePeriod start date
end_datePeriod end date (nullable for open-ended periods)
typePeriod type (e.g. fixed, periodic)

Landlord

A Landlord is the legal owner of a property who enters into a tenancy agreement.

FieldDescription
idUnique identifier
nameFull name or company name
emailContact email address
phoneContact phone number (optional)

Tenant

A Tenant is an individual named on a tenancy agreement as an occupant.

FieldDescription
idUnique identifier
nameFull name
emailContact email address
tenancy_idReference to the associated Tenancy

Letting Agent

A Letting Agent is a third-party agency acting on behalf of a landlord in managing a property or tenancy.

FieldDescription
idUnique identifier
nameAgency name
emailContact email address
phoneContact phone number (optional)

Entity Relationships

Landlord ──┐
           ├──> Property ──> Tenancy ──> Tenancy Period
Agent ─────┘                   │
                               └──> Tenant(s)
  • A Landlord owns one or more Properties.
  • A Letting Agent optionally manages one or more Properties or Tenancies on a landlord's behalf.
  • A Property can have multiple Tenancies over time (sequential, never overlapping).
  • A Tenancy has one or more Tenancy Periods and one or more Tenants.

Database Migration

This release introduces a new schema. A migration must be applied before deploying v0.1.16:

# Example — exact command depends on your migration tooling
npx prisma migrate deploy
# or
npm run db:migrate

The migration is additive only — no existing tables are modified or removed.


API Endpoints

Initial CRUD endpoints are available for all core entities. All endpoints are authenticated and scoped to the requesting user's organisation.

MethodPathDescription
POST/api/propertiesCreate a property
GET/api/properties/:idGet a property
POST/api/tenanciesCreate a tenancy
GET/api/tenancies/:idGet a tenancy
POST/api/tenancies/:id/periodsAdd a tenancy period
GET/api/landlords/:idGet a landlord
GET/api/tenants/:idGet a tenant
GET/api/agents/:idGet a letting agent

Full request/response schemas will be documented in the API Reference as endpoints are stabilised.


What This Unlocks

With the core data model in place, the following capabilities can now be built:

  • Deposit management — linking deposits to specific tenancies and periods.
  • Check-in / check-out reports — associated with a property and tenancy period.
  • Deduction claims — raised against a tenancy by a landlord or agent.
  • Dispute resolution workflows — tied to a tenancy, its parties, and the evidence on record.
  • Renters' Rights Act compliance checks — validated against tenancy period dates and party details.