Turfi Platform Documentation
Official Turfi documentation portal for users, admins, and developers.
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
| column | type | nullable | default | notes | |
|---|---|---|---|---|---|
| address_line1 | string \ | null | yes | null | Base table field. |
| address_line2 | string \ | null | yes | null | Base table field. |
| city | string | no | none | Base table field. | |
| country | string \ | null | yes | null | Base table field. |
| created_at | string | no | database default or generated | Base table field. | |
| 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. | |
| key | string | no | none | Base table field. | |
| location | unknown | no | database default or generated | Base table field. | |
| name | string | no | none | Base table field. | |
| normalized_name | string \ | null | yes | null | Base table field. |
| owner_organization_id | string \ | null | yes | null | Relationship-bearing column. |
| phone | string \ | null | yes | null | Base table field. |
| postal_code | string \ | null | yes | null | Base table field. |
| province | string | no | none | Base table field. | |
| slug | string \ | null | yes | null | Base table field. |
| status | string | no | database default or generated | Lifecycle field when present. | |
| updated_at | string | no | database default or generated | Base table field. | |
| venue_type | string \ | null | yes | null | Base table field. |
| website | string \ | null | yes | null | Base table field. |
Foreign Keys
| column | references | table | on delete |
|---|---|---|---|
| owner_organization_id | id | organizations | 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_venues | Curated admin registry read model for venues. |
3. Import Contract
Accepted Columns
keynameslugowner_organization_keyowner_organizationowner_organization_idvenue_typeaddress_line1cityprovincecountrywebsitestatus
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
keyslugowner_organization_keyowner_organizationowner_organization_idvenue_typeaddress_line1cityprovincecountrywebsitestatus
Failure Rules
- Missing
namefails 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
| label | field | source |
|---|---|---|
| Name | name | v_venues.name / venues.name |
| Managed By | management_name | api_businesses / owner_organization_name |
| Address | address | venue.address / address_line1 |
| City | city | venues.city |
| Province | province | venues.province |
| Phone | phone | venues.phone |
| venues.email | ||
| Website | website | venues.website |
| Status | status | venues.status / derived is_active |
Filters
| filter | field | type |
|---|---|---|
| Search | name, management_name, address, city, province | text substring |
| Managed By | management_id | select |
| Province | province | select |
| Status | status | select |
Display Logic
- Management display prefers a business matched by venue name, then falls back to owner organization name.
- Status can be synthesized from
is_activewhen 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.