Check-Out Report Missing Escalation
Check-Out Report Missing Escalation
Available from v0.1.321
The check-out report missing escalation is an automated compliance workflow that runs every morning and flags any ended tenancy that still has no check-out report on record. It is designed to prevent deposit disputes from going unresolved due to missing documentation.
How It Works
Schedule
The workflow is triggered by a cron job that runs once per day at 08:30 UTC.
30 8 * * *
Detection Criteria
A tenancy is considered non-compliant and will be escalated when all of the following are true:
| Condition | Detail |
|---|---|
status = 'ended' | The tenancy has formally ended |
endDate < today − 7 days | The tenancy ended more than 7 days ago |
archivedAt IS NULL | The tenancy has not been archived |
No checkOutReport row exists | There is no check-out report — not even a draft |
Grace period: Tenancies that ended within the last 7 days are excluded. This gives agents time to upload the check-out report before an escalation is triggered.
Actions Taken on Escalation
For each tenancy that meets the criteria above, the workflow automatically performs three actions:
1. Compliance Check Upsert
A row in compliance_checks is created or updated with:
- Rule:
check_out_report_missing - Severity:
critical - Result:
fail
Because this is an upsert, running the job multiple days in a row will not produce duplicate compliance records — the existing row is updated instead.
2. In-App Notification
An error-level in-app notification is inserted for every admin and owner in the organisation associated with the tenancy. Recipients will see this alert the next time they log in to the platform.
3. Escalation Email
An escalation email is sent to all admin and owner members of the organisation, providing details of the non-compliant tenancy and prompting immediate action.
Entities Involved
| Entity | Role |
|---|---|
tenancies | Source of truth for ended tenancies |
checkOutReports | Checked for existence (including drafts) |
complianceChecks | Receives the upserted fail/critical record |
notifications | Stores in-app error notifications for admins/owners |
orgMembers | Used to resolve admin and owner recipients |
properties | Associated with tenancies for contextual display |
Resolving the Escalation
To clear the escalation for a tenancy:
- Upload a check-out report for the tenancy (even a draft will satisfy the condition).
- On the next scheduled run (08:30 UTC the following day), the tenancy will no longer match the detection criteria.
- The compliance check will not be re-triggered unless the report is deleted again.
Note: Archiving the tenancy (
archivedAt IS NOT NULL) will also exclude it from future escalation runs, but it does not retroactively resolve an existingfailcompliance check.