Intry

Data model

Core Prisma entities and critical field names for Intry.

Overview

The canonical schema lives in prisma/schema.prisma. IDs are UUIDs (or cuid for some newer models) created by the database.

Hierarchy

Tenant (property management org)
 ├── Property (site / building)
 │    ├── Unit (apartment or suite)
 │    │    ├── VirtualNumber (E.164, telephonyProvider)
 │    │    ├── Call → Approval(s)
 │    │    ├── GuestPass (when enabled)
 │    │    └── Residents (User, many-to-many)
 │    ├── GuestPassPolicy
 │    └── AccessPoint (gate hardware)
 ├── User (admins, PMs, staff, residents)
 │    └── Device (push tokens, platform)
 ├── Invite (resident onboarding)
 ├── ImportBatch (CSV / CSVBox imports)
 └── Subscription / billing (Stripe fields on Tenant)

In product language, a Tenant is often called an organization or management company.

Entities (selected)

ModelPurpose
TenantTop-level B2B customer; owns properties, users, entitlements JSON, Stripe customer, plan tier fields.
PropertyPhysical site; timezone default America/New_York; optional telephonyProviderOverride.
UnitLeasable unit; unitLabel is the human-visible identifier (not number / name).
VirtualNumberCarrier number in E.164 (e164); telephonyProvider (twilio | telnyx); optional quarantineUntil for pool hygiene.
UserSingle name field; roles include admin, property_manager, staff, resident. Links to WorkOS, Clerk where applicable.
DeviceMobile installation; use isEnabled (not enabled).
CallVoice session; startedAt, durationSec, finalState.
ApprovalResident decision; action is approve or deny.
InviteResident onboarding token tied to a unit; status PENDING | ACCEPTED | EXPIRED.
ImportBatchBulk import job (csvbox, csv, api); dry-run preview → commit → optional rollback.
GuestPassTime-bound visitor access with PIN or link; gated by property GuestPassPolicy.
SubscriptionUsageLogMetered billing usage events for Stripe.

Plan tier vs entitlements

  • Tenant.planTier / Clerk org publicMetadata.plan_tier: Core, Standard, Pro, Trial (ADR-005).
  • Tenant.entitlements: JSON module flags (guest passes, delivery scan, etc.). null means all modules enabled for backward compatibility.

See repo runbook docs/TENANT_ENTITLEMENTS.md for the current key set.

Naming pitfalls

Virtual number cap

Each tenant is allowed unitCount + 5 virtual numbers (IN-203). The +5 buffer allows self-service without platform admin involvement.


Last verified: 2026-06-21 (commit 293c4a7)

On this page