Last deployment:

Turfi Platform Documentation

Official Turfi documentation portal for users, admins, and developers.

Back to support

Documentation Search

Search only within Turfi documentation pages.

C

Venues

Venue registry contract, import write rules, and admin read-model expectations.

Entity: Venues

1. Overview

  • Venue registry for physical locations, ownership, and facility-level metadata used by games and turf management.
  • May belong to an owner organization.
  • Owns one or more turfs.
  • Can be linked to businesses and shared address/contact data.
  • Visible at /admin/data/registries/venues.

2. Database Schema

Columns

columntypenullabledefaultnotes
address_line1string \nullyesnullBase table field.
address_line2string \nullyesnullBase table field.
citystringnononeBase table field.
countrystring \nullyesnullBase table field.
created_atstringnodatabase default or generatedBase table field.
emailstring \nullyesnullBase table field.
idstringnogenerated UUID defaultBase table field.
is_activebooleannodatabase default or generatedBase table field.
keystringnononeBase table field.
locationunknownnodatabase default or generatedBase table field.
namestringnononeBase table field.
normalized_namestring \nullyesnullBase table field.
owner_organization_idstring \nullyesnullRelationship-bearing column.
phonestring \nullyesnullBase table field.
postal_codestring \nullyesnullBase table field.
provincestringnononeBase table field.
slugstring \nullyesnullBase table field.
statusstringnodatabase default or generatedLifecycle field when present.
updated_atstringnodatabase default or generatedBase table field.
venue_typestring \nullyesnullBase table field.
websitestring \nullyesnullBase table field.

Foreign Keys

columnreferencestableon delete
owner_organization_ididorganizationsNO ACTION

Indexes

No migration-defined indexes were discovered in the checked-in SQL history for this table.

Constraints

  • Unique: none discovered in checked-in migrations.
  • Check: none discovered in checked-in migrations.

Triggers

No migration-defined triggers were discovered in the checked-in SQL history for this table.

Views (if any)

namepurpose
v_venuesCurated admin registry read model for venues.

3. Import Contract

Accepted Columns

  • key
  • name
  • slug
  • owner_organization_key
  • owner_organization
  • owner_organization_id
  • venue_type
  • address_line1
  • city
  • province
  • country
  • website
  • status

Resolution Rules

  • Owner organization fields resolve key first, then slug, then name for non-suffixed input.
  • Address text is normalized through the shared address contract before venue persistence.

Required Fields

  • name

Optional Fields

  • key
  • slug
  • owner_organization_key
  • owner_organization
  • owner_organization_id
  • venue_type
  • address_line1
  • city
  • province
  • country
  • website
  • status

Failure Rules

  • Missing name fails immediately.
  • Owner organization mismatches route through relationship resolution before write.
  • Status and venue-type mismatches fail validation once normalized values cannot be produced.

4. Frontend Registry Mapping

Grid Columns

labelfieldsource
Namenamev_venues.name / venues.name
Managed Bymanagement_nameapi_businesses / owner_organization_name
Addressaddressvenue.address / address_line1
Citycityvenues.city
Provinceprovincevenues.province
Phonephonevenues.phone
Emailemailvenues.email
Websitewebsitevenues.website
Statusstatusvenues.status / derived is_active

Filters

filterfieldtype
Searchname, management_name, address, city, provincetext substring
Managed Bymanagement_idselect
Provinceprovinceselect
Statusstatusselect

Display Logic

  • Management display prefers a business matched by venue name, then falls back to owner organization name.
  • Status can be synthesized from is_active when a direct status field is absent in the read model.
  • Venue forms bundle shared address and contact editors.

5. Lifecycle Rules

  • Venue lifecycle should prefer inactive/archive semantics over delete because games reference venues directly.
  • Venue ownership and location changes must preserve turf and game relationships.