Unverified ID Check Prompt on Tenant-Tenancy Link
Unverified ID Check Prompt on Tenant-Tenancy Link
Introduced in: v0.1.380
Overview
When a tenant is added to an active tenancy, the platform now automatically checks whether that tenant has completed their ID verification. If they haven't, a compliance check is raised and the responsible staff members are notified immediately — no manual intervention required.
This feature is designed to prevent right-to-rent obligations from being overlooked at the point of onboarding a new tenant.
How It Works
The feature is implemented as an event-driven function that listens for insertions into the tenancy_tenants table.
Trigger Condition
| Condition | Value |
|---|---|
| Event | tenancy_tenant.inserted |
| Tenancy state required | Active |
Logic Flow
- Tenant added to tenancy — a new record is inserted into
tenancy_tenants. - ID status check — the function reads
tenant.idVerificationStatusfor the linked tenant. - If status is
not_started:- A row is upserted into
compliance_checkswith ruleright_to_rent_id_check_required, associated with the relevant tenancy. - An in-app notification is sent to:
- The assigned property manager for the tenancy.
- All org admins in the organisation.
- A row is upserted into
- If status is anything other than
not_started, no action is taken.
Entities Involved
| Entity | Role |
|---|---|
tenancy_tenants | Source of the insert event |
tenants | Provides idVerificationStatus |
tenancies | Confirms tenancy is active and provides context |
compliance_checks | Receives the upserted right-to-rent check record |
notifications | Delivers in-app alerts to property manager and org admins |
Compliance Check Details
When raised, the compliance check record has the following characteristics:
- Rule identifier:
right_to_rent_id_check_required - Scope: Per tenancy (one check per tenancy/tenant combination)
- Write mode: Upsert — re-adding a tenant will not duplicate the check row
Notifications
The in-app notification is targeted and role-aware:
- Property manager — the individual assigned to the tenancy receives a direct alert.
- Org admins — all administrators within the organisation are also notified, ensuring no compliance requirement goes unescalated.
Notifications are delivered in-app at the moment the event fires. No email or external channel is used by this function.
Important Notes
- The function only fires for active tenancies. Adding a tenant to a draft or closed tenancy does not trigger the check.
- The compliance check is upserted, not duplicated — if the check already exists for the tenancy, it will be updated rather than a new row being created.
- The feature does not itself perform ID verification; it raises the requirement and surfaces it to the right people.