Skip to main content
All Docs
FeaturesagentOS Block ManagerUpdated April 13, 2026

Compliance & Works Management

Compliance & Works Management

The compliance module provides a central data layer for managing regulatory certificates, contractor records, maintenance works orders, and site inspections across your block portfolio.

Overview

Four entities make up the compliance module:

EntityPurpose
ContractorsOrg-wide directory of contractors with trade, accreditation, and insurance details
Compliance CertificatesPer-block register of all compliance and regulatory certificates
Maintenance WorksWorks orders tracking reactive and planned maintenance with a status workflow
InspectionsScheduled and ad-hoc site inspections with completion reporting

All entities are scoped to your organisation. Certificates and works orders are additionally scoped to a specific block.


Contractors

The contractor directory is shared across your entire portfolio. A contractor record stores the information needed to vet and assign a contractor to works or certificates.

Fields

FieldDescription
companyNameCompany or trading name (required)
tradePrimary trade category (required)
additionalTradesSecondary trade categories (JSON array string)
contactNamePrimary contact person
emailPrimary email address
phonePrimary phone number
addressLine1, addressLine2, city, postcodePostal address
websiteWebsite URL
gasSafeNumberGas Safe Register number
niceicNumberNICEIC registration number
accreditationsOther registration numbers (JSON string)
publicLiabilityInsuranceExpiryPublic liability expiry date
publicLiabilityInsurancePolicyNumberPublic liability policy number
professionalIndemnityInsuranceExpiryProfessional indemnity expiry date
professionalIndemnityInsurancePolicyNumberProfessional indemnity policy number
employersLiabilityInsuranceExpiryEmployers' liability expiry date
employersLiabilityInsurancePolicyNumberEmployers' liability policy number
isActiveWhether the contractor is available for new works (default: true)
ratingInternal rating, 1–5 (optional)
notesFree-text internal notes

Trade Categories

plumbing · electrical · gas · fire_safety · lift_engineering · roofing · painting_decorating · cleaning · landscaping · locksmith · pest_control · general_building · surveying · asbestos · damp_proofing · scaffolding · security · glazing · carpentry · other

Permissions

  • List / read: any org member
  • Create / update / delete: admin role required

Compliance Certificates

Each block has its own certificate register. Certificates track the status of all regulatory and compliance documents required for the block.

Certificate Types

TypeCommon Renewal Period
gas_safetyAnnual (CP12)
electrical_eicrEvery 5 years
fire_risk_assessmentReviewed annually
ews1As required (cladding)
asbestos_surveyReviewed every 12 months
legionellaReviewed every 2 years
lift_inspectionEvery 6 months (LOLER)
epcEvery 10 years
pat_testingAnnual
lightning_protectionAnnual
water_hygienePeriodic
emergency_lightingAnnual
dry_riserEvery 6 months
otherAs required

Status (RAG)

StatusMeaning
validCurrent; not due to expire within 30 days
expiring_soonExpires within 30 days
expiredPast expiry date
not_applicableNot required for this block

Key Fields

FieldDescription
blockIdThe block this certificate belongs to
certificateTypeOne of the 14 types above
statusRAG status
issuedDateDate the certificate was issued (required)
expiryDateCertificate expiry date
nextReviewDateNext review date (may differ from expiry)
issuerIssuing body or engineer name
contractorIdLinked contractor who issued the certificate
fileUrlDirect URL to the certificate file
documentIdDocument vault reference for version-controlled storage
responsiblePersonName of person responsible for renewal
responsibleUserIdPlatform user ID of the responsible person
referenceCertificate reference number or description

Permissions

  • List / read: any org member
  • Create / update / delete: admin role required

Maintenance Works Orders

Works orders track reactive and planned maintenance tasks from initial request through to completion.

Status Workflow

draft → approved → in_progress → complete
                              → cancelled

When a works order transitions to approved, the approvedBy (user ID) and approvedAt (timestamp) fields are automatically set.

