Turfi Platform Documentation
Official Turfi documentation portal for users, admins, and developers.
Documentation Search
Search only within Turfi documentation pages.
C
Turfs
Turf registry contract.
Entity: Turfs
1. Overview
- Field-level infrastructure registry for playable surfaces attached to venues and used directly by game scheduling and event references.
- Belongs to a venue.
- Supplies field format and surface metadata used by games and facility operations.
- Visible at
/admin/data/registries/turfs.
2. Database Schema
Columns
| column | type | nullable | default | notes | |
|---|---|---|---|---|---|
| created_at | string | no | database default or generated | Base table field. | |
| field_format | string \ | null | yes | null | Base table field. |
| id | string | no | generated UUID default | Base table field. | |
| is_active | boolean | no | database default or generated | Base table field. | |
| is_indoor | boolean | no | database default or generated | Base table field. | |
| is_lit | boolean | no | database default or generated | Base table field. | |
| key | string | no | none | Base table field. | |
| length_m | number \ | null | yes | null | Base table field. |
| name | string | no | none | Base table field. | |
| normalized_name | string \ | null | yes | null | Base table field. |
| slug | string \ | null | yes | null | Base table field. |
| status | string | no | database default or generated | Lifecycle field when present. | |
| surface_type | string \ | null | yes | null | Base table field. |
| updated_at | string | no | database default or generated | Base table field. | |
| venue_id | string | no | none | Relationship-bearing column. | |
| width_m | number \ | null | yes | null | Base table field. |
Foreign Keys
| column | references | table | on delete |
|---|---|---|---|
| venue_id | id | venues | NO 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)
| name | purpose |
|---|---|
| v_turfs | Curated admin registry read model for turfs. |
3. Import Contract
Accepted Columns
keynameslugvenue_keyvenuevenue_idsurface_typefield_formatis_indooris_litlength_mwidth_mstatus
Resolution Rules
venue_keyresolves by venue key.- Non-suffixed venue input resolves by
key, thenslug, thenname.
Required Fields
namevenue_key
Optional Fields
keyslugvenuevenue_idsurface_typefield_formatis_indooris_litlength_mwidth_mstatus
Failure Rules
- Venue resolution fails hard because turfs cannot exist safely without a venue.
- Invalid surface/format/status values fail validation after normalization attempts.
4. Frontend Registry Mapping
Grid Columns
| label | field | source |
|---|---|---|
| Name | name | v_turfs.name / turfs.name |
| Venue | venue_name | venues.name |
| Address | address | turf / related venue address |
| City | city | related venue.city |
| Province | province | related venue.province |
| Format | format_name | turfs.field_format |
| Type | type_name | turfs.surface_type / type |
| Status | status | turfs.status / derived activity flags |
Filters
| filter | field | type |
|---|---|---|
| Search | name, venue_name, address, city, province | text substring |
| Venue | venue_id | select |
| Format | format_name | select |
| Type | type_name | select |
| Province | province | select |
| Status | status | select |
Display Logic
- Venue-enriched read rows backfill city, province, address, and sometimes status from the related venue.
- Format and type are normalized display aliases over raw field attributes.
5. Lifecycle Rules
- Turfs should be marked inactive instead of deleted when they have historical game usage.
- Venue linkage is mandatory for safe operations because games reference both venue and turf.