Document Storage & Management
Document Storage & Management
The document storage and management system lets agents upload, categorise, and manage files associated with a tenancy term — such as signed agreements, inventory reports, deposit certificates, and legal notices — directly within the tenancy overview.
Accessing Documents
Navigate to a tenancy and open the Tenancy Overview:
- Overview tab — shows a "Term Documents" summary card at the top of the page with signing method and visibility badges for each document.
- Documents tab — full document management interface with upload, filter, and delete capabilities. A badge on the tab label shows the total document count.
Uploading a Document
- Go to the Documents tab on a tenancy overview.
- Click Upload Document.
- Fill in the modal form:
| Field | Required | Description |
|---|---|---|
| Document Type | Yes | Category of the document (see list below) |
| File Name | Yes | Display name for the file (e.g. Tenancy Agreement - 123 High St.pdf) |
| File URL | Yes | Direct URL to the file — Vercel Blob, S3, or any external link |
| Signing Method | Yes | Uploaded (no signing), Manually Signed (externally), or eSigned (electronically) |
| Date Signed | No | Only shown when signing method is Manually Signed or eSigned |
| Visibility | Yes | Who can see the document (see below) |
| Notes | No | Optional free-text notes (max 2,000 characters) |
- Click Upload Document to save.
Document Types
| Value | Label |
|---|---|
tenancy_agreement | Tenancy Agreement |
inventory | Inventory |
deposit_certificate | Deposit Certificate |
check_in_report | Check-In Report |
check_out_report | Check-Out Report |
section_21 | Section 21 Notice |
section_8 | Section 8 Notice |
guarantor_agreement | Guarantor Agreement |
reference_report | Reference Report |
insurance_certificate | Insurance Certificate |
other | Other |
Signing Methods
| Value | Meaning |
|---|---|
uploaded | Document uploaded for reference only — no signing involved |
manual | Signed manually (wet signature or external tool); date can be recorded |
eSigned | Electronically signed; date can be recorded |
Visibility Controls
Each document has a visibility setting that controls which parties can access it.
| Setting | Who can see it |
|---|---|
| Agent Only | Internal — only agents in your organisation |
| Tenant Visible | Agents + the tenant(s) on this tenancy |
| Landlord Visible | Agents + the landlord |
| All Parties | Agents, tenants, and landlord |
Visibility is displayed as a colour-coded badge on both the Overview and Documents tabs.
Filtering Documents
On the Documents tab, use the Type filter dropdown to show only documents of a specific category.
Deleting a Document
A delete action is available on each row in the Documents table. Deletion requires confirmation and is restricted to:
- The user who originally uploaded the document, or
- A user with an admin or owner role in the organisation.
All deletions are recorded in the audit log.
Audit Logging
The following actions are automatically logged:
- Document uploaded
- Document metadata updated (visibility, notes, signing info)
- Document deleted
tRPC API Reference
The document router exposes the following procedures:
// Upload a document for a tenancy term
trpc.document.upload.mutate({ tenancyTermId, documentType, fileName, fileUrl, signingMethod, signedAt?, visibility, notes? })
// List documents for a tenancy term
trpc.document.listByTenancyTerm.query({ tenancyTermId, type?, visibility? })
// Get a single document
trpc.document.getById.query({ id })
// Update document metadata
trpc.document.update.mutate({ id, visibility?, notes?, signedAt?, signingMethod? })
// Delete a document (uploader or admin/owner only)
trpc.document.delete.mutate({ id })
// Get document count for a tenancy term
trpc.document.countByTenancyTerm.query({ tenancyTermId })
// Get available document types
trpc.document.getDocumentTypes.query()
Database Schema
Documents are stored in the tenancy_term_documents table:
| Column | Type | Description |
|---|---|---|
id | string | Primary key |
tenancyTermId | string | Links document to a tenancy term |
uploadedByUserId | string | User who uploaded the document |
documentType | enum | Category of the document |
fileName | string | Display/original file name |
fileUrl | string | Storage URL |
fileMimeType | string | MIME type of the file |
fileSizeBytes | string | File size in bytes |
signingMethod | enum | eSigned, manual, or uploaded |
signedAt | timestamp | When the document was signed (optional) |
visibility | enum | agent, tenant, landlord, or all |
notes | string | Optional notes (max 2,000 chars) |
The table is indexed on orgId, tenancyTermId, and documentType.