Priority Levels

PriorityTypical Response
emergencyImmediate (e.g. gas leak, flood)
urgentWithin 24 hours (e.g. broken entry system)
routineWithin 7 days (e.g. communal light replacement)
plannedScheduled maintenance (e.g. annual gutter clear)

Key Fields

FieldDescription
blockIdThe block this works order is for
titleHuman-readable title (required)
descriptionDetailed scope of work
statusCurrent workflow status
priorityPriority level
contractorIdAssigned contractor
costEstimatePenceEstimated cost in pence
actualCostPenceActual cost in pence (on completion)
invoiceReferencePurchase order or invoice reference
raisedDateDate the order was raised (required)
scheduledDatePlanned start date
completionDateDate works were completed
certificateIdLinked compliance certificate (for certificate-driven works)
unitIdSpecific unit, if works are unit-scoped
raisedByUser ID of the person who raised the order (auto-set)
approvedByUser ID of approver (auto-set on approval)
approvedAtApproval timestamp (auto-set on approval)

Permissions

  • List / read: any org member
  • Create / update / delete: admin role required

Inspections

Inspections record scheduled and completed site visits. They can be recurring (with a defined frequency) or ad-hoc.

Inspection Types

general_site · fire_safety · health_safety · lift · roof · drainage · communal_areas · external_fabric · grounds · move_in_out · other

Move-in/move-out inspections can be scoped to a specific unit via the unitId field.

Status

scheduled → completed
          → overdue
          → cancelled

When an inspection is updated to completed and no lastCompletedDate is provided, it is automatically set to the current timestamp.

Frequencies

weekly · fortnightly · monthly · quarterly · half_yearly · annually · ad_hoc

Default frequency is quarterly.

Key Fields

FieldDescription
blockIdThe block being inspected
inspectionTypeType of inspection
titleHuman-readable title (required)
descriptionScope or notes
frequencyRecurrence schedule
nextDueDateWhen the next inspection is due
scheduledDateDate of the scheduled inspection
lastCompletedDateDate last completed (auto-set on completion)
inspectorNameName of the inspector
inspectorUserIdPlatform user ID of the inspector
findingsHtmlInspection report / findings (HTML)
conditionRatingOverall condition rating, 1–5
defectsFoundWhether defects were identified
defectCountNumber of defects identified
unitIdSpecific unit (for move-in/move-out inspections)

Permissions

  • List / read: any org member
  • Create / update / delete: admin role required

Audit Logging

Every create, update, and delete action across all four compliance entities is written to the audit log. This satisfies the pinned spec requirement: "Compliance Audit Trail — All Compliance Actions Logged".

Logged actions:

contractor.created
contractor.updated
contractor.deleted
compliance_certificate.created
compliance_certificate.updated
compliance_certificate.deleted
maintenance_works.created
maintenance_works.updated
maintenance_works.deleted
inspection.created
inspection.updated
inspection.deleted

The audit log entry includes the orgId, userId, resourceType, resourceId, and contextual metadata (e.g. block ID, certificate type, previous status on works updates).


Data Relationships

blocks
  ├── compliance_certificates (many)
  │     └── contractors (one, optional — issuer)
  │     └── documents   (one, optional — vault reference)
  ├── maintenance_works (many)
  │     ├── contractors           (one, optional — assigned)
  │     ├── compliance_certificates (one, optional — linked cert)
  │     └── units                 (one, optional — unit scope)
  └── inspections (many)
        └── units (one, optional — unit scope)

contractors
  ├── compliance_certificates (many — as issuer)
  └── maintenance_works       (many — as assigned contractor)

Multi-Tenant Isolation

All four tables (contractors, compliance_certificates, maintenance_works, inspections) are covered by row-level security (RLS), enforcing strict data isolation between organisations at the database level. All router procedures additionally filter by orgId from the authenticated session. Block-scoped operations validate that the target block belongs to the caller's organisation before any write is performed.