Contract Violations
Track and document contract violations by tenants
Overview
The contract violations module allows you to document and track cases of non-compliance with Lease Agreement terms. Each violation can be linked to specific contract clauses and supported with photo evidence.
Violation Tracking
Keep a history of all violations for each property and contract
Link to Clauses
Specify which contract clauses were violated
Photo Evidence
Attach photos and documents to confirm violations
Severity Levels
Rate violation severity on a scale from 1 to 10
Severity Levels
The system uses 4 severity levels to classify violations:
Low - minor violations, warnings
Medium - moderate violations, require attention
High - serious violations, may result in penalties
Critical - grounds for contract termination
Workflow
Typical violation documentation process:
Detection
Owner detects a contract violation
Documentation
Create a record with description, date and severity level
Evidence
Attach photos and link to contract clauses
Notification
Violator can view the recorded violation
Permissions
Different users have different permissions:
| Action | Who can |
|---|---|
| Create violation | Owners, administrators |
| View violation | Owners, administrators, violator |
| Edit violation | Owners, administrators |
| Delete violation | Owners, administrators |
| Attach documents | Owners, administrators |
Automatic Overdue Payment Control
The system automatically detects late payments and creates contract violations. A daily cron job (app:payments:check-overdue) runs at 05:00 UTC and checks the previous month's payments.
How it works
- For each property with an active contract, the system reads RENT_PAYMENT_DAY and UTILITIES_PAYMENT_DAY + grace period from the contract blocks
- Finds payments made after the deadline (charge date + grace period)
- Groups overdue payments by deadline date
- Creates a ContractViolation with auto-generated description in the tenant's language
- Links overdue payments to the violation via
violation_overdue_paymentsjunction table
Severity rules
| Days overdue | Severity | Level |
|---|---|---|
| 1–5 | 3 | Low |
| 6–14 | 5 | Medium |
| 15–30 | 7 | High |
| 31+ | 9 | Critical |
Utilities overdue always gets severity 5 (medium).
If a contract does not have RENT_PAYMENT_DAY or UTILITIES_PAYMENT_DAY blocks — no violation is created for that type.
Payment linking
Each violation can be linked to one or more overdue payments. One payment can be linked to at most one violation (UNIQUE constraint). Payments can also be linked manually when creating or editing a violation.
REST API
REST API for integration with external systems:
Service layer note
GET /api/v1/properties/{id}/violations - List violations
POST /api/v1/properties/{id}/violations - Create violation
GET /api/v1/properties/{id}/violations/{vid} - Violation details
PUT /api/v1/properties/{id}/violations/{vid} - Update violation
DELETE /api/v1/properties/{id}/violations/{vid} - Delete violation
POST /api/v1/properties/{id}/violations/{vid}/documents - Attach document
DELETE /api/v1/properties/{id}/violations/{vid}/documents/{did} - Detach document
GET /api/v1/properties/{id}/violations/{vid}/overdue-payments - List linked overdue payments
POST /api/v1/properties/{id}/violations/{vid}/overdue-payments - Link payments (payment_ids[])
DELETE /api/v1/properties/{id}/violations/{vid}/overdue-payments/{payId} - Unlink payment
GET /api/v1/properties/{id}/overdue-payments - List unlinked overdue payments
Example Response
{
"data": [
{
"id": 1,
"property_id": 5,
"contract_id": 12,
"violation_date": "2026-01-10",
"severity": 7,
"severity_level": "high",
"description": "Unauthorized subletting of the property to third party",
"violator": {
"id": 15,
"name": "John Tenant"
},
"created_by": {
"id": 8,
"name": "Owner Name"
},
"documents_count": 2,
"blocks": [
{
"id": 5,
"code": "SUBLETTING",
"name": "Subletting Prohibition"
}
],
"created_at": "2026-01-10T14:30:00+00:00"
}
],
"total": 1,
"page": 1,
"totalPages": 1
}
Swagger / OpenAPI
Full API documentation is available at /api/v1/doc