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

Clubs

Club registry contract.

Entity: Clubs

1. Overview

  • Club registry connecting organizations, licensing, identity, and shared communication/address data used throughout player and team workflows.
  • Belongs to an organization.
  • May carry a club license level lookup assignment.
  • Owns teams and participates in address/contact-linked infrastructure records.
  • Visible at /admin/data/registries/clubs.

2. Database Schema

Columns

columntypenullabledefaultnotes
address_idstring \nullyesnullRelationship-bearing column.
citystring \nullyesnullBase table field.
club_license_lookup_idstring \nullyesnullRelationship-bearing column.
countrystring \nullyesnullBase table field.
created_atstringnodatabase default or generatedBase table field.
emailstring \nullyesnullBase table field.
idstringnogenerated UUID defaultBase table field.
keystringnononeBase table field.
license_level_idstring \nullyesnullRelationship-bearing column.
logo_urlstring \nullyesnullBase table field.
namestringnononeBase table field.
normalized_namestring \nullyesnullBase table field.
organization_idstring \nullyesnullRelationship-bearing column.
phonestring \nullyesnullBase table field.
provincestring \nullyesnullBase table field.
short_namestring \nullyesnullBase table field.
slugstring \nullyesnullBase table field.
statusstringnodatabase default or generatedLifecycle field when present.
updated_atstringnodatabase default or generatedBase table field.
websitestring \nullyesnullBase table field.

Foreign Keys

columnreferencestableon delete
address_ididaddressesNO ACTION
license_level_ididclub_license_levelsNO ACTION
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_clubsCurated admin registry read model for clubs.

3. Import Contract

Accepted Columns

  • key
  • name
  • short_name
  • slug
  • status
  • organization_key
  • organization
  • organization_id
  • license_level_code
  • license_level
  • license_level_id
  • logo_url
  • address_line1
  • address_line2
  • city
  • province
  • postal_code
  • country
  • phone
  • email
  • website

Resolution Rules

  • organization_key resolves by organization key.
  • Organization and license-level non-suffixed inputs resolve by key, then slug, then name when applicable.
  • Address inputs are normalized into shared address records before the club write contract is assembled.

Required Fields

  • name

Optional Fields

  • key
  • short_name
  • slug
  • status
  • organization_key
  • organization
  • organization_id
  • license_level_code
  • license_level
  • license_level_id
  • logo_url
  • address_line1
  • address_line2
  • city
  • province
  • postal_code
  • country
  • phone
  • email
  • website

Failure Rules

  • Missing name fails immediately.
  • Unresolved organization or invalid license-level values route through mismatch handling before persistence.
  • Delete is blocked by governed entity protections when dependencies exist.

4. Frontend Registry Mapping

Grid Columns

labelfieldsource
Namenamev_clubs.name / clubs.name
License Levellicense_level_nameclub_license_levels
Addressaddressv_clubs.address / addresses
Citycityv_clubs.city / addresses.city
Provinceprovincev_clubs.province / addresses.province
Phonephoneclubs.phone
Emailemailclubs.email
Websitewebsiteclubs.website
Organizationorganization_nameorganizations.name
Statusstatusclubs.status

Filters

filterfieldtype
Searchnametext substring
Organizationorganization_idselect
Provinceprovincedistinct select
Licenselicense_level_idlookup select
Statusstatusselect

Display Logic

  • Organization displays as the resolved association name in the curated registry.
  • Address is flattened for grid display and phone is formatted.
  • Club read behavior prefers v_clubs and falls back to base tables plus joined lookups.

5. Lifecycle Rules

  • Clubs are governed entities and use the protected delete flow.
  • Lifecycle status should preserve historical team and player relationships rather than relying on destructive delete.
  • License level changes are administrative metadata updates and should not mutate identity keys.