Compliance Engine

One jobsite. Any country.
The right paperwork.

The backend engine that resolves a jobsite's country into the exact permit and zoning paperwork that jurisdiction requires — then hands the form back using the same server-driven UI schema every other engine already speaks, so no new rendering code was needed to display it.

Strategy Pattern Jurisdiction Forms Shared UI Schema Where It Runs
Strategy Pattern

One country code in.
One correct form out

Construction paperwork isn't the same everywhere. Compliance Engine centralizes jurisdiction logic behind a single Strategy Pattern — a PermitStrategy interface with one concrete class per country, so adding a new jurisdiction means writing one class, not touching every screen that needs paperwork.

  • One PermitStrategy class per jurisdiction — TR, US, and more
  • A DefaultPermitStrategy fallback that never throws
  • resolveComplianceStrategy(countryCode) picks the right class
  • New countries plug in without touching existing screens
Open Permits & Zoning
totalapp.app / compliance-engine
resolveComplianceStrategy(countryCode)
countryCode: "TR" → TRPermitStrategy
Ada/Parsel/Pafta, SGK Sicil No, TAKS/KAKS
countryCode: "US" → USPermitStrategy
Parcel ID, Contractor License, OSHA Cert
Unrecognized code → DefaultPermitStrategy
Never throws — always returns a schema
Jurisdiction Forms

The fields a Turkish site
and a US site actually need

A Turkish jobsite files Ada, Parsel and Pafta cadastral references, an SGK Sicil No, and TAKS/KAKS floor-area ratios. A US jobsite instead files a Parcel ID, a Contractor License Number, and an OSHA Certification Number. Each strategy returns exactly the field set its jurisdiction requires.

  • TR: Ada/Parsel/Pafta, Müteahhit SGK Sicil No, TAKS/KAKS
  • US: Parcel ID, Contractor License No, OSHA Certification
  • Regex validation carried directly on each field, no extra code
  • jobsiteId captured for the audit trail on every call
Generate a Permit Form
totalapp.app / permit-form
TRPermitStrategy — building_permit
Ada / Parsel / Pafta
Cadastral reference fields, required for every TR jobsite record.
Müteahhit SGK Sicil No
Regex-validated contractor registration number, enforced by the shared input renderer.
Shared UI Schema

No new renderer.
No new schema format

The engine's output isn't raw HTML or a hardcoded form — it's a UiComponent tree, the exact schema shape the UI Rendering Engine already defines. The same <DynamicScreenRenderer> that paints Matrix Agent's approval screens paints a Compliance Engine permit form too.

  • Reuses UiComponent/UiComponentKind/UiVariant directly
  • Zero new frontend rendering code for this engine's output
  • A jurisdiction form and an approval screen render through one path
  • Every generation logged via the Event & Analytics Engine
See It Render
totalapp.app / ui-schema
getPermitFormSchema(permitType) UiComponent
<DynamicScreenRenderer> Reused
compliance-engine.schema.generated Logged
Where It Runs

Three screens today,
any add-on tomorrow

A "Generate Form" button on Permit Applications, Zoning & Land Use Rules, and Legal Contracts & Liens calls this engine with the jobsite's resolved jurisdiction and renders the result inline — without either screen containing a single line of country-specific form code.

  • Powers Permit Applications, Zoning Rules, and Legal Contracts & Liens
  • Each screen carries its own jurisdiction picker, overridable per record
  • Pre-filled from the jobsite via useJobsiteJurisdiction()
  • Any future add-on with country-specific paperwork can reuse it
Explore Construction
totalapp.app / permits-zoning-compliance
Permit Applications LIVE
Zoning & Land Use Rules LIVE
Legal Contracts & Liens LIVE
All Capabilities

Everything in the box

Compliance Engine ships a jurisdiction-resolution strategy layer, ready to power any add-on with country-specific paperwork.

Strategy Pattern Core

One PermitStrategy interface, one concrete class per jurisdiction, and a DefaultPermitStrategy fallback that never throws.

Jurisdiction-Correct Fields

TR strategies return Ada/Parsel/SGK/TAKS/KAKS; US strategies return Parcel ID/Contractor License/OSHA — no shared hardcoded form.

Reused UI Schema

Output is a UiComponent tree — the same shape the UI Rendering Engine defines — so no new renderer was written.

Three Screens, One Call

Permit Applications, Zoning & Land Use Rules, and Legal Contracts & Liens all call the same fetchComplianceSchema().

Regex Field Validation

Fields like Contractor License Number carry a regex prop directly, enforced by the shared input renderer automatically.

Tracked Every Call

Every schema generation logs a success/failure event via the Event & Analytics Engine — same usage history as every other engine